Validation for self-intersection WKT Multipolygon fails at the WKTReader, while works when wrapped in a `GEOMETRYCOLLECTION`
Nadie ha tomado este issue todavía.
- #238 de @arimu1 — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza reproduciendo ambas entradas con WKTReader.parse y, después, lee WKTReader.java alrededor de parseGeometryCollectionShape, así como JtsShapeFactory.java alrededor de makeShapeFromGeometry y JtsMultiShapeBuilder.build. Compara cómo se validan el MultiPolygon independiente y el envuelto; se considera terminado cuando ambas variantes se comporten de forma coherente en el caso de autointersección indicado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Used version 0.8.
We encountered that parsing a WKT MultiPolygon containing a self-intersection works while it will raise a validation error when it is wrapped into a GEOMETRYCOLLECTION.
This code parses the WKT string into a valid MultiPolygon instance.
var reader = (WKTReader) JtsSpatialContext.GEO.getFormats().getWktReader();
var shape = reader.parse(''MULTIPOLYGON (((5 5, 10 5, 10 10, 5 5)), ((6 6, 10 5, 10 10, 6 6)))');
While this one raises a InvalidShapeException:
var reader = (WKTReader) JtsSpatialContext.GEO.getFormats().getWktReader();
var shape = reader.parse(''GEOMETRYCOLLECTION ( MULTIPOLYGON (((5 5, 10 5, 10 10, 5 5)), ((6 6, 10 5, 10 10, 6 6))) )');
Stacktrace:
Caused by: org.locationtech.spatial4j.exception.InvalidShapeException: Self-intersection at or near point (10.0, 5.0, NaN)
at org.locationtech.spatial4j.shape.jts.JtsGeometry.validate(JtsGeometry.java:127)
at org.locationtech.spatial4j.shape.jts.JtsShapeFactory.makeShapeFromGeometry(JtsShapeFactory.java:502)
at org.locationtech.spatial4j.shape.jts.JtsShapeFactory.makeShapeFromGeometry(JtsShapeFactory.java:475)
at org.locationtech.spatial4j.shape.jts.JtsShapeFactory$JtsMultiShapeBuilder.build(JtsShapeFactory.java:446)
at org.locationtech.spatial4j.io.WKTReader.parseGeometryCollectionShape(WKTReader.java:356)
at org.locationtech.spatial4j.io.WKTReader.parseShapeByType(WKTReader.java:165)
at org.locationtech.spatial4j.io.WKTReader.parseIfSupported(WKTReader.java:110)
at org.locationtech.spatial4j.io.WKTReader.parse(WKTReader.java:81)
I would expect that both variants behave the same.
- Lenguaje dominante
- Java
- Estrellas
- 962
- Forks
- 174
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de locationtech/spatial4j
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
locationtech/spatial4j#233 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
locationtech/spatial4j#231 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
locationtech/spatial4j#230 · 2 comentarios ·
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
locationtech/spatial4j#227 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
locationtech/spatial4j#221 ·
Todos los issues de locationtech/spatial4j
Issues similares
-
[Bug] The producer summary counts an unreported client version as a second version and warns about a version mixPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
apache/rocketmq-dashboard#6110 ·
Los mantenedores suelen responder en 4 días
-
`Processing lsp` never exits and leaves orphaned processesPosiblemente ocupada @overcast302 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
processing/processing4#1578 · 1 comentario ·
-
ASM is not up-to-dateAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
[BUG] S3 CORS responses omit Access-Control-Allow-Credentials for matched originsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
floci-io/floci#5369 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
securityHeaders replaces a route's own Content-Security-Policy (0.9.9; weakens embedders' pages)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día