This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

How to remove National boundary of India from local OSM Map tiles?

0

I have set local OSM Map server for Map of India using mod tiles. I want to remove National Boundary from map. How to do it?

asked 19 Jul '18, 13:32

Reshma%20Maner's gravatar image

Reshma Maner
235303136
accept rate: 0%


One Answer:

1

You have several options:

  1. Identify the boundary in a LUA script which processes data as it is loaded into your database using osm2pgsql.
  2. Use osmosis and a tag-transform to change one or more tags associated with the boundary, for instance remove or alter admin_level or boundary=administrative
  3. If you wish to avoid reloading your database, it gets a bit trickier. One way would be to create a view on the polygon table to filter out the Indian boundary. The view would have to be named planet_osm_polygon, which in turn means that the base table names would all need changing which would likely make further incremental loads tricky if the renaming is not spot on. (I don't think it is possible with PostgreSQL to manage views owned by different users as one might do with Oracle - or at least when I've tried this I didn't get it to work, because of permissions on sys tables IIRC).
  4. Change the SQL statement which downloads the boundaries in the Carto-CSS file to filter out the India boundary. You then need to recompile to raw mapnik.
  5. Create a trigger on the planet_osm_polygon table which alters one or more of admin_level or boundary columns on INSERT and UPDATE.
  6. Pre-filter your data with osmfilter, which requires pbf->o5m conversion with osmconvert.

If you are content with a database reload I would use one of the first two, with a preference for the first. Of course you can do a manual intervention on the database table now as long as your update processes ensure that the polygon is ignored or not added as a national boundary.

answered 19 Jul '18, 14:17

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

This seems to be difficult. Isn't there a simple way to do this?

(20 Jul '18, 07:26) Reshma Maner