Tutorial

In this tutorial you will learn about how to use the django-axis-order package which implements a local cache of the epsg registry with fallback to gdal.

Usage with ogc service

In geo applications coordinate tuples can be ordered either (x,y) or (y,x) or (x,y) but meant as (y,x). For example, in some ogc service versions, the axis order interpretation was changed. So if a request comes in, you need to initialize your geometry objects with correct axis order.

In newer ogc standards, the axis order from the registered epsg reference system shall be used. That is the main problem we gona fix here. We fetch the wkt description from the remote epsg resgistry api and transform the geometry to the correct axis order if needed:

from axis_order_cache.utils import adjust_axis_order

correct_geometry = adjust_axis_order(geometry)

Warning

You need to decide by your self, for what service version you need a axis order correction.