Skip to main content

Fixes 180 degree crossing issue for vector geodata

Project description

problem180meridian

Python module to fix 180 degree crossing issue for vector geodata

Take care of topology errors on the 180th meridian

Having vector geodata with lines/polygons crossing 180th meridian, their geometry is likely to be displayed wrongly in geographic CRS like EPSG:4326. This module helps to modify the original Polygon or Multipolygon geometry to be correctly represented in a geographic CRS.

Install

The module is available from PyPi, one may install it using pip:

pip install problem180meridian

To use it from Python console one may use:

import problem180meridian

Usage

The module contains the following functions:

check180(coordinates) - checks if any segment in a pair of coordinates crosses 180th meridian and returns a tuple of two values. The first one is False if no crossing was found, and True if at least one was found. Without any crossing, the second value is None, otherwise it's an array of bool values where True marks the 180th meridian crossing and False means no crossing.

cross180(coord1, coord2, lon_buffer=0.0) - takes a pair of point coordinates a line between which is supposed to cross the 180th meridian and returns a pair of point coordinates on the crossing between this line and the meridian, or at a distance from it equal to lon_buffer parameter (in longitude degrees).

split180_multipolygon(coordinates, lon_buffer=0.0) - takes coordinates as input and returns new ogr.Geometry object as Multipolygon.

Development

Plans for the module development:

  • direct processing of wkt and ogr.Geometry input
  • processing line geometry as well as polygons
  • revert algorithm to unite geometry separated by the 180th meridian for correct representation in projected CRS, like UTM

Author

Made by Sergei Sadkov (@sergsadkov)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

problem180meridian-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

File details

Details for the file problem180meridian-0.1.0.tar.gz.

File metadata

  • Download URL: problem180meridian-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for problem180meridian-0.1.0.tar.gz
Algorithm Hash digest
SHA256 198f5bd2b16623bc4021edd4b9847f022273b53a0b0bc875042b1eed577c686f
MD5 9e83465ebea24c6e35f59ec3aaa5e114
BLAKE2b-256 28dfd7928092ebe3aefe68c6c59ea2947341ceff95ccdda7f2dbf109fc216b05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page