Skip to content

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.

Polygon geometry of self_intersecting_polygon, 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 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:

pip install "geocase[all]"

View GeoCase on PyPI.

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 fail
  • assert_matches_vector_hints(case, gdf) should pass because expect_valid_geometry: false

Common failure modes

  • Pipelines silently accepting invalid geometry.
  • Downstream area/centroid calculations returning misleading values.

Required capabilities

  • load
  • geometry-validation
  • topology-check

Files

Browse this case on GitHub

Source and license

  • Source: geocase-curated
  • License: MIT

Tags

invalid polygon self_intersection topology vector