Project points from one projection to another using pyproj
Project description
Coordinate Projector
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
-
Software dependencies
- Python 3.9 or higher
- Poetry
- Ruff code formatter
-
Clone this repository
-
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5d680742f6902291b419fac8ad30f298ed7d6c1e88d9926d5b378992a336a1c |
|
MD5 | 4e79a56b6fe6ad91381ea5c54d1c21db |
|
BLAKE2b-256 | ffc69e1a8e6726012bb4a9bb0c93f5153ee70fbefa89cb602d3c19b56ed7e89b |
File details
Details for the file coordinate_projector-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: coordinate_projector-0.0.11-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 927cd511906906ceabcf3c849da984d698dcacc34326cff6a7d534f5a51eb310 |
|
MD5 | 4de2d260683526eddd8311810b43fc31 |
|
BLAKE2b-256 | bfac988babcc9080a1de36956e46627cab023c3da3d99f0a3e42a7bf92a131ba |