2

I need to pass some data stored at the census tract level in Toronto to dissemination areas. When I run the Areal Weighted Interpolation package (code below), I get an invalid topology error (see below the code). Has anyone encounter this issue with the Canadian census boundary files? Any ideas how to fix it?

Code:

Toronto_DA_pop <- aw_interpolate(Toronto_DA, tid = DAUID, source = Toronto_CT_pop, sid = CTUID, weight = "sum", output = "tibble", extensive = c("population, population_50"))

Error:

Evaluation error: TopologyException: Input geom 1 is invalid: Ring Self-intersection at or near point 4012552.0600000001 1988270.4571450001 at 4012552.0600000001 1988270.4571450001.

1

2 Answers 2

1

Thanks to all

I did fixed it with QGIS, but a more streamlined solution was to simply write in R:

Toronto_DA_fixed = st_make_valid(Toronto_DA)
0

You could try using the Fix Geometries processing tool in QGIS. Before running it - verify the geometry errors with menu Vector>Geometry Tools>Check Validity. Then if it picks up errors run the Fix Geometries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.