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

enableKeepPartialLinestring on partial ways may convert closed ways to open ways. #133

Open
Famlam opened this issue Jul 15, 2023 · 0 comments

Comments

@Famlam
Copy link

Famlam commented Jul 15, 2023

Background
With the parameter enableKeepPartialLinestring enabled, the linestring of a way is generated even if the way is incomplete. This geometry is - as per the definition - different from the original geometry. The implementation is (shortly said) that every non-existing node is simply skipped. This normally doesn't change the nature of the way, it is just "shortened" or "shrunk" a little bit. (In rare cases the linestring can become an invalid geometry. All as expected)

Problem
However, for a closed way where the first (= last) node is missing, this changes the geometry such that a closed way (which can be polygonized) suddenly becomes an open way. An example would be to take way https://www.openstreetmap.org/way/1059958114 from the extract of Zeeland generated here: http://download.openstreetmap.fr/extracts/europe/netherlands/ . This partially downloaded (closed) way generates the following (open) linestring

LINESTRING(3.60106 51.643859500000005,3.6032414 51.6446471,3.6053391 51.645518300000006,3.6073448 51.646469700000004,3.6092506 51.6474976,3.611049 51.648597800000005,3.6127328 51.6497661,3.6142955 51.6509979,3.6157309 51.6522882,3.6170333 51.653632,3.6181975 51.655024100000006,3.619219 51.6564588,3.6200937 51.6579306,3.6208181 51.6594337,3.6213894 51.660962000000005,3.6218053 51.6625097,3.6220641 51.6640705,3.6221648 51.665638400000006,3.6221071 51.667207100000006)

Request
When calling Osmosis with enableKeepPartialLinestring enabled, verify whether the id of the first node of the original way was identical to the id of the last node of the original way. (The references to the node ID should still be in the way object, even if some of the nodes themselves are missing). If this is the case, close the partial line string by "adding" the first node to the end of the linestring.

Maybe this should be the default for enableKeepPartialLinestring=yes, or maybe it's better to add a third option for enableKeepPartialLinestring (like enableKeepPartialLinestring="keepClosed").

cc @frodrigo

frodrigo added a commit to frodrigo/osmosis that referenced this issue Jul 16, 2023
frodrigo added a commit to frodrigo/osmosis that referenced this issue Jul 16, 2023
frodrigo added a commit to frodrigo/osmosis that referenced this issue Aug 29, 2023
brettch added a commit that referenced this issue Sep 2, 2023
On enableKeepPartialLinestring, output a closed linestring if the original way is closed even on missing start/end node #133
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

1 participant