Skip to content

rust/sedona-geoparquet: GeoParquet writer can write authority:code CRSes where it should write PROJJSON CRSes #187

@paleolimbot

Description

@paleolimbot

In GeoArrow (and thus our geometry/geography types), we can and do use authority:code CRSes. Before we write to GeoParquet, we need to resolve that CRS into PROJJSON. I'd thought that when I first wrote that code it would reject non-JSON but this was not the case!

This doesn't affect CRSes that were derived from GeoPandas, which were PROJJSON already.

import json
from pyarrow import parquet
import sedona.db

sd = sedona.db.connect()
sd.sql("SELECT ST_SetSRID(ST_Point(0, 1), 26920) as geom").to_parquet("foofy.parquet")


geo = parquet.ParquetFile("foofy.parquet").metadata.metadata[b"geo"]
json.loads(geo)["columns"]["geom"]
#> {'encoding': 'WKB', 'geometry_types': [], 'crs': 'EPSG:26920'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions