pyproj

Cannot import name 'CRS' from 'pyproj' for using the osmnx library

谁都会走 提交于 2020-02-25 03:42:08
问题 I have used a fresh anaconda install to download and install all the required modules for osnmx library but I got the following error: 回答1: I have had the same issue and turned out that it did not like the latest release of osmnx (0.11.3). It could be that that version is unstable as its new (9th January 2020). I have sort out the issue by uninstalling the osmnx 0.11.3 conda uninstall osmnx and forcing to install the osmnx 0.11 version pip install osmnx==0.11 来源: https://stackoverflow.com

I have a json file that has a 2263 projection and i want to change it to 4326 using pyproj?

五迷三道 提交于 2020-02-06 18:57:48
问题 How do i use the pyproj module to take a file from a path and just change it automatically? The file also includes multiple rows of data. It would probably need to run a loop on all the coordinates and just change them? I've added this code into the question based on your suggestions. import os,shutil import json from pyproj import Proj,transform #Create Desktop Folder path= os.path.expanduser('~/Desktop/NAD83_to_WGS84') path2=os.path.expanduser(path+'/EPSG_4326.json') #Any file path for

Convert latitude, longitude to distance from equator in kilometers and round to nearest kilometer

时光总嘲笑我的痴心妄想 提交于 2020-01-14 03:48:27
问题 For each coordinate I have, I find the distance from the equator in kilometers giving me two distances: from pyproj import Geod wgs84_geod = Geod(ellps='WGS84') _,_, lon_dist = wgs84_geod.inv(0, 0,lon, 0) _,_, lat_dist = wgs84_geod.inv(0, 0,0, lat) As a sanity check,I can recalculate the original coordinate from these values as follows (assume the direction from the equator coordinate (0,0) is North and West: _, new_lat, _ = wgs84_geod.fwd(0,0, 0, lat_dist) new_lon, _, _ = wgs84_geod.fwd(0, 0

How do I get the area of a GeoJSON polygon with Python

淺唱寂寞╮ 提交于 2019-12-22 00:26:23
问题 I have the GeoJSON { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [[13.65374516425911, 52.38533382814119], [13.65239769133293, 52.38675829106993], [13.64970274383571, 52.38675829106993], [13.64835527090953, 52.38533382814119], [13.64970274383571, 52.38390931824483], [13.65239769133293, 52.38390931824483], [13.65374516425911, 52.38533382814119]] ] } } ] } which http://geojson.io displays as I would like to

RuntimeError: b'no arguments in initialization list'

雨燕双飞 提交于 2019-12-07 07:32:54
问题 I'm trying to solve my issue in my own but I couldn't, I'm trying to run this code in every format you can imagine and in ArcGIS pro software it's the same I can't find this error message in any other issue. From similar issues, it seems some data files could be missing? import geopandas as gpd import json import numpy as np from shapely.geometry import LineString, Point, box import ast from pyproj import Proj paths = road_features.SHAPE.map(lambda x: np.array(ast.literal_eval(x)["paths"][0])

RuntimeError: b'no arguments in initialization list'

可紊 提交于 2019-12-05 11:48:36
I'm trying to solve my issue in my own but I couldn't, I'm trying to run this code in every format you can imagine and in ArcGIS pro software it's the same I can't find this error message in any other issue. From similar issues, it seems some data files could be missing? import geopandas as gpd import json import numpy as np from shapely.geometry import LineString, Point, box import ast from pyproj import Proj paths = road_features.SHAPE.map(lambda x: np.array(ast.literal_eval(x)["paths"][0])) pathLineStrings = paths.map(LineString) gdf = gpd.GeoDataFrame(road_features,geometry=pathLineStrings

How do I get the area of a GeoJSON polygon with Python

给你一囗甜甜゛ 提交于 2019-12-04 20:16:47
I have the GeoJSON { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [ [[13.65374516425911, 52.38533382814119], [13.65239769133293, 52.38675829106993], [13.64970274383571, 52.38675829106993], [13.64835527090953, 52.38533382814119], [13.64970274383571, 52.38390931824483], [13.65239769133293, 52.38390931824483], [13.65374516425911, 52.38533382814119]] ] } } ] } which http://geojson.io displays as I would like to calculate its area (87106.33m^2) with Python. How do I do that? What I tried # core modules from

Geod ValueError : undefined inverse geodesic

空扰寡人 提交于 2019-11-29 11:59:42
I want to compute the distance between two lon / lat points by using Geod class from pyproj library. from pyproj import Geod g = Geod(ellps='WGS84') lonlat1 = 10.65583081724002, -7.313341167341917 lonlat2 = 10.655830383300781, -7.313340663909912 _, _, dist = g.inv(lonlat1[0], lonlat1[1], lonlat2[0], lonlat2[1]) I get the following error : ValueError Traceback (most recent call last) <ipython-input-5-8ba490aa5fcc> in <module>() ----> 1 _, _, dist = g.inv(lonlat1[0], lonlat1[1], lonlat2[0], lonlat2[1]) /usr/lib/python2.7/dist-packages/pyproj/__init__.pyc in inv(self, lons1, lats1, lons2, lats2,

Geod ValueError : undefined inverse geodesic

↘锁芯ラ 提交于 2019-11-28 05:37:55
问题 I want to compute the distance between two lon / lat points by using Geod class from pyproj library. from pyproj import Geod g = Geod(ellps='WGS84') lonlat1 = 10.65583081724002, -7.313341167341917 lonlat2 = 10.655830383300781, -7.313340663909912 _, _, dist = g.inv(lonlat1[0], lonlat1[1], lonlat2[0], lonlat2[1]) I get the following error : ValueError Traceback (most recent call last) <ipython-input-5-8ba490aa5fcc> in <module>() ----> 1 _, _, dist = g.inv(lonlat1[0], lonlat1[1], lonlat2[0],