geopandas

why can't I import geopandas?

不打扰是莪最后的温柔 提交于 2020-05-25 03:29:54
问题 My only line of code is import geopandas and it gives me the error OSError: Could not find libspatialindex_c library file has anyone encountered this before? my script was working just fine until this error came up. **Note that rtree module not found was an issue fisrt, and upon installation I received the above error instead. 回答1: I had the same issue while working in Linux Subsystem at Windows 10 (speaking about this). What helped was installing the version for developers using apt . Namely

How to do a point in polygon query efficiently using geopandas?

孤街醉人 提交于 2020-05-23 21:06:08
问题 I have a shapefile that has all the counties for the US, and I am doing a bunch of queries at a lat/lon point and then finding what county the point lies in. Right now I am just looping through all the counties and doing pnt.within(county). This isn't very efficient. Is there a better way to do this? 回答1: Your situation looks like a typical case where spatial joins are useful. The idea of spatial joins is to merge data using geographic coordinates instead of using attributes. Three

How to do a point in polygon query efficiently using geopandas?

谁都会走 提交于 2020-05-23 21:05:26
问题 I have a shapefile that has all the counties for the US, and I am doing a bunch of queries at a lat/lon point and then finding what county the point lies in. Right now I am just looping through all the counties and doing pnt.within(county). This isn't very efficient. Is there a better way to do this? 回答1: Your situation looks like a typical case where spatial joins are useful. The idea of spatial joins is to merge data using geographic coordinates instead of using attributes. Three

GeoPandas: check if point is in polygon

Deadly 提交于 2020-05-17 03:29:06
问题 I searched for my problem and found this question which is different from my issue. I have two geo data frames, one contains houses locations as points (~700 points) and the other contains suburbs names and their polygon (~2973 polygons). I want to link each point to a polygon to assign each house to the correct suburb. sample of my geo dataframe polygon import geopandas as gpd from shapely.geometry import Point from shapely.geometry.polygon import Polygon #creating geo series polys = gpd

geopandas: sjoin 'NoneType' object has no attribute 'intersection'

拜拜、爱过 提交于 2020-05-15 02:26:08
问题 I am trying to do a spatial join with two open source datasets. I am running into an AttributeError: 'NoneType' object has no attribute 'intersection' error. Similar errors have seem to have been solved by ensuring empty geometry is removed but this does not seem to help. I also have spatialindex-1.9.3 and rtree-0.9.3 installed. I am using Python 3.8 import geopandas as gpd import pandas as pd from shapely.geometry import Point # Import LSOA polygon data LSOA_polygons = gpd.read_file('https:/

Error installing geopandas:“ A GDAL API version must be specified ” in Anaconda

不羁的心 提交于 2020-05-12 11:32:45
问题 This error raised while installing geopandas. I've looking for its solution on the web, but none of them really explain what happened and how to solve it.. This is the full error: Collecting geopandas Using cached https://files.pythonhosted.org/packages/24/11/d77c157c16909bd77557d00798b05a5b6615ed60acb5900fbe6a65d35e93/geopandas-0.4.0-py2.py3-none-any.whl Requirement already satisfied: shapely in c:\users\alvaro\anaconda3\envs\tfdeeplearning\lib\site-packages (from geopandas) (1.6.4.post2)

matplotlib geopandas plot chloropleth with set bins for colorscheme

邮差的信 提交于 2020-05-05 20:31:11
问题 How do I set a consistent colorscheme for three axes in the same figure? The following should be a wholly reproducible example to run the code and get the same figure I have posted below. Get the shapefile data from the Office for National Statistics. Run this in a terminal as a bash file / commands. wget --output-document 'LA_authorities_boundaries.zip' 'https://opendata.arcgis.com/datasets/8edafbe3276d4b56aec60991cbddda50_1.zip?outSR=%7B%22latestWkid%22%3A27700%2C%22wkid%22%3A27700%7D

cx_freeze exe file works in anaconda prompt but not in windows cmd command prompt?

喜欢而已 提交于 2020-04-16 05:03:22
问题 I have spent most of the day trying to compile an exe file from my python script and running it through the vanilla cmd command prompt. I finally managed to create the exe-file, but weirdly it only runs in the anaconda prompt and not in the cmd. Here is the full error message/traceback: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run module.run() File "C:\ProgramData\Anaconda3\lib\site-packages\cx

cx_freeze exe file works in anaconda prompt but not in windows cmd command prompt?

六月ゝ 毕业季﹏ 提交于 2020-04-16 05:03:13
问题 I have spent most of the day trying to compile an exe file from my python script and running it through the vanilla cmd command prompt. I finally managed to create the exe-file, but weirdly it only runs in the anaconda prompt and not in the cmd. Here is the full error message/traceback: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run module.run() File "C:\ProgramData\Anaconda3\lib\site-packages\cx

Accessing package in python virtual environment

情到浓时终转凉″ 提交于 2020-03-25 18:42:59
问题 I have a virtual environment in which I have installed 'geopandas'. When I do a pip list it lists this package as well. But when I try to call it in my jupyter notebook via 'import geopandas' I get a ModuleNotFoundError. Please help - I'm using windows machine 回答1: You can verify that your notebook is running in the correct virtual environment by doing: import sys sys.version Here's how to run a Jupyter notebook in a virtualenv. 回答2: You should check if your notebook is using the correct