Skip to main content

Overview

epsg_ident is a command-line utility and Python module for quickly identifying the EPSG Registry Code from a .prj file typically associated with ESRI Shapefiles. It ships with a SQlite3 database containing mappings of Well-known Text strings to EPSG codes, the bulk of which was manually sourced and cleaned from an ESRI website. It’s not complete, however, and in the event you test it against a WKT string not in the database it will search the prj2epsg.org API. If the API returns an exact match, that code is returned and saved to the SQLite database. Handling several partial matches is currently planned, but not yet implemented.

TL;DR

Command-Line usage

$ epsg_ident seattle_land_use.prj
2285

Python module usage

>>> from epsg_ident import EpsgIdent

>>> # Read .prj file from the filesystem
>>> ident = EpsgIdent()
>>> ident.read_prj_from_file('seattle_land_use.prj')
>>> ident.get_epsg()
2285

>>> # Paste in Well-Known Text string directly
>>> ident = EpsgIdent(prj="""PROJCS["NAD_1983_StatePlane_Washington_North_FIPS_4601_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1640416.666666667],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-120.8333333333333],PARAMETER["Standard_Parallel_1",47.5],PARAMETER["Standard_Parallel_2",48.73333333333333],PARAMETER["Latitude_Of_Origin",47.0],UNIT["Foot_US",0.3048006096012192]]""")
>>> ident.get_epsg()
2285

Background

Think of projections as character encoding for spatial data. Spatial data lacking information about the coordinate system on which it has been projected is all but useless, just as if you had text data in an unknown encoding.

epsg_ident is not meant to be a full-fledged client library to the actual EPSG database, for that you’re probably looking for something like python-epsg

Rather, epsg_ident is for those looking to quickly identify the EPSG code of a shapefile, especially when importing into PostGIS . Of course, you could use ogr2ogr to convert everything into a web-friendly projection, like:

$ ogr2ogr -f PostgreSQL -t_srs EPSG:4326 PG:dbname=seattle seattle_land_use.shp

But transforming spatial data from one projection to another is a lossy operation and can result in coordinate drift. Ideally, you would store the original data in its original coordinate system and then transform copies as needed.

Metadata

Release files for epsg-ident 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for epsg-ident 0.1.1
File Size Uploaded Provenance Actions
epsg_ident-0.1.1.tar.gz 381.1 kB Without provenance Details for epsg_ident-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for epsg-ident 0.1.1
File Interpreter ABI Platform Actions
epsg_ident-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for epsg_ident-0.1.1-py2.py3-none-any.whl

Total release size: 779.4 kB

Release files / epsg_ident-0.1.1.tar.gz

Download URL epsg_ident-0.1.1.tar.gz
Size 381.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7e4b5045986efcd671cb43fdba04c85f70688df581b21817f77f97c04f8575e3
BLAKE2b-256 checksum
How to use checksums
0a9e45966dc6280145782af51c588befc2386e5b82b1e9263277422898616a64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / epsg_ident-0.1.1-py2.py3-none-any.whl

Download URL epsg_ident-0.1.1-py2.py3-none-any.whl
Size 398.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5fa02c2dbff7f33003d8beae913de2eb14a30226ef29fb941fb8b47f93d1846f
BLAKE2b-256 checksum
How to use checksums
17e212f72795a0a9b6f3471169e42eb3cfb728aad77139e5cfa2925749e56dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for epsg-ident 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page