Self-Intersecting Polygon¶
vectorGeoJSONPolygonEPSG:4326tinybundled
A polygon whose boundary crosses itself, producing an invalid geometry by OGC standards. Used to verify that validation and repair routines detect the issue.
| Property | Value |
|---|---|
| Case ID | self_intersecting_polygon |
| 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("self_intersecting_polygon")
def test_self_intersecting_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:
What this case checks¶
Expose code that silently accepts invalid polygons or computes incorrect area/centroid values from self-intersecting rings.
Risk types covered¶
Expected behavior¶
| Assertion | Expected |
|---|---|
expect_loadable |
yes |
expect_valid_geometry |
no |
expect_crs |
yes |
expected_epsg |
4326 |
expected_geometry_types |
Polygon |
Notes¶
Purpose¶
Deliberately invalid polygon (self-intersection) used to ensure validation and topology checks catch bad geometry.
What to expect¶
- Dataset should still load.
- OGC validity should fail.
- Topology-focused checks should report a self-intersection.
Typical checks¶
assert_invalid_geometry(gdf)assert_no_self_intersections(gdf)should failassert_matches_vector_hints(case, gdf)should pass becauseexpect_valid_geometry: false
Common failure modes¶
- Pipelines silently accepting invalid geometry.
- Downstream area/centroid calculations returning misleading values.
Required capabilities¶
loadgeometry-validationtopology-check
Files¶
- Primary:
geometry.geojson - Notes:
notes.md
Source and license¶
- Source: geocase-curated
- License: MIT
Tags¶
invalid polygon self_intersection topology vector
Related cases¶
- Unclosed Ring Polygon --
unclosed_ring_polygon - Ambiguous Engine-dependent Polygon --
ambiguous_engine_dependent_polygon - Invalid Geometry at Feature 9,999 (GeoPackage) --
invalid_geometry_at_scale_gpkg - Out-of-Bounds / Invalid Coordinates --
out_of_bounds_coordinates - Polygon with Hole --
polygon_with_hole