-
Hello Is there a way of deleting pois in disputed territories(for example pois in islands) in nominatim instance having their polygons? I am thinking of deleting from place and placex tables but I am not sure it will be enough to not display those info. I know it might not be a good idea to delete the data but as nominatim doesn't have a standard way of dealing with them i think it is the only solution. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
There is an undocumented maintenance SQL function The big disadvantage of this approach is that it undoes the previous indexing and that is expensive and doesn't always work perfectly. Also, if you run updates, then the relation might just return the moment somebody edits it. The better approach would be to filter the relations before they go into the database. There is a modestly simple way to achieve that with osmium-tool. Create a change file in OPL format that deletes all the relations/ways you don't want to have in the database. This is what it would look like:
The Then apply this change file to your planet:
Now import the filtered planet. The same works for change files. Download them separately, for example, using pyosmium. Then apply your blacklist:
And that you can apply manually to Nominatim:
Nominatim really should get native support for this kind of blacklisting but that has to wait until we have #2047. |
Beta Was this translation helpful? Give feedback.
There is an undocumented maintenance SQL function
place_force_delete()
which you can use to remove a relation properly. Find the place_id of the relation in question, for example, by using the/details
endpoint. RunSELECT place_force_delete(<place_id>)
in psql and then reindex your database withnominatim index
to make sure all places that are affected (because they have the unwanted place in their address) are updated as well.The big disadvantage of this approach is that it undoes the previous indexing and that is expensive and doesn't always work perfectly. Also, if you run updates, then the relation might just return the moment somebody edits it.
The better approach would be to filte…