Skip to content

Polygon with Hole

vectorGeoJSONPolygonEPSG:4326tinybundled

A polygon containing an interior ring (hole). Tests that tools correctly distinguish outer and inner rings and compute area accounting for the hole.

Polygon geometry of polygon_with_hole, rendered from the case's data
Polygon geometry, rendered from the case's actual geometry. Scale is normalized to the viewport and is not comparable between cases.
Property Value
Case ID polygon_with_hole
Category vector
Format GeoJSON
Geometry type Polygon
CRS EPSG:4326
Location Near the origin (synthetic, no real-world location) — 0.00°E, 0.00°N → 10.00°E, 10.00°N
Test tier unit
Size class tiny
Storage class bundled
Redistributable yes
Loader geopandas
Status validated

Use this case

import pytest


@pytest.mark.geocase_case("polygon_with_hole")
def test_polygon_with_hole(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

Verify that inner rings are preserved on load and that area calculations subtract the hole.

Risk types covered

Expected behavior

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

Notes

Purpose

Exercises interior-ring handling. The polygon is valid but contains one hole.

What to expect

  • Geometry validity checks pass.
  • Exactly one polygon hole is present.
  • Area-sensitive workflows should subtract the interior ring area.

Typical checks

  • assert_valid_geometry(gdf)
  • assert_has_holes(gdf)
  • assert_geometry_type(gdf, "Polygon")
  • assert_epsg(gdf, 4326)

Common failure modes

  • Inner ring dropped during load/serialization.
  • Incorrect area if hole is ignored.
  • Ring orientation assumptions causing geometry rewrites.

Required capabilities

  • load
  • geometry-validation
  • area-check

Files

Browse this case on GitHub

Source and license

  • Source: geocase-curated
  • License: MIT

Tags

hole interior_ring polygon vector