Skip to content

Empty Polygon

vectorGeoJSONPolygonEPSG:4326tinybundled

An explicitly empty polygon geometry used to verify that code handles empty-but-typed polygon inputs without crashing.

Schematic of a Polygon geometry
Schematic only -- this case's geometry could not be rendered, so the drawing is a generic Polygon, not the fixture's coordinates.
Property Value
Case ID empty_polygon
Category vector
Format GeoJSON
Geometry type Polygon
CRS EPSG:4326
Location No geometry -- the case is deliberately empty
Test tier unit
Size class tiny
Storage class bundled
Redistributable yes
Loader geopandas
Status validated

Use this case

import pytest


@pytest.mark.geocase_case("empty_polygon")
def test_empty_polygon(geocase_case) -> None:
    data = geocase_case.load()
    assert data is not None

Use GeoCase in your tests

Install the complete set of vector, raster, and NetCDF dependencies:

pip install "geocase[all]"

View GeoCase on PyPI.

What this case checks

Confirm that geometry utilities gracefully handle Polygon EMPTY inputs.

Risk types covered

Expected behavior

Assertion Expected
expect_loadable yes
expect_valid_geometry yes
expect_crs yes
expected_epsg 4326
expected_geometry_types Polygon

Known consumer divergences

Disagreements already investigated on this case. If your reader reproduces one of these, it is catalogued — not a new finding.

lonboard — lonboard 0.11, geoarrow-pyarrow 0.5

from_geopandas on an all-empty geometry frame raises ValueError: 0-length dimension rather than producing an empty layer.

Upstream: https://github.com/farzinashouri/geocase/blob/main/docs/plans/38-six-consumer-round-2-and-the-stac-adapter.md

geoarrow-pyarrow — geoarrow-pyarrow 0.5

as_geoarrow raises an internal AttributeError on an all-empty frame, because infer_type_common returns pa.null() and the caller assumes a geometry type.

Upstream: https://github.com/farzinashouri/geocase/blob/main/docs/plans/38-six-consumer-round-2-and-the-stac-adapter.md

Notes

Used for functions that should accept or short-circuit on an empty polygon geometry.

Required capabilities

  • load
  • geometry-validation

Files

Browse this case on GitHub

Source and license

  • Source: geocase-curated
  • License: MIT

Tags

baseline empty polygon vector