Skip to main content

pystateplane

Get the local state plane projection for geographica coordinates, and automatically convert between coordinates and the local state plane projection.

Includes state plane projections for the 50 states, DC, Puerto Rico, American Samoa, Guam and the US Virgin Islands.

Find the local state plane system:

import stateplane

# Returns the EPSG value for this (lon, lat)
stateplane.identify(-73.2, 43.2)
# 32145

# Return a short name for the projection
stateplane.identify(-88.2, 41.2, 'short')
# 'IL_E'

# Speed up the process by specifying a state FIPS code
stateplane.identify(-88.2, 41.2, 'short', statefp='17')
# 'IL_E'

# Speed up the process even more by specifying a county FIPS code
# These two calls are equivalent
stateplane.identify(None, None, 'short', countyfp='36005')
stateplane.identify(None, None, 'short', statefp='36', countyfp='005')
# 'NY_LI'

stateplane.identify(-80.1, 36.2, fmt='short')
# 'NC'

# returns the FIPS code of the projection
stateplane.identify(-80.1, 36.2, fmt='fips')
'3200'

Convert to the (easting, northing) of the local state plane:

stateplane.from_lonlat(-80.1, 36.2)
(510673.2830651368, 272340.60789450357)

stateplane.from_lonlat(-75.2, 40.2)
(817080.8169336573, 99364.28495057777)

stateplane.identify(-75.2, 40.2, fmt='short')
'PA_S'

Installing

Assuming you have pip, run:

pip install stateplane

Or, download the repository and run:

python setup.py install

Functions

stateplane.identify(lon, lat, fmt=None, statefp=None)

from_latlon(lat, lon, epsg=None, fips=None, abbr=None, statefp=None, countyfp=None)

from_lonlat(lon, lat, epsg=None, fips=None, abbr=None, statefp=None, countyfp=None)

For these functions, epsg, fips or abbr can be used to specify a projection. The statefp parameter can be used to specify a two-digit state (or territory) FIPS code, while results in more efficient checking. Use countyfp to specify a five-digit county FIPS code. Or, in combination with statefp, use the three-digit county stem.

to_latlon(easting, northing, epsg=None, fips=None, abbr=None)

to_lonlat(easting, northing, epsg=None, fips=None, abbr=None)

For these functions, as least one of epsg, fips and abbr must be provided.

Caveats

This module is really just a convenience wrapper for the excellent pyproj library. Big speed gains could be achieved by doing the conversions natively. Pull requests are gladly accepted.

Release files for stateplane 0.5.0

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

Source distribution (sdist)

Source distribution for stateplane 0.5.0
File Size Uploaded
stateplane-0.5.0.tar.gz 403.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stateplane 0.5.0
File Interpreter ABI Platform
stateplane-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 793.0 kB

Release files / stateplane-0.5.0.tar.gz

Download URL stateplane-0.5.0.tar.gz
Size 403.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9dc32567518ea6a5a15f276577a0763770541f9e1d2ba36efb4c19b25137fcfe
BLAKE2b-256 checksum
How to use checksums
27521080d13fbbb38e93b13883fb4d5ec0b4b94c8b048138fbe89836cd16667b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.12

Release files / stateplane-0.5.0-py3-none-any.whl

Download URL stateplane-0.5.0-py3-none-any.whl
Size 389.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1921c558b23bfd4278c2f813045f76e8f317b8fe6aa52bc6d7870b1fe3fd18cd
BLAKE2b-256 checksum
How to use checksums
be4a3e5ef5483b67f1241418d956ebda7e0d938edbf5ed70496ee4a823dd1663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.12

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

1 release file

0.2.1

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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