@@ -406,6 +406,49 @@ def simple_child_geos_gerrydb_fixture(session: Session, simple_child_geos):
406406 session .close ()
407407
408408
409+ @pytest .fixture (name = "antimeridian_geos" )
410+ def antimeridian_geos_fixture (session : Session ):
411+ """Two small polygons straddling the antimeridian, mirroring Alaska's Aleutian
412+ islands, so extent computation can be tested for that failure mode."""
413+ layer = "antimeridian_geos"
414+ result = subprocess .run (
415+ args = [
416+ "ogr2ogr" ,
417+ "-f" ,
418+ "PostgreSQL" ,
419+ OGR2OGR_PG_CONNECTION_STRING ,
420+ FIXTURES_PATH / "gerrydb" / f"{ layer } .geojson" ,
421+ "-lco" ,
422+ "OVERWRITE=yes" ,
423+ "-nln" ,
424+ f"{ GERRY_DB_SCHEMA } .{ layer } " ,
425+ "-nlt" ,
426+ "MULTIPOLYGON" ,
427+ "-lco" ,
428+ "GEOMETRY_NAME=geometry" ,
429+ ],
430+ )
431+
432+ if result .returncode != 0 :
433+ print (f"ogr2ogr failed. Got { result } " )
434+ raise ValueError (f"ogr2ogr failed with return code { result .returncode } " )
435+
436+
437+ @pytest .fixture (name = "antimeridian_geos_gerrydb" )
438+ def antimeridian_geos_gerrydb_fixture (session : Session , antimeridian_geos ):
439+ upsert_query = text ("""
440+ INSERT INTO gerrydbtable (uuid, name, updated_at)
441+ VALUES (gen_random_uuid(), :name, now())
442+ ON CONFLICT (name)
443+ DO UPDATE SET
444+ updated_at = now()
445+ """ )
446+ session .begin ()
447+ session .execute (upsert_query , {"name" : "antimeridian_geos" })
448+ session .commit ()
449+ session .close ()
450+
451+
409452@pytest .fixture (name = "gerrydb_simple_geos_view" )
410453def gerrydb_simple_geos_view_fixture (
411454 session : Session , simple_parent_geos_gerrydb , simple_child_geos_gerrydb
0 commit comments