查找点或地区的州平面投影
项目描述
pystateplane
获取地理坐标的本地州平面投影,并自动在坐标和本地州平面投影之间进行转换。
包含50个州的州平面投影、DC、波多黎各、美属萨摩亚、关岛和美属维尔京群岛。
查找本地州平面系统
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'
转换为本地州平面的(东西向,南北向)
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'
安装
假设您有pip,运行
pip install stateplane
或者,下载仓库并运行
python setup.py install
函数
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)
对于这些函数,可以使用epsg
、fips
或abbr
来指定一个投影。可以使用statefp
参数来指定两位数的州(或领地)FIPS代码,从而实现更高效的检查。使用countyfp
来指定五位数的县FIPS代码。或者,与statefp
结合使用,使用三位数的县干码。
to_latlon(easting, northing, epsg=None, fips=None, abbr=None)
to_lonlat(easting, northing, epsg=None, fips=None, abbr=None)
对于这些函数,必须提供至少一个epsg
、fips
和abbr
。
注意事项
此模块实际上只是一个针对优秀pyproj
库的便利包装。通过本地化转换可以实现显著的速度提升。欢迎提交拉取请求。
项目详情
下载文件
下载适用于您平台文件的文件。如果您不确定选择哪一个,请了解更多关于安装包的信息。
源分布
stateplane-0.5.0.tar.gz (403.7 kB 查看散列)
构建分布
stateplane-0.5.0-py3-none-any.whl (389.3 kB 查看散列)