Cartopy: Polygon not accepted as geometry for feature, multipolygon accepted

Created on 10 Nov 2017  路  2Comments  路  Source: SciTools/cartopy

I have two geometries from a geopandas geodataframe: 1 shapely polygon and 1 shapely multipolygon. The mutipolygon can be parsed to the ShapelyFeature() class but the polygon results in the error: TypeError: 'Polygon' object is not iterable

raw data below:

Polygon:
https://pastebin.com/s0LUUHs6

Multipolygon
https://pastebin.com/iiR7qjB7

Am I doing something wrong or is this an issue?

Most helpful comment

Hi @rutgerhofste

I'm afraid I can't access those pastebin links as they're blocked in my workplace, but you could try passing the polygon in as a list:

feat = ShapelyFeature([polygon])

Does that work?

All 2 comments

Hi @rutgerhofste

I'm afraid I can't access those pastebin links as they're blocked in my workplace, but you could try passing the polygon in as a list:

feat = ShapelyFeature([polygon])

Does that work?

It does, thanks. This is not a Cartopy issue then. Closing this topic.

Was this page helpful?
0 / 5 - 0 ratings