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.10 or higher
- uv
- Ruff code formatter
-
Clone this repository
-
Install
uv sync --all-extras --dev
Build and Test
Run in the project root folder:
uv run pytest
Build the package wheel:
uv build
Publish
Publish the package to PyPi:
uv publish --token ${PYPI_TOKEN}
TODOs
- Handle lines
- Handle polygons
Contribute
Please start by adding an issue before submitting any pull requests.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coordinate_projector-0.0.15.tar.gz.
File metadata
- Download URL: coordinate_projector-0.0.15.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cea9c415d891d86caf455dee0e8ff34e83b7a607409263e0e6903ae2c9b5129
|
|
| MD5 |
1c893f5f767a1c9b080827551959dd0b
|
|
| BLAKE2b-256 |
5cd22049b9365e2da56a68aa0b62435eed62763dc9df4c962436810115adad32
|
Provenance
The following attestation bundles were made for coordinate_projector-0.0.15.tar.gz:
Publisher:
release.yaml on norwegian-geotechnical-institute/coordinate-projector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coordinate_projector-0.0.15.tar.gz -
Subject digest:
2cea9c415d891d86caf455dee0e8ff34e83b7a607409263e0e6903ae2c9b5129 - Sigstore transparency entry: 456243702
- Sigstore integration time:
-
Permalink:
norwegian-geotechnical-institute/coordinate-projector@f81fd3ad6ef963c3dd087546345e11735e96ae47 -
Branch / Tag:
refs/tags/0.0.15 - Owner: https://github.com/norwegian-geotechnical-institute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@f81fd3ad6ef963c3dd087546345e11735e96ae47 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coordinate_projector-0.0.15-py3-none-any.whl.
File metadata
- Download URL: coordinate_projector-0.0.15-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6943f8eadf49355976027d87528c219dac2f3641aaf45ef5dfdc91fda7078f78
|
|
| MD5 |
f265eaf4516928fb4d8e9d76326ccacd
|
|
| BLAKE2b-256 |
0d7d83eb128e2bcfa2edcab15a39098022eaeee52b730d6a76ba62f0526c7497
|
Provenance
The following attestation bundles were made for coordinate_projector-0.0.15-py3-none-any.whl:
Publisher:
release.yaml on norwegian-geotechnical-institute/coordinate-projector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coordinate_projector-0.0.15-py3-none-any.whl -
Subject digest:
6943f8eadf49355976027d87528c219dac2f3641aaf45ef5dfdc91fda7078f78 - Sigstore transparency entry: 456243707
- Sigstore integration time:
-
Permalink:
norwegian-geotechnical-institute/coordinate-projector@f81fd3ad6ef963c3dd087546345e11735e96ae47 -
Branch / Tag:
refs/tags/0.0.15 - Owner: https://github.com/norwegian-geotechnical-institute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@f81fd3ad6ef963c3dd087546345e11735e96ae47 -
Trigger Event:
release
-
Statement type: