File formats, layers and coordinate metadata#

A file’s reader, logical layer and geometry declaration determine what a query can read. The table describes local file selection. Opening the selected source validates its contents and its reader profile. An explicit format hint is case-insensitive. Without one, the resolver uses path suffix and directory rules rather than content sniffing. An unknown file extension raises UnknownExtension.

File and layer lookup#

Family

Paths and companion inputs

Layer and geometry notes

Parquet

.parquet files, dataset directories and extensionless paths use the Parquet route. Opening reads the footer and schema.

GeoParquet metadata can declare geometry. Plain binary columns need an appropriate geometry declaration or ST_GeomFromWKB.

Shapefile

.shp with .shx and .dbf. .cpg is optional.

Geometry is source-owned and decoded through the ST_GeomFromWKB surface. Raw record bytes are not exposed.

FlatGeobuf

.fgb, version 3.

Source-owned geometry uses the same decode surface. Bounding-box pruning is optional when the plan admits it. Raw record bytes are not exposed.

FileGDB

.gdb directory.

An exact logical layer is required. Geometry is canonical source-owned Geometry.

GeoPackage

.gpkg local file.

An exact feature layer is required. The native open contract requires a clean, quiescent source.

KML

Uncompressed .kml.

Select an exact layer if needed. Omission is allowed only when there is one logical layer.

OSM PBF

.osm.pbf. A bare .pbf needs format="osm_pbf".

An exact layer is required: points, lines, multilinestrings, multipolygons or other_relations.

CSV

.csv with a header.

Declare a geometry mode explicitly. Values do not infer one. See the CSV lookup below.

GeoJSON

.geojson or .json for an RFC 7946 FeatureCollection. .geojsonl, .geojsons or .ndjson for a Feature sequence.

The suffix selects the reader. The document must satisfy that reader’s content contract.

Only CSV, KML, FileGDB, GeoPackage and OSM PBF accept source options. Unsupported options are checked before the source is opened. The source resolver and reader contracts contain the format-specific details.

What does this geometry column contain?#

Representation

Meaning

Source-owned Geometry

The reader owns the geometry representation. Shapefile and FlatGeobuf expose device-managed decode rather than raw record bytes.

Binary geometry input

A binary column can be declared as geometry or decoded with ST_GeomFromWKB, subject to the reader and execution profile.

Ordinary binary attribute

Binary data is not automatically geometry merely because its bytes resemble WKB.

CSV requires an explicit geometry mapping.

Mode

Mapping

No geometry

{"type": "none"}

Coordinates

{"type": "point_xy", "x": "x_column", "y": "y_column"}

WKT

{"type": "wkt", "column": "geometry_column"}

Hexadecimal WKB

{"type": "hex_wkb", "column": "geometry_column"}

The CSV options also include srid, defaulting to 0, and a delimiter, defaulting to a comma. SRID 0 exposes Binary geometry for ST_GeomFromWKB. A nonzero SRID exposes typed Geometry.

For Parquet, inspect the GeoParquet declaration for the primary geometry column, encoding, geometry family, axes, edge model and optional covering. Those declarations and the selected execution profile affect what can be read. A suffix alone does not establish support for every layout.

Python and native scan controls#

Interface

Controls and behavior

table_from_file(path, *, format=None, options=None)

Describes a file or dataset without reading it.

read_file(path, *, columns=None, geometry=None, active_geometry=None, format=None, options=None, session=None)

Reads eagerly. Column labels are exact. Projection retains the active geometry. Source rows receive a new RangeIndex. Geometry declarations can be None, a column name for WKB, or a mapping from names to wkb or ewkb.

Native source APIs

The native Parquet interface includes file-stamp and planning, projection, filter and row-range controls. Their availability and route conditions are interface and reader specific. They do not constitute a blanket promise for every Python reader.

See the Python interface and native source API for their respective contracts.

Coordinate metadata#

Metadata

CRS omitted

CRS explicitly null

GeoParquet

CRS84 convention

Unknown

GeoArrow

Unknown

Unknown

GeoArrow defaults omitted edges to planar. Its metadata parser distinguishes captured catalog identifiers from opaque strings declared with crs_type=srid, and retains raw CRS JSON. GeoParquet metadata also records encoding, axes, edges and covering information.

A malformed optional covering can disable pruning. Conversely, a scan that prunes a row can succeed even when decoding that row’s WKB would fail. A scan that demands the row can expose the error. Covering is a scan hint. It does not validate every geometry.

GeoParquet output#

The checked shell/native write-and-reopen route covers planar XY and XYZ profiles, scalar attributes and stored Z, including plain XY and absent, null and object CRS cases. Source CRS omitted writes the CRS84 convention. Explicit null remains unknown. A PROJJSON object is retained verbatim. Plain binary input writes a null CRS. The checked route rejects M and ZM profiles and spherical edges. These assertions do not establish a public Python writer or parity across all readers. See the writer and write-and-reopen tests.