I’m working with a MongoDB database containing city polygon data. I’ve successfully connected to it from Python and downloaded the data. However, when I convert it into a GeoDataFrame, the geometry column doesn’t seem to be recognized correctly. How can I ensure GeoPandas can utilize the geometry data?
The following code demonstrates the process:
query = {
'properties.PROVINCIA': 'Ciudad'
}
consult = collection.find(query)
df_result = pd.DataFrame(consult)
df = pd.DataFrame.from_records(df_result['properties'].tolist())
df['geometry'] = df_result['geometry']
df.head()
Thanks!!