Function Repository Resource:

ImportGeoParquet

Source Notebook

Import a GeoParquet file as a dataset

Contributed by: Arnoud Buzing

ResourceFunction["ImportGeoParquet"][file]

imports the GeoParquet file and returns a Dataset.

Details

GeoParquet is an open standard that extends the capabilities of Apache Parquet, a popular columnar storage file format, to efficiently handle geospatial data. It facilitates the storage, interchange, and processing of complex geographical information by leveraging Parquet's highly optimized, schema-based, and compressed data structures.
GeoParquet aims to standardize how geospatial data is represented within Parquet files, enabling seamless interoperability between different data processing frameworks, geographic information systems (GIS), and analytical tools, all while maintaining high performance and scalability for big data workloads.
ResourceFunction["ImportGeoParquet"] imports GeoParquet data from a file and processes it into a Dataset.
ResourceFunction["ImportGeoParquet"] uses ExternalEvaluate to encapsulate code from the Python geopandas package.

Examples

Basic Examples (4) 

Download a sample GeoParquet file:

In[1]:=
file = URLDownload[
  "https://github.com/opengeospatial/geoparquet/raw/main/examples/example.parquet", "example.parquet"]
Out[1]=

Import the file as a dataset:

In[2]:=
ds = ResourceFunction["ImportGeoParquet"][file]
Out[2]=

Obtain the geo-polygons from the dataset:

In[3]:=
gp = Normal[ds[All, "geometry"]]
Out[3]=

Create a map of the last geo-polygon in that list:

In[4]:=
GeoGraphics[Last[gp], GeoBackground -> "VectorClassic"]
Out[4]=

Scope (4) 

Download building data for a Japanese city:

In[5]:=
file = URLDownload[
  "https://data.source.coop/pacificspatial/flateau/parquet/01205_muroran-shi_2022_building_lod0.parquet", "01205_muroran-shi_2022_building_lod0.parquet"]
Out[5]=

Import the file as a dataset. This may take several minutes:

In[6]:=
ds = ResourceFunction["ImportGeoParquet"][file]
Out[6]=

Extract the building geometries from the dataset:

In[7]:=
gp = Normal[ds[All, "GEOM"]];
RandomSample[gp, 4]
Out[8]=

Map the building data:

In[9]:=
GeoGraphics[{GeoStyling[White], gp}, GeoBackground -> Black, PlotRangePadding -> None]
Out[9]=

Publisher

Arnoud Buzing

Version History

  • 1.0.0 – 29 July 2024

Related Resources

License Information