Skip to main content

Project points from one projection to another using pyproj

Project description

Coordinate Projector

security: bandit

This is the Norwegian Geotechnical Institute (NGI) Python package for projecting coordinates. It is a small shim on top of the library pyproj that again is an interface to PROJ.

References:

Latest releases see CHANGES.md

Installation (end user)

pip install coordinate-projector

Basic usage

Project a point

from coordinate_projector import Projector

projector = Projector()
 
from_srid = "4326"
to_srid = "3857"

# Paris Lat(48.8589506) Lon(2.2768485) EPSG:4326
from_east, from_north = 2.2768485, 48.8589506 

projected_east, projected_north = projector.transform(from_srid, to_srid, from_east, from_north)

# Paris Lat(6250962.06) Lon(253457.62) EPSG:3857 is in metres - 2D projection
assert abs(projected_east - 253457.62) <= 0.01
assert abs(projected_north - 6250962.06) <= 0.01 

print(f"{projected_east=}, {projected_north=}")
# projected_east=253457.6156334287, projected_north=6250962.062720417

Getting Started developing

  1. Software dependencies

    • Python 3.9 or higher
    • Poetry
    • Ruff code formatter
  2. Clone this repository

  3. Install

    poetry install

Build and Test

Run in the project root folder:

poetry shell pytest 

Build the package wheel:

poetry build

Publish

TODOs

  • Handle lines
  • Handle polygons

Contribute

Please start by adding an issue before submitting any pull requests.

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

coordinate_projector-0.0.11.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

coordinate_projector-0.0.11-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file coordinate_projector-0.0.11.tar.gz.

File metadata

  • Download URL: coordinate_projector-0.0.11.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure

File hashes

Hashes for coordinate_projector-0.0.11.tar.gz
Algorithm Hash digest
SHA256 f5d680742f6902291b419fac8ad30f298ed7d6c1e88d9926d5b378992a336a1c
MD5 4e79a56b6fe6ad91381ea5c54d1c21db
BLAKE2b-256 ffc69e1a8e6726012bb4a9bb0c93f5153ee70fbefa89cb602d3c19b56ed7e89b

See more details on using hashes here.

File details

Details for the file coordinate_projector-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for coordinate_projector-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 927cd511906906ceabcf3c849da984d698dcacc34326cff6a7d534f5a51eb310
MD5 4de2d260683526eddd8311810b43fc31
BLAKE2b-256 bfac988babcc9080a1de36956e46627cab023c3da3d99f0a3e42a7bf92a131ba

See more details on using hashes here.

Supported by

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