Request for Guidance - Point in Polygon and S2
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Área
- computer-graphics, mobile-dev
Línea de trabajo
No se nombran archivos del repositorio, pruebas ni puntos de entrada. Empieza revisando las API referenciadas de S2Polygon, S2PolygonBuilder, S2Loop y S2Point, y después aclara cuáles de las seis preguntas sobre Android y point-in-polygon sin conexión deberían convertirse en un cambio concreto en el repositorio; el trabajo estará terminado cuando se hayan acordado el alcance y los criterios de aceptación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Would it be possible for the good folks here to please help me with a problem that I am trying to solve with the S2 geometry library? I am a complete novice, so please bear with me if I do not make sense.
Problem
I am trying to determine the best way to write an offline point-in-polygon check for the Android platform. Essentially, convert (lat,lng) to a country. In future, I plan to increase the granularity to regions, states, provinces, counties and cities/towns.
Research
My initial research landed me up on https://github.com/AReallyGoodName/OfflineReverseGeocode with http://download.geonames.org/export/dump/cities1000.zip. From what I understand, this is (lat,lng) to nearest neighbor. Now, I do get the country from this, but it relies on finding the nearest neighbor city with population, which may not be accurate.
Further research led me to S2. It is here that I am struggling, and request your guidance.
Current Approach
A) Computation at app startup:
- Get geojson co-ordinates from http://download.geonames.org/export/dump/shapes_simplified_low.zip.
- For each country,
i) Convert geojson co-ordinates into S2 LatLng and then S2 Loops.
ii) Build S2 Polygon using S2 Loops.
iii) If MultiPolygon, use S2PolygonBuilder.addPolygon() to add additional polygons.
B) LatLng input during app functioning:
- Convert Lat Lng Input to S2Point.
- Iterate over country polygons, checking for S2Polygon.contains(S2Point).
- Return country.
Questions
- Some geojson countries are "multipolygon", whereas there is no multipolygon in S2. Are S2 polygons equivalent to multipolygons from geojson?
- Can the geojson to S2Polygon initial computation result be persisted, to avoid re-computation at app startup?
- Geonames geojson input does not seem to conform to counter clockwise (CCW) convention. Would S2PolygonBuilder be able to tackle this correctly?
- Is there a better way to search for point-in-polygon rather than iterating over each countries S2Polygons.contains function call? Does this mechanism also help avoid polygon re-computation?
- Is there a better way to achieve the offline point-in-polygon check?
- Is there a better (small, accurate) source for country boundaries for use with S2?
Thank you for your time.
@eengle @hagbard @kluever @cpovirk
- Lenguaje dominante
- Java
- Estrellas
- 587
- Forks
- 232
- 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 google/s2-geometry-library-java
-
Possible bug in compareEdgesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
google/s2-geometry-library-java#56 · 1 comentario · 1 reacción ·
-
Infinite loop in coverer builderAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Build failure when mvn compileAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
google/s2-geometry-library-java#47 · 2 comentarios ·
-
Added new ant target docs: "Generate documentation"Posiblemente ocupada @ThomasThelen la tomó hace 181 días. Abiertoauto-migrated Type-Patch
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
google/s2-geometry-library-java#2 · 1 comentario ·
-
FR: Add bazel supportAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de google/s2-geometry-library-java
Issues similares
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
helidon-io/helidon#12721 ·
Los mantenedores suelen responder en 1 día
-
Upgrade to Spring RESTDocs 4.0.2Abiertostatus: team-only type: dependency-upgrade
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
spring-projects/spring-boot#51966 ·
Los mantenedores suelen responder en 1 día
-
Missing repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
software-mansion/react-native-reanimated#10816 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Broken link in Operator GuideAbiertoarea/docs backport/26.6 backport/26.8 kind/bug status/triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
[destination-snowflake] Custom domains rejected unlike source connectionsPosiblemente ocupada @kuza55 la tomó hoy. Abiertoautoteam community connectors/destination/snowflake team/use
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día