Closed pedro-andrade-inpe closed 4 years ago
Hi Pedro. Thanks for the heads up. We have to dig into this to find what exactly is causing the problem. It might be something related to st_make_valid
, see this sf
issue. In the mean time, this will probably solve your problem. I am copying @babisan08 so perhaps she could help us find the origin of the problem.
p = st_collection_extract(urb, "POLYGON")
st_write(p, "p.shp")
I think it is just a missing call to st_cast("MULTIPOLYGON")
.
Yest, using st_cast("MULTIPOLYGON")
is probably the best approach to fix this. I have already updated our prep_
script and updated the files in the server. Closing the issue now.
@pedro-andrade-inpe , this problem is also present in other data sets (see issue #151 ). One way to automate the solution to this would be to run mysf<- sf::st_cast(mysf, "MULTIPOLYGON")
for all polygon data sets before saving them in our server.
I wondering though whether this could have any side effects... do you think this is safe?
I'm trying to save urban areas into shapefiles, but I got an error:
I think I've seen this problem before in geobr, but I coundn't find an issue.