![]() ![]() #> Simple feature collection with 4 features and 1 fieldįine! Now we have IDs on SHAPE_INT. #> Warning: attribute variables are assumed to be spatially constant throughout all SHAPE_INT although coordinates are longitude/latitude, st_intersection assumes that they are planar We can get that using st_intersection: # Join to get ID on SHAPE We can confirm that SHAPE does not have ID. #> Simple feature collection with 4 features and 0 fields Personally, I prefer to extract the area to a column and summarise as in a regular data frame.ĪDM Simple feature collection with 2 features and 1 field.SHAPES does not have ID column as per your example.I expected this simple pipe to work, I remember seing somewhere that with dyplr, it's not mandatory to use intersect functions from the sf package. Names = character(0)))ĪDM are the two orange squares, and SHAPES are the black polygons. "ame"), sf_column = "geometry", agr = structure(integer(0), class = "factor". ), class = "bbox")), ID = 1:2), row.names = 1:2, sf_column = "geometry", agr = structure(c(ID = NA_integer_), class = "factor". Here is a reproducible example with two administrative units and some shapes within those. ![]() Administrative units have an identifier which is ADM$ID ![]() I would like to calculate the sum of the surface area of SHAPES by administrative units. In my case, one is administrative units (ADM) and the other is buildings (SHAPES). ![]() Let's say you have two sf objects made of polygons. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |