Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dabreegster opened this issue Apr 18, 2023 · 7 comments

Comments

@dabreegster
Copy link
Contributor

Use case: don't combine two OSM ways together

@dabreegster
Copy link
Contributor Author

@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
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

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: ropensci/stplanr#513

@dabreegster
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor Author

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

@dabreegster dabreegster changed the title Optionally split when a property changes Optionally glue together line-strings separate in the input that wind up with the same output properties Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants