在状态平面投影和long/lat之间转换
stateplane的Python项目详细描述
pystateplane
获取地理坐标的本地状态平面投影,然后 在坐标和本地状态平面之间自动转换 投影。
包括50个州,华盛顿特区,波多黎各, 美属萨摩亚、关岛和美属维尔京群岛。
查找本地状态机系统:
importstateplane# Returns the EPSG value for this (lon, lat)stateplane.identify(-73.2,43.2)# 32145# Return a short name for the projectionstateplane.identify(-88.2,41.2,'short')# 'IL_E'# Speed up the process by specifying a state FIPS codestateplane.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 equivalentstateplane.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 projectionstateplane.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'
功能
状态平面。标识(lon,lat,fmt=none,statefp=none)
来自_lat lon(lat,lon,epsg=none,fips=none,abbr=none,statefp=none,countyfp=none)
from_lon lat(lon,lat,epsg=none,fips=none,abbr=none,statefp=none,countyfp=none)
对于这些函数,epsg、fips或abbr可以用于 指定投影。statefp参数可用于指定 两位数的州(或地区)FIPS代码,结果是 有效的检查。使用countyfp指定五位数的县FIP 代码。或者,结合statefp,使用三位数的县 茎。
到拉特隆(东距,北距,epsg=none,fips=none,abbr=none)
到_lonlat(东距,北距,epsg=none,fips=none,abbr=none)
对于这些函数,至少是epsg、fips和^{tt3}中的一个$ 必须提供。
注意事项
这个模块实际上只是一个很好的 pyproj库。通过执行 本机转换。我们很乐意接受拉取请求。