Questions tagged [geodataframe]
is a pandas.DataFrame that has a column with geometry
112
questions
4
votes
3
answers
12k
views
How to convert GeoSeries polygons to lists of coordinates?
I have a GeoDataFrame consisting polygons. How can I convert each polygon into a list of coordinates? Is there any attribute, method or function in GeoPandas to do this?
4
votes
1
answer
16k
views
Getting AttributeError: 'DataFrame' object has no attribute 'to_file' from GeoPandas even though file converted into GeoDataframe instead of Dataframe
I have turned some R scripts for data cleaning/standardization of shapefiles into Python scripts.
Here is the R code:
x<-c(farm,field,"trialyield",2017)
file<-paste(x, collapse="_&...
8
votes
2
answers
10k
views
Convert polygon bounding box to geodataframe?
I have a pandas dataframe that contains bounding box information for tiled raster data in the following format.
left bottom right top
466583.40921 3135701....
3
votes
1
answer
5k
views
Geometry Data in GeoDataFrame will not plot
I want to import a CSV to use as a geodataframe. When I plot it, nothing shows, which makes me think I'm doing something wrong. Here's my code.
import pandas as pd
from geopandas import GeoDataFrame
...
0
votes
1
answer
158
views
MapInfo Pro 64-bit - 16.0.3 - Snap Frame to Guideline (unable to?)
I am using MapInfo Pro 64-bit v16.0.3
In the layout, I want to snap my map frame to the guideline. I've noticed that when I create a rectangular box, this snaps to the guidelines once the edge is ...
0
votes
1
answer
3k
views
Why gdf.explode() doesn't work?
I'm trying to merge 2 geodataframes and combine all entities.
So I use :
cloudNshadow = gpd.overlay(cloud, shadow, how='union')
cloudNshadow = cloudNshadow.unary_union()
But it returns me :
...
1
vote
1
answer
1k
views
Intersection with Shapely and Fiona gives Key Error
I have written a script for standalone python based on this example for doing intersections of linestrings (representing streets) and polygons (representing gridcells) using shapely/fiona. The ...
34
votes
3
answers
29k
views
Creating polygon grid using GeoPandas
I'm working with a GeoDataFrame of points and I need to create a grid of rectangular polygons.
I know how to have bounds of the GeoDataFrame with gdf.geometry.bounds. Now using this information and ...
2
votes
1
answer
8k
views
CSV to Geodataframe : How to have valid geometry objects?
I'm writing a script with Geopandas. I try to use a csv of blocks to make a spatial join. So I convert it as a Geodataframe. But when I want to set geometry column it returns me Input geometry column ...
7
votes
2
answers
24k
views
Extracting points from LineString or Polygon and making dictionary out of them in GeoPandas
I am building some pre-processing routines for 3D visualization of GIS data and I have several line and polygon shapefiles with multiple features. I want to extract the points for each of the features ...
14
votes
1
answer
45k
views
AttributeError "'int' object has no attribute 'encode'" when writing GeoDataFrame into shapefile or spatialite with GeoPandas
I am trying to save a GeoDataFrame as a shapefile or spatialite, but for some reason, I get this error:
File "fiona\ogrext.pyx", line 951, in fiona.ogrext.WritingSession.start (fiona/ogrext....
74
votes
3
answers
101k
views
Converting Pandas DataFrame to GeoDataFrame
This seems like a simple enough question, but I can't figure out how to convert a Pandas DataFrame to a GeoDataFrame for a spatial join?
Here is an example of what my data looks like using df.head():
...