84 read parquet

Reading GeoParquet files and visualizing vector data interactively
Uncomment the following line to install leafmap if needed.
| # %pip install -U leafmap lonboard
|
Visualizing point data.
| url = "https://github.com/opengeos/data/raw/refs/heads/main/duckdb/cities.parquet"
|
Read GeoParquet and return a GeoPandas GeoDataFrame.
| gdf = leafmap.read_parquet(url, return_type="gdf", src_crs="EPSG:4326")
gdf.head()
|
View the GeoDataFrame interactively using folium.
Visualize the GeoDataFrame using lonboard.
| leafmap.view_vector(gdf, get_radius=20000, get_fill_color="blue")
|
Visualizing polygon data.
| url = "https://data.source.coop/giswqs/nwi/wetlands/DC_Wetlands.parquet"
|
| gdf = leafmap.read_parquet(
url, return_type="gdf", src_crs="EPSG:5070", dst_crs="EPSG:4326"
)
gdf.head()
|
| leafmap.view_vector(gdf, get_fill_color=[0, 0, 255, 128])
|

Alternatively, you can specify a color map to visualize the data.
| color_map = {
"Freshwater Forested/Shrub Wetland": (0, 136, 55),
"Freshwater Emergent Wetland": (127, 195, 28),
"Freshwater Pond": (104, 140, 192),
"Estuarine and Marine Wetland": (102, 194, 165),
"Riverine": (1, 144, 191),
"Lake": (19, 0, 124),
"Estuarine and Marine Deepwater": (0, 124, 136),
"Other": (178, 134, 86),
}
|
| leafmap.view_vector(gdf, color_column="WETLAND_TYPE", color_map=color_map, opacity=0.5)
|

Display a legend for the data.
| leafmap.Legend(title="Wetland Type", legend_dict=color_map)
|
