geopandas

Conda install some-package hangs with (Solving environment: failed)

青春壹個敷衍的年華 提交于 2021-01-28 01:50:15
问题 I have tried multiple ways but can't install packages (in my case, geopandas). I tried geopandas install guide, but get output that runs forever. I tried without creating an environment, after creating a new environment, using defaults channel and using conda-forge channel. None worked. $ conda create -n top $ conda activate top $ conda config --env --add channels conda-forge $ conda config --env --set channel_priority strict $ conda install python=3 geopandas Collecting package metadata

Merge countries using Cartopy

时光总嘲笑我的痴心妄想 提交于 2021-01-27 21:12:47
问题 I am using the following code to make a map for Sweden, Norway and Finland together as one area. however, I am struggling with it. I'm following this example, Python Mapping in Matplotlib Cartopy Color One Country. from shapely.geometry import Polygon from cartopy.io import shapereader import cartopy.io.img_tiles as cimgt import cartopy.crs as ccrs import geopandas import matplotlib.pyplot as plt def rect_from_bound(xmin, xmax, ymin, ymax): """Returns list of (x,y)'s for a rectangle""" xs =

Import error geopandas, fiona

这一生的挚爱 提交于 2021-01-27 16:36:03
问题 I have an error with import geopandas, fiona. When I'm trying to import geopandas import geopandas as gpd It returns me --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-8-77a0d94ee2c6> in <module>() 5 #ret = add(1,3) 6 #print(ret) ----> 7 import geopandas as gpd ~\Anaconda3\lib\site-packages\geopandas\__init__.py in <module>() 2 from geopandas.geodataframe import GeoDataFrame 3 ----> 4 from geopandas.io

Install Python geopandas failed

南笙酒味 提交于 2021-01-24 11:25:26
问题 I'm trying to install geopandas. Have the following setup: Windows-64 Anaconda2 (64-bit) Python 2.7 Have tried two things: 1) pip install geopandas This gives me the following error: WindowsError: [Error 126] The specified module could not be found and Command "python setup.py egg_info" failed with error code 1 in c:\users\username\appdata\local\temp\pip-install-_kgeyw\shapely\ The solutions to the similar problem here suggest that it's because of the slashes in the path being converted. Not

GeoPandas .to_crs() method not converting

半世苍凉 提交于 2021-01-07 01:29:10
问题 I am trying to convert some datasets into the same coordinate system (NC2264) NC2264 = 'EPSG:2264' sfd_subs = pd.read_csv(r'FILE_LOCATION.csv') wake_shapes = gpd.GeoDataFrame.from_file(r'FILE_LOCATION.shp').to_crs(NC2264) sfd_subs = gpd.GeoDataFrame(sfd_subs, geometry=gpd.points_from_xy(sfd_subs.Longitude, sfd_subs.Latitude),crs='EPSG:4326') sfd_subs.to_crs(NC2264) print(sfd_subs.crs) The shapefile conversion works perfectly but the 'sfd_subs' remains unchanged. I'm getting no errors. I've

Get Distance Between Two Points in GeoPandas

主宰稳场 提交于 2021-01-05 11:31:30
问题 I have two points as below. I need to get the distance between them in meters. POINT (80.99456 7.86795) POINT (80.97454 7.872174) How can this be done via GeoPandas? 回答1: Your points are in a lon, lat coordinate system (EPSG:4326 or WGS 84). To calculate a distance in meters, you would need to either use the Great-circle distance or project them in a local coordinate system to approximate the distance with a good precision. For Sri Lanka, you can use EPSG:5234 and in GeoPandas, you can use

How to rotate a Contextily basemap in matplotlib and Jupyter notebook

六月ゝ 毕业季﹏ 提交于 2021-01-05 07:25:07
问题 The bounty expires in 7 days . Answers to this question are eligible for a +50 reputation bounty. AlexS1 wants to draw more attention to this question: Desired answer will allow "Plot-A" and "Plot-B" to be rotated 90-degrees or 270-degrees such that the implied north arrow points to the left or right (note default implied north arrow points to top). These subplots also need to correctly plot the Contextily basemap and Geopandas geodataframe. Thanks in advance for help. I am making a set of

get mean of netcdf file using xarray

浪子不回头ぞ 提交于 2021-01-02 08:17:27
问题 I have opened a netcdf file in python using xarray, and the dataset summary looks like this. Dimensions: (latitude: 721, longitude: 1440, time: 41) Coordinates: * longitude (longitude) float32 0.0 0.25 0.5 0.75 ... 359.25 359.5 359.75 * latitude (latitude) float32 90.0 89.75 89.5 89.25 ... -89.5 -89.75 -90.0 expver int32 1 * time (time) datetime64[ns] 1979-01-01 1980-01-01 ... 2019-01-01 Data variables: z (time, latitude, longitude) float32 50517.914 ... 49769.473 Attributes: Conventions: CF

get mean of netcdf file using xarray

ⅰ亾dé卋堺 提交于 2021-01-02 08:17:13
问题 I have opened a netcdf file in python using xarray, and the dataset summary looks like this. Dimensions: (latitude: 721, longitude: 1440, time: 41) Coordinates: * longitude (longitude) float32 0.0 0.25 0.5 0.75 ... 359.25 359.5 359.75 * latitude (latitude) float32 90.0 89.75 89.5 89.25 ... -89.5 -89.75 -90.0 expver int32 1 * time (time) datetime64[ns] 1979-01-01 1980-01-01 ... 2019-01-01 Data variables: z (time, latitude, longitude) float32 50517.914 ... 49769.473 Attributes: Conventions: CF

Order Layers behind HeatMapWithTime in Folium

故事扮演 提交于 2021-01-01 09:21:51
问题 I created this map of the Middle East in folium. I am very happy with how it looks: https://javierparada.github.io The only problem is that one of the background layers is blocking the HeatMap. I don't know how to organize the layers so that the HeatMap is shown on top of the folium.raster_layers.ImageOverlay that contains the Land Use Changes. Thanks! # Leaflet’s CRS: EPSG3857 # colormap= lambda x: (1, 0, 1, 1) #R,G,B,alpha, # tiles='stamentoner', # play with z-index # m.keep_in_front(m.add