geopandas

No module named 'folium.plugins', Python 3.6

别说谁变了你拦得住时间么 提交于 2021-02-09 03:51:03
问题 I am trying to import folium into a Jupyter notebook I'm working on and I cannot seem to solve the import issues with the Folium library. Has anyone else solved this problem? After encountering an error installing folium, I used the solution provided in this thread to install the module: Python 3.6 Module cannot be found: Folium Short summary: clone from github, install using the commandline. This worked, but instead I encountered the following error further down the line when trying to

No module named 'folium.plugins', Python 3.6

守給你的承諾、 提交于 2021-02-09 03:49:19
问题 I am trying to import folium into a Jupyter notebook I'm working on and I cannot seem to solve the import issues with the Folium library. Has anyone else solved this problem? After encountering an error installing folium, I used the solution provided in this thread to install the module: Python 3.6 Module cannot be found: Folium Short summary: clone from github, install using the commandline. This worked, but instead I encountered the following error further down the line when trying to

How to set fixed size for 'basemap' subplot when iterating through rows?

女生的网名这么多〃 提交于 2021-02-08 10:14:42
问题 Please forgive me as this is my first go at a Python 'Project'. A quick overview: I am trying to produce maps (MatPlotLib figures) by iterating through a GeoPandas dataframe of a GeoJSON file containing the boundaries of active subdivision phases in order to show the progress of construction of the individual lots in each subdivision phase. We normally did this manually in GIS, but I figured I'd take a stab at automating some, or all, of the process. I am also attempting to do this without

GeoPandas and OSMnx- plotting on map

冷暖自知 提交于 2021-02-08 06:51:19
问题 I want to plot my Geopandas df on a map. as a background i want a (road) map of the area. loving the OSMnx package, i'm trying to figure out how to use it's output (shapefile? network?) as my plot background import osmnx as ox G= ox.core.graph_from_place('Chengdu City', network_type='all_private', simplify=True, retain_all=False, truncate_by_edge=False, name='unnamed', which_result=1, buffer_dist=None, timeout=180, memory=None, max_query_area_size=2500000000, clean_periphery=True,

Issue with installing geopandas

旧巷老猫 提交于 2021-02-08 02:12:37
问题 I'm trying to install geopandas on my laptop, a Windows 10 version 1709 machine. After executing the pip install geopandas command, I'm getting the message: command python setup.py egg_info failed with error code 1. I already tried to upgrade pip and setuptools, but still no success. I installed Python 3.6. 回答1: Assuming you got something like this error: File "C:\Users\Simon\Anaconda3\lib\site-packages\setuptools\msvc.py", line 848, in __init__ raise distutils.errors.DistutilsPlatformError

intersect polygons based on if conditions on column values

不问归期 提交于 2021-01-29 16:23:55
问题 I want to intersect polygons within a GeoDataFrame based on if conditions on column values. I made up the GeoDataFrame with "id", "yr" (year), "wk" (week). # import libraries import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt # txt 2 polygon d = {'id': {0: 'a', 1: 'a', 2: 'a', 3: 'a', 4: 'a', 5: 'a', 6: 'a', 7: 'a', 8: 'a', 9: 'a', 10: 'b', 11: 'b', 12: 'b', 13: 'b', 14: 'b', 15: 'b', 16: 'b', 17: 'b', 18: 'b', 19: 'b', 20: 'c', 21: 'c', 22: 'c', 23: 'c', 24: 'c'},

Distance matrix between two point layers

倖福魔咒の 提交于 2021-01-29 10:19:25
问题 I have two arrays containing point coordinates as shapely.geometry.Point with different sizes. Eg: [Point(X Y), Point(X Y)...] [Point(X Y), Point(X Y)...] I would like to create a "cross product" of these two arrays with a distance function. Distance function is from shapely.geometry, which is a simple geometry vector distance calculation. I am tryibg to create distance matrix between M:N points: Right now I have this function: source = gpd.read_file(source) near = gpd.read_file(near) source

How to export a geopandas dataframe to excel

北城以北 提交于 2021-01-29 07:40:28
问题 Iam writing a simple code and would like to export the content of the GEODATAFRAME to excel. Please advise what is the simplest way to achieve that. The code is as follows: import geopandas as gpd import pandas as pd world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) world.plot() import matplotlib.pyplot as plt plt.show() print(world) I have tried the following code without success: xlpath='C:/' df=pd.DataFrame(eval(world)) export_excel = df.to_excel(xlpath) This is the

Contextily add_basemap uses wrong extent and zoom level

三世轮回 提交于 2021-01-29 06:55:33
问题 I'm trying to add a contextily basemap to a Matplotlib figure containing a GeoPandas data frame. When I just plot the data frame using df.plot the map extent is calculated correctly. However, when I try adding a contextily basemap the map extent (and zoom level) is calculated wrongly and the following warning is shown: UserWarning: The inferred zoom level of 27 is not valid for the current tile provider (valid zooms: 0 - 20). I'm trying to execute the following code: df = gpd.read_file('linz

Contextily add_basemap uses wrong extent and zoom level

烂漫一生 提交于 2021-01-29 06:55:09
问题 I'm trying to add a contextily basemap to a Matplotlib figure containing a GeoPandas data frame. When I just plot the data frame using df.plot the map extent is calculated correctly. However, when I try adding a contextily basemap the map extent (and zoom level) is calculated wrongly and the following warning is shown: UserWarning: The inferred zoom level of 27 is not valid for the current tile provider (valid zooms: 0 - 20). I'm trying to execute the following code: df = gpd.read_file('linz