question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Unknown geometry type: featurecollection upon upgrade to 0.7

See original GitHub issue

I was using geopandas 0.5.1 and upgraded to 0.7 to be able to use missing_kwds, but upon doing that, a part of the code that was working fine stopped working:

mrgd = pd.concat([mrgd,df_missing])

This is the line giving me an error, which is:

ValueError: Unknown geometry type: featurecollection

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JoyMonteirocommented, Nov 7, 2020

I faced the same problem. What I was doing wrong was assigning geometry from another geodataframe incorrectly. I was doing something like this

def get_geometry(location):
     return a[a['Location'] == location].geometry

b.geometry = b['Locations'].map(get_geometry)

what worked for me was

def get_geometry(location):
     return a[a['Location'] == location].geometry.values[0]

b.geometry = b['Locations'].map(get_geometry)
1reaction
martinfleiscommented, May 15, 2020

@BradyHu not much. It seems that there is featurecollection somewhere in your geometry column. GeoPandas now requires all values in geometry to be either shapely.geometry or missing. How did you generated tmp?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shapely doesn't recognize the geometry type of geoJson
Your geo_json object is geopandas.GeoDataFrame which has a column of shapely geometries. There's no need to call shape .
Read more >
Get geometry type from Feature Collection for every row
The GeoSeries class in geopandas package has geom_type attribute which gives you type of features geometry. Please review link: Overview of ...
Read more >
Geometries (shapely) — Spatial Data Programming with Python
Extracting geometry properties, such as: Geometry type (see Geometry type). Coordinates (see Geometry coordinates). Derived properties, such ...
Read more >
mapbox-gl - UNPKG
types /window.js';\n\n// shim window for the case of requiring the browser bundle in ... Point from '@mapbox/point-geometry';\nimport window from '.
Read more >
Scientific Abstracts and Sessions - 2020 - Medical Physics
Anatomical and Clinical Diagnostic Reference Levels; An Update ... and its impact on the individual treatment consequently remains unknown.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found