Falling off the edge of the world: Dealing with the antimeridian in spatial software

Most of the time, software treats the world like a 2D surface, usually stretched between -180º to +180º.

That works just fine, most of the time. Unless you live in New Zealand, Fiji or Alaska, where data regularly crosses that magical edge-of-the-world line (the 'antimeridian' - often confused with the International Date Line.)

In most cases, if a geometry crosses past +180º, it will 'wrap' back to -180º. Software that doesn't carefully handle this can cause headaches. Results can include rendering artifacts, invalid geometries, incorrect extents, bad 'cropping' of geometries, and confusing failures when doing intersections or transforms.

At Koordinates we deal with a diverse range of data in different projections, from a range of sources and formats. Lots of it straddles the antimeridian. 

Perhaps because of our location in New Zealand, or because we deal with such a diverse range of data, we have to tackle lots of antimeridian problems that we can't find existing solutions to.

Not only does our software have to render data correctly on our websites, but it must be able to be projected into a number of different projections. This means that, even for data sourced from projections that don't have an antimeridian, we have to be able to handle it in an antimeridian-aware way.

In this talk, we'll discuss validation, geometry winding orders, WSEN extents and geography types. Then I'll showcase just a few of the (many) problems we've had with antimeridian geometries, and show some approaches for dealing with them.

Presentation type: Full length
Session: The_Geom: A Space Oddity

Presenter

Craig de Stigter

I tell computers what to do. Usually I speak Python, but will converse in English if prompted. I've been working at Koordinates in Auckland since 2008 and have built up a large collection of tricks and hacks to make data behave itself, often even when it's being stubborn. I'm a huge fan of PostgreSQL, Python, Django, GDAL and use them all every day. I like snowboarding and craft beer. Sometimes I brew my own, but it isn't always drinkable. I really do enjoy getting to know new people, but am somehow reasonably introverted, so I probably won't say hello even though I probably want to. So please come over and break the ice!