Skip to main content

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 pyproj

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stateplane-0.2.4.tar.gz (368.7 kB view details)

Uploaded Source

Built Distribution

stateplane-0.2.4-py3-none-any.whl (376.6 kB view details)

Uploaded Python 3

File details

Details for the file stateplane-0.2.4.tar.gz.

File metadata

  • Download URL: stateplane-0.2.4.tar.gz
  • Upload date:
  • Size: 368.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for stateplane-0.2.4.tar.gz
Algorithm Hash digest
SHA256 2ed811ae1a58c84f43ecaa67fbbc059588219a604e2bb6956b63e4efd1f1e351
MD5 bf8cfd90a790e0df7885cdfa37a9fdd1
BLAKE2b-256 7fec5cc898999991803a3d0ce4e59c3d8da8c698bdd81aa3b46ef5c8f778db6e

See more details on using hashes here.

File details

Details for the file stateplane-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for stateplane-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e570fe20bbb9deb3921f1e58ee7144561eab67a6ccd42b43948950a4d2e52582
MD5 d1ee842accf84870207e7546120b0900
BLAKE2b-256 2f4113fd7b6459899bea18fefb55ac8047d7f4bc7b37497038c179cf19efa8e0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page