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

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
235303136
accept rate: 0%

edited 09 Jan '16, 12:01

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

2

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

yvecai
1.5k1226
accept rate: 9%

2

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

rorym
5.4k1449100
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

Follow this question

By Email:

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

By RSS:

Answers

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:

×440
×287
×31

question asked: 09 Jan '16, 11:34

question was seen: 2,827 times

last updated: 12 Jan '16, 11:11

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