-
Notifications
You must be signed in to change notification settings - Fork 22
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
Can't filter specified area by trim_osc.py script #10
Comments
There will be coordinates outside: the script does not filter out 100% of these. It keeps ways and relations that refer to nodes inside the area, but are located partly outside, like longer route relations. It keeps everything it cannot tie to a coordinate, like relation changes. So for a result, there would be many objects that lie outside of bounds, but still much less than the entire change file. |
@Zverik Rephrasing your answer, am I right that as a result script removes all nodes which lie outside bounds and not connected to nodes which lie inside bounds? Ways and relations are filtered out only if theirs nodes are fully located outside bounds? |
Mostly yes. It also uses the connection to osm2pgsql database to keep all objects that are referenced by or reference objects in the database. |
@Zverik ok, rephrasing again, database is used to be source of truth, if any file's object exists in DB, it won't be deleted, without any conditions. |
I have simple world.zip osm changes file, which I want trim by corresponding script, by specifying Andorra's poly file.
Here is my command for that
~/src/regional/trim_osc.py -d gis --user postgres --host localhost --port 5432 --password -p "${WORKOSM_DIR}/andorra.poly" world.osm worldTrimmed.osm
.After executing that command,
worldTrimmed.osm
is lesser thanworld.osm
, but after checking coordinates in file, I see that there are still coordinates outside Andorra's bounds.In fact, sample file:
is filtered well, and only node with id 60359982 lasts.
What's wrong with that scenario and how can I fix that?
The text was updated successfully, but these errors were encountered: