Geographic Information Systems Asked by Daniel Ferreira on February 12, 2021
I’m trying to solve this problem using the R sf
package, but I assume that an answer in PostGIS could also help me get to an answer in R.
Basically, I have a shapefile with the following columns: "Census area", "Street Name", and a MULTILINESTRING that represents the street segment within that "Census area" spatially. Usually, streets are straight lines that run across multiple "census areas", so I want to get rid of the "Census area" part and just collapse these "mini-street-segments" within Census areas into a single MULTILINESTRING for every single street.
In a world where there were no street name duplicates, this would be trivial. I’d just get all geometries that have the same street names and dissolve them into a single LINESTRING or MULTILINESTRING. In R sf/dplyr syntax:
df %>% group_by(street_name) %>% summarize()
However, we do have duplicate street names. We may have:
What I want to do is separate such a "non-contiguous" MULTILINESTRING into two or more MULTILINESTRINGS that represent the two or more C streets. How should I go about that?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP