NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm installing my own Nominatim instance and decided I don't need as many regions as I imported. The docs don't say how to drop/remove regions, so is there a way or do I have to start from scratch?

asked 28 Jul '20, 19:45

RenegadeTech's gravatar image

accept rate: 0%

There's no such feature. If the issue is disk space you could delete tables needed for updates ( but of course then you cannot update the data regularly any more.

In you can see which tables and indices would NOT be deleted, the planet_* tables will safe the most space.

Updates ( work by downloading OSM change files ( and loading then into the database. Those can include additions, changes to objects, deletions. You could create a change file by comparing the data you have currently in the database against what you want in the database, a lot of deletions basically.

Say you imported countryA and countryB, and now you only want countryB in the dababase:

With Osmosis:

osmosis --read-xml file="countryAandB.osm" --read-xml file="countryB.osm" --derive-change --write-xml-change file="mychanges.osc"

Note, you need to convert between .pbf (binary) and .osm (XML) file formats before.

With Osmium:

osmium derive-changes countryAandB.osm.pbf countryB.osm.pbf -o mychanges.osc

Then you import the change file:

osm2pgsql/osm2pgsql --hstore --latlong --append --slim --number-processes 1 --output gazetteer --style settings/ --database nominatim mychanges.osc

That's based on code (many variables say osmosis but these days it runs pyosmium really).

That's untested, I'm not aware anybody has done it and I would double-check on the mailing list and create a database backup first.

permanent link

answered 30 Jul '20, 11:03

mtmail's gravatar image

accept rate: 27%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 28 Jul '20, 19:45

question was seen: 2,161 times

last updated: 30 Jul '20, 11:03

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum