acteng / overline

Aggregation of overlapping lines and values to build route networks
4 stars 0 forks source link

Optionally glue together line-strings separate in the input that wind up with the same output properties #8

Open dabreegster opened 1 year ago

dabreegster commented 1 year ago

Use case: don't combine two OSM ways together

dabreegster commented 1 year ago

@Robinlovelace, I was trying to write a test for this case, and I actually don't understand what the problem is in practice. Different OSM way IDs shouldn't be grouped, right? But two different roads in OSM never have overlapping geometry anyway; that's an accidental mapping error when it happens

Robinlovelace commented 1 year ago

Good question. Yes, I think a commonly useful use case would be to split on OSM ID. I guess an argument like --split_by osm_id could be used for this.

dabreegster commented 1 year ago

I'm saying that if two line-strings have a different OSM ID, then they already don't overlap and wouldn't be grouped. So the use case for this can't be splitting on OSM ID. Does this option exist in the R version, or where is it needed? Do you have a motivating example?

Robinlovelace commented 1 year ago

Not sure I fully understand sorry. In the current implementation linestrings with different OSM IDs get merged if the sum of the values (or whatever aggregating function is used) is the same. That is more of a bug than a feature currently. There are few options in the R version. In fact a motivation for starting afresh, beyond performance and features, is this: https://github.com/ropensci/stplanr/issues/513

dabreegster commented 1 year ago

In the current implementation linestrings with different OSM IDs get merged if the sum of the values (or whatever aggregating function is used) is the same

If we have two adjacent line-strings in the input like:

<--------------------<--------------

You're saying that if the property being summed/aggregated winds up the same, the current implementation would glue these two together as one resulting linestring? I see. The current implementation does not do that, and I've started also thinking about how to retain / plumb along any feature IDs (outside of properties). Maybe something like the keep_any aggregation.

Robinlovelace commented 1 year ago

You're saying that if the property being summed/aggregated winds up the same, the current implementation would glue these two together as one resulting linestring?

Yep. I can imagine use cases where it's useful to glue them, e.g. when you want to reduce the file size of the route networks. That is a lot less applicable now than it was when we first developed it.

dabreegster commented 1 year ago

OK so I'll rephrase and deprioritize this issue. Thanks for clarifying!