Questions tagged [geodataframe]

is a pandas.DataFrame that has a column with geometry

Filter by
Sorted by
Tagged with
4 votes
3 answers

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?
Vinay's user avatar
  • 221
4 votes
1 answer

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="_&...
Ammar Hoque's user avatar
8 votes
2 answers

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....
Aaron's user avatar
  • 51.3k
3 votes
1 answer

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 ...
Andrew Davis's user avatar
0 votes
1 answer

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 ...
Firnsy's user avatar
  • 21
0 votes
1 answer

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 : ...
Tim C.'s user avatar
  • 1,476
1 vote
1 answer

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 ...
Gabba's user avatar
  • 33
34 votes
3 answers

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 ...
Tim C.'s user avatar
  • 1,476
2 votes
1 answer

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 ...
Tim C.'s user avatar
  • 1,476
7 votes
2 answers

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 ...
Michael Wallace's user avatar
14 votes
1 answer

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....
Losbaltica's user avatar
  • 1,459
74 votes
3 answers

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(): ...
atkat12's user avatar
  • 1,489

1 2