Skip to content

Commit

Permalink
Add notes about crs metadata in GeoParquet files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kontinuation committed Dec 27, 2023
1 parent 4f856f5 commit 8d108a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/tutorial/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,13 @@ df.write.format("geoparquet")
.save(geoparquetoutputlocation + "/GeoParquet_File_Name.parquet")
```

You can find the projjson string of a specific CRS from here: https://epsg.io/ (click the JSON option at the bottom of the page). You can also customize your projjson string as needed.

Please note that Sedona currently cannot set/get a projjson string to/from a CRS. Its geoparquet reader will ignore the projjson metadata and you will have to set your CRS via [`ST_SetSRID`](../api/sql/Function.md#st_setsrid) after reading the file.
Its geoparquet writer will not leverage the SRID field of a geometry so you will have to always set the `geoparquet.crs` option manually when writing the file, if you want to write a meaningful CRS field.

Due to the same reason, Sedona geoparquet reader and writer do NOT check the axis order (lon/lat or lat/lon) and assume they are handled by the users themselves when writing / reading the files. You can always use [`ST_FlipCoordinates`](../api/sql/Function.md#st_flipcoordinates) to swap the axis order of your geometries.

## Sort then Save GeoParquet

To maximize the performance of Sedona GeoParquet filter pushdown, we suggest that you sort the data by their geohash values (see [ST_GeoHash](../../api/sql/Function/#st_geohash)) and then save as a GeoParquet file. An example is as follows:
Expand Down

0 comments on commit 8d108a1

Please sign in to comment.