Closed joeytalbot closed 4 years ago
https://r-spatial.github.io/lwgeom/reference/valid.html This always works, but be careful in what has been changes ot make it valid.
Well spotted, that's definitely invalid and worth fixing. Just to clarify, is that a zone in the PCT? Worth fixing 'upstream' if so but for now you could use something like QGIS to fix the geometry or try st_make_valid()
function described here: https://www.r-spatial.org/r/2017/03/19/invalid.html
I don't think this issue affects the output or 'MVP' so would prioritise other things for now, will be great to get an overview map of Leeds with the following layers visualised (in fact I may make an overview issue from this):
Bear in mind that if you are using ST_Simplify (i.e. Douglas-Peucker algorithm), that can result in invalid geometries.
Yes, I recommend the mapshaper approach which uses a better and faster algorithm. Details: https://geocompr.robinlovelace.net/geometric-operations.html#simplification
Yes it comes from get_pct_zones()
.
I've tried using st_make_valid
and the resulting object is listed as valid, but in mapview() the polygon looks exactly the same as it did before.
Interesting. Minor bug in data provided by government (the geometries were not made by us).
Invalid geometires are often visually fine see the example pictures https://shapely.readthedocs.io/en/latest/manual.html
Also do you know the x = st_buffer(x, 0) trick?
When I make a tmap of the Leeds accessibility stats, the map shows up ok but this message also appears:
There is only one polygon that has invalid geometry is this is it: http://rpubs.com/joeytalbot/invalid_geometry
Is this worth fixing, and if so what would be the best way to do it?