简体   繁体   English

python-shapefile将几何转换为纬度/经度

[英]python-shapefile convert geometry to latitude/longitude

I'm completely new in shp file and what I'm trying to do is to convert my point location data to latitude/longitude. 我在shp文件中是一个全新的人,我想做的就是将我的点位置数据转换为纬度/经度。 What I have is, afert .crs command: 我所拥有的是afert .crs命令:

{'proj': 'tmerc',
 'lat_0': 0,
 'lon_0': 21,
 'k': 0.999923,
 'x_0': 7500000,
 'y_0': 0,
 'ellps': 'GRS80',
 'units': 'm',
 'no_defs': True}

how to obtain latitude and longitude coordinates 如何获取经纬度坐标

Finally, after trial and error, I found a solution. 最后,经过反复试验,我找到了解决方案。 I hope it could be useful for the community. 我希望它对社区有用。 Basically, there is a very good website https://geoffboeing.com/2014/09/using-geopandas-windows/ but ..... 基本上,有一个很好的网站https://geoffboeing.com/2014/09/using-geopandas-windows/但是.....

Don't even try: conda install -c conda-forge geopandas. 甚至不要尝试:conda install -c conda-forge geopandas。

It works but then you probably will have problems. 它有效,但是您可能会遇到问题。 In my case problem was in pyproj version and I couldn't update it. 就我而言,问题出在pyproj版本中,我无法更新它。 Then I used a solution with wheel files and ... I had problem with fiona version :) Here's source for whl files: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal 然后我使用了带轮文件的解决方案,并且...我对fiona版本有问题:)这是whl文件的来源: https ://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal

So, my final solution was: installation of gdal but ... version 2.4.1 and then the latest version of fiona, pyproj, rtree and shapely in order like Geoff Boeing mentioned from wheel files. 因此,我的最终解决方案是:安装gdal但...版本2.4.1,然后安装最新版本的fiona,pyproj,rtree和shape,以便从轮文件中提到Geoff Boeing。 (installation with 'pip install "path to downloaded wheel file"'). (使用“ pip install“下载的车轮文件路径”安装)。 Don't forget about add path to gdal package after installation of gdal and before further steps. 安装完gdal之后,请不要忘记为gdal软件包添加路径。

After this, I just installed geopandas with pip install and what was important for me descartes and geopy packages (for plotting and geoconding). 之后,我通过pip install安装了geopandas,这对我来说重要的是笛卡尔和geopy软件包(用于绘图和地理编码)。

The smile on my face when all works... priceless and I just had to share with it :) 当一切正常的时候我脸上的笑容……无价,我只需要与它分享:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将shapefile转换为纬度和经度点的完整列表 - How to convert a shapefile to a complete list of latitude and longitude points 如何使用python在ESRI shapefile中以特定纬度/经度查找信息? - How to use python to lookup information at specific latitude/longitude in a ESRI shapefile? 使用Python将netcdf“ land”变量转换为纬度和经度 - Convert netcdf “land” variable to latitude and longitude with Python 将纬度经度转换为IMG像素值Python - Convert Latitude Longitude to IMG Pixel Values Python 在Python中将SRS坐标转换为纬度和经度 - Convert from SRS coordinates to Latitude and Longitude in Python 如何在python中将经度转换为十进制? - How to convert latitude longitude to decimal in python? 如何将HEXEWKB转换为Latitude,Longitude(在python中)? - How to convert HEXEWKB to Latitude, Longitude (in python)? 检查具有纬度和经度的地理点是否在 shapefile 中 - Check if a geopoint with latitude and longitude is within a shapefile 如何在 mssql 中将 SQL 几何类型转换为纬度(-90,90)和经度(-180,180)? - How to convert the SQL geometry type to latitude (-90,90) and longitude (-180,180) in mssql? 将几何点从 GeoJSON 转换为纬度和经度 - Converting a geometry point from GeoJSON to latitude and longitude
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM