Hi, I have set up a local map server. How can I remove a specific area from rendering? I want to black out some area.

asked 09 Jan '16, 11:34

Reshma%20Maner's gravatar image

Reshma Maner
accept rate: 0%

edited 09 Jan '16, 12:01

aseerel4c26's gravatar image

aseerel4c26 ♦


What is your current setup? What is true shape you want to exclude from rendering?

(11 Jan '16, 04:59) yvecai

I have set up local OSM map tile server using osmtopgsql. I have imported India map data. For example, if I want to exclude Maharashtra data, then how can I do it?

I do not want it to be displayed on my map.

(12 Jan '16, 09:20) Reshma Maner

One solution is to do this from your style file sql queries with postgis.

permanent link

answered 10 Jan '16, 08:51

yvecai's gravatar image

accept rate: 9%


Can you please elaborate?

(11 Jan '16, 04:47) Reshma Maner

Assuming you are using the standing osm2pgsql/postgis/mod_tile approach, one simple solution is to just delete the data from your database. You can write a postgis query to delete everything a specified polygon, in essense, just cut it out.

If you are doing data updates (with osmosis) this might cause problems. If you want to keep the data up to date, another approach could be to save the area you don't want (Maharashtra) as a shapefile, and then configure the mapnik style to draw a white (or whatever other colour) polygon in that area. The resultant image will have that are "blocked out". Regular data updates should work in that case.

permanent link

answered 12 Jan '16, 10:48

rorym's gravatar image

accept rate: 11%

Thank you. I would like to go with second approach of using mapnik to draw a polygon in the area. How can I do it?

(12 Jan '16, 11:11) Reshma Maner
Your answer
toggle preview

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](http://url.com/ "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: 09 Jan '16, 11:34

question was seen: 2,517 times

last updated: 12 Jan '16, 11:11

powered by OSQA