Convert between state plane projections and long/lat
Project description
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.
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
File details
Details for the file stateplane-0.3.1.tar.gz
.
File metadata
- Download URL: stateplane-0.3.1.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cd99d0f0c5103a3ec1fbaeb300cdfd8833f5dc1289ee75022882fb11c296c51 |
|
MD5 | 6e7b25714369e8e01830463dfe228cad |
|
BLAKE2b-256 | fc00a4008eafbf7223c60eec681984a9e410ab62fd4f57bb98091d0f0c2a6e8b |
File details
Details for the file stateplane-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: stateplane-0.3.1-py3-none-any.whl
- Upload date:
- Size: 367.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7fd7649cdc19b2f624fd18f3c08d8108f370cd53bfe7cb48ece37f84e72f6ce |
|
MD5 | 8407b8b36ac05a13052a71312d56b57f |
|
BLAKE2b-256 | 36d02c1fb3bd105cf4ffb763075c057c8fc979071fe4bffdb017422d3ef4f3f0 |