Skip to main content

wgs_correction

Project description

WGS84坐标纠正工具

功能

用于将定义为WGS_1984坐标系,但实际坐标为bd09或gcj02的shapefile纠正到WGS_1984坐标系下

以解决从高德/百度平台获取数据时忘记进行坐标矫正后,可能出现的问题

Python库

安装

由于fiona依赖问题,仅支持Python>=3.8版本

在pip中安装

pip install wgs_correction

使用

一般使用

import wgs_correction as wgsc
input_shp = ''
output_shp = ''
# 纠正高德坐标
wgsc.correct(input_shp, output_shp, 'gd')
# 纠正百度坐标
wgsc.correct(input_shp, output_shp, 'bd')

高级使用

自定义纠正函数。纠正函数的参数、返回值都必须是两个

示例中,定义了t_func,以将整个shapefile的经纬度都加1

import wgs_correction as wgsc

def t_func(x, y):
    return x + 1, y + 1

input_shp = ''
output_shp = ''
# 纠正高德坐标
wgsc.correct_core(input_shp, output_shp, t_func)

ArcGIS Pro 工具箱

将wgs_correction_tool.pyt添加至ArcGIS Pro工程中,直接使用即可

考虑到兼容性问题,工具箱逐个读取坐标、逐个转换,没有用numpy,速度比wgs_correction库更慢

如果要转换比较大的数据,建议适用wgs_correction库

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

wgs_correction-0.1.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

wgs_correction-0.1.0-py2.py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 2 Python 3

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