Request for Guidance - Point in Polygon and S2
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- computer-graphics, mobile-dev
Direzione di ricerca
Non vengono indicati file del repository, test o punti di ingresso. Inizia esaminando le API referenziate S2Polygon, S2PolygonBuilder, S2Loop e S2Point, quindi chiarisci quali delle sei domande su Android e point-in-polygon offline dovrebbero diventare una modifica concreta al repository; il lavoro è completato quando sono stati concordati l’ambito e i criteri di accettazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Java
- Stelle
- 587
- Fork
- 232
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/s2-geometry-library-java
-
Possible bug in compareEdgesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
google/s2-geometry-library-java#56 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
google/s2-geometry-library-java#47 · 2 commenti ·
-
Added new ant target docs: "Generate documentation"Forse già presa @ThomasThelen l’ha presa 183 giorni fa. Apertaauto-migrated Type-Patch
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
google/s2-geometry-library-java#2 · 1 commento ·
-
FR: Add bazel supportAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di google/s2-geometry-library-java
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
portfolio-performance/portfolio#6119 ·
I maintainer di solito rispondono entro 8 giorni
-
Bump up AWS SDK to 2.54.3Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
jenkinsci/ec2-plugin#2041 ·
-
L: github:actions L: php:composer
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
dependabot/dependabot-core#16493 ·
I maintainer di solito rispondono entro 1 giorno
-
SHOW EDIT of a subclass for an object of its superclass: the form fails to open with AssertionErrorAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100