Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 95730

For questions about using GeoPandas in Python

2 votes
1 answer
2k views

Difference between mask and bbox in geopandas read_file

Geopandas read has as options bbox and mask. https://geopandas.org/reference/geopandas.read_file.html What is the difference between those two options? …
Leo's user avatar
  • 972
1 vote

Python: Cannot construct empty GeoDataFrame with columns

Had the wrong pandas version. pip3 install pandas == 1.2.2 fixed it for me
Leo's user avatar
  • 972
6 votes
2 answers
9k views

GeoPandas: plot two layers but only to the extent of the smaller one

I am using GeoPandas and I want to plot two layers. I want the map to have the extent of the smaller layer. With this code below, the map's size automatically fits the bigger layer. … import geopandas as gp import matplotlib.pyplot as plt from shapely.geometry import LineString from shapely.geometry import MultiPoint thesmallpoints=gp.GeoDataFrame([[MultiPoint([(0, 0), (1, 1), (1,2 …
Leo's user avatar
  • 972
0 votes

GeoPandas: plot two layers but only to the extent of the smaller one

So I solved the problem by clipping the large linestring as follows import geopandas as gp import matplotlib.pyplot as plt from shapely.geometry import LineString, MultiPoint, Polygon thesmallpoints= …
Leo's user avatar
  • 972
1 vote
1 answer
1k views

GeoPandas plot does not work

I am running this code import geopandas df = geopandas.read_file('test.geojson') ax = df.plot(figsize=(10, 10), alpha=0.5, edgecolor='k') and I get nothing besides this error /usr/local/lib/python3.6 …
Leo's user avatar
  • 972
2 votes
Accepted

GeoPandas plot does not work

If you import matplotlib.pyplot as plt and add plt.show() to the end of the script, the error disappears and the plot is shown.
Leo's user avatar
  • 972
0 votes
1 answer
176 views

Python: Cannot construct empty GeoDataFrame with columns [closed]

My script import geopandas as gp test = gp.GeoDataFrame(columns=['geometry', 'costs']) the error: File "/usr/local/lib/python3.7/dist-packages/geopandas/geodataframe.py", line 89, in__init__ super(GeoDataFrame …
Leo's user avatar
  • 972
8 votes
3 answers
2k views

Self split geopandas Linestring geodataframe in a fast way without loosing all attributes

I have geodataframe of many LineStrings. The LineStrings intersect but are not split at those intersections. My current solution to achieve this is from here: network = gp.read_file(filenameNetwork) n …
Leo's user avatar
  • 972
6 votes
1 answer
2k views

Add WMS to matplotlib Python

Currently I am adding a basemap from stamen.com to my plots as it is explained here: http://geopandas.org/gallery/plotting_basemap_background.html . Is it also possible to load a WMS from another so …
Leo's user avatar
  • 972