h3 index converted to Geocoordinates: how to export to geojson
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia dal punto di ingresso H3.instance.h3ToGeoBoundary e dai due esempi di Spark UDF nell'issue, inclusa la UnsupportedOperationException per List. Determina la rappresentazione prevista per GeoJSON, GeoMesa o GeoSpark e definisci il completamento come un modo supportato e documentato per elaborare molti indici senza convertire i confini esclusivamente in stringhe.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi,
I had 2 quesions related to using h3ToGeoBoundary:
Question 1:
I am doing some preprocessing in spark using h3, and I want to save my results into a format that can easily be exported. My goal is to load the data in geomesa/geoserver. I notice that using h3ToGeoBoundary I get results that are a list of GeoCoord like this:
[GeoCoord{lat=50.346809, lng=14.153511}, GeoCoord{lat=50.316251, lng=14.138129}, GeoCoord{lat=50.294416, lng=14.173950}, GeoCoord{lat=50.303130, lng=14.225160}, GeoCoord{lat=50.333686, lng=14.240581}, GeoCoord{lat=50.355530, lng=14.204753}]
I assume this is the google coordinate type: https://pub.dev/documentation/google_directions_api/latest/google_directions_api/GeoCoord-class.html.
But is this compatible with geospark/geomesa?
It would be very helpful, if there was an option to save this as let's say geojson like there is for h3-js (https://github.com/uber/h3-js#module_h3.h3ToGeoBoundary where a boolean decides how it is saved).
Is there an example somewhere, if I have let's say 10k h3 indexes how to save it into a format that other geospatial tools (geomesa or geospark ) can read?
Question2:
Also when I want to apply a udf to a full column with h3 indexes, this works:
//works
val h3ToGeoBoundary = udf{ (h3Index: Long) =>
H3.instance.h3ToGeoBoundary(h3Index).toString()
}
but this does not:
//does not work
val h3ToGeoBoundaryGeoJson = udf{ (h3Index: Long) =>
H3.instance.h3ToGeoBoundary(h3Index)
}
//error:java.lang.UnsupportedOperationException: Schema for type java.util.List[com.uber.h3core.util.GeoCoord] is not supported
This means that if I want to create a dataframe with couple 1000 rows, I can only have that in string format, which does not allow me to do transformations on it (like selecting each element of the list, and using those coordinates to turn it myself into geojson).
Any clue how to solve this?
Thanks!
PS: great job-very user friendly and cool library.
- Lingua principale
- Java
- Stelle
- 333
- Fork
- 68
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
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 uber/h3-java
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
Tutte le issue di uber/h3-java
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
ci-failure-cause test-failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nextcloud/notes-android#3367 ·
I maintainer di solito rispondono entro 1 giorno
-
:wave: team-triage a:chore in:isolated-projects in:kotlin-dsl
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno