Bom dia:
Estou com o mesmo problema do colega André (relatado aqui).
Após trocar o crs do dataframe:
setor_m = setor_m.to_crs({'init': 'epsg:4326'})
o agrupamento pelo bairro dá o mesmo erro:
bairro = setor_m.dissolve(by='NM_BAIRRO', aggfunc='sum')
TopologyException: Input geom 0 is invalid: Self-intersection at or near point -43.250213293714594 -22.887739582871898 at -43.250213293714594 -22.887739582871898
TopologyException: Input geom 0 is invalid: Self-intersection at or near point -43.250213293714594 -22.887739582871898 at -43.250213293714594 -22.887739582871898
TopologyException: Input geom 0 is invalid: Self-intersection at or near point -43.250213293714594 -22.887739582871898 at -43.250213293714594 -22.887739582871898
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/pandas/core/groupby/ops.py in agg_series(self, obj, func)
662 try:
--> 663 return self._aggregate_series_fast(obj, func)
664 except Exception:
22 frames
pandas/_libs/reduction.pyx in pandas._libs.reduction.SeriesGrouper.get_result()
pandas/_libs/reduction.pyx in pandas._libs.reduction.SeriesGrouper.get_result()
ValueError: No Shapely geometry can be created from null value
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
ValueError: No Shapely geometry can be created from null value
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/shapely/geometry/base.py in geom_factory(g, parent)
74 # Abstract geometry factory for use with topological methods below
75 if not g:
---> 76 raise ValueError("No Shapely geometry can be created from null value")
77 ob = BaseGeometry()
78 geom_type = geometry_type_name(g)
ValueError: No Shapely geometry can be created from null value
Alguma sugestão para corrigir isto? Obrigado.