Class GeoParquetMetadata
Object
GeoParquetMetadata
- Direct Known Subclasses:
GeoParquetMetadataV1_1_0,GeoParquetMetadataV1_2_0Dev
Base class for GeoParquet metadata, representing the common structure of the "geo" metadata field in a GeoParquet
file. This includes the version, primary geometry column, and column metadata. Subclasses define specific version
constraints (e.g., 1.1.0, 1.2.0-dev).
The GeoParquet metadata is stored as a key-value metadata entry in the Parquet file, with the key "geo" and the value being a JSON string. This class and its subclasses provide the object mapping for that JSON data structure, following the GeoParquet specification.
Key components of the metadata include:
- Specification version (e.g., "1.1.0")
- Primary geometry column name
- Geometry encoding details
- Geometry types supported in each geometry column
- CRS information
- Bounding box data
- Optional covering information for spatial indexing
This implementation handles deserialization of the metadata and provides access to its various components, enabling optimized operations such as bounds calculation and schema detection.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbounds()Gets the bounds of the primary geometry column.Gets the geometry metadata for a specific column.Gets the column metadata, mapping column names to their geometry details.Gets the name of the primary geometry column.Gets the GeoParquet specification version.static GeoParquetMetadataReads GeoParquet metadata from a JSON string.voidsetColumns(Map<String, Geometry> columns) Sets the column metadata (must contain at least one entry).voidsetPrimaryColumn(String primaryColumn) Sets the name of the primary geometry column (must be non-empty).voidsetVersion(String version) Sets the GeoParquet specification version.
-
Field Details
-
version
-
-
columns
-
-
Constructor Details
-
GeoParquetMetadata
public GeoParquetMetadata()
-
-
Method Details
-
readValue
Reads GeoParquet metadata from a JSON string.- Parameters:
geo- the JSON string containing the metadata- Returns:
- the parsed GeoParquetMetadata object
- Throws:
IOException- if the JSON cannot be parsed
-
bounds
Gets the bounds of the primary geometry column.- Returns:
- The envelope representing the bounds of the primary geometry column, or an empty envelope if bounds are not available
-
getVersion
Gets the GeoParquet specification version.- Returns:
- the version string
-
setVersion
Sets the GeoParquet specification version.- Parameters:
version- the version string
-
getPrimaryColumn
Gets the name of the primary geometry column.- Returns:
- the primary column name
-
setPrimaryColumn
Sets the name of the primary geometry column (must be non-empty).- Parameters:
primaryColumn- the primary column name
-
getColumn
Gets the geometry metadata for a specific column.- Parameters:
column- the name of the column- Returns:
- an Optional containing the column's geometry metadata, or empty if the column doesn't exist
-
getColumns
Gets the column metadata, mapping column names to their geometry details.- Returns:
- a map of column names to geometry metadata
-
setColumns
Sets the column metadata (must contain at least one entry).- Parameters:
columns- a map of column names to geometry metadata
-