OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2011-01-14 01:04:12

Importing official administrative boundaries

We've got raster image of the administrative boundaries.

The data is here: http://www.wisdom.weizmann.ac.il/~dmitryb/moin/
http://www.wisdom.weizmann.ac.il/~dmitr … ut_OSM.jpg : the raster
http://www.wisdom.weizmann.ac.il/~dmitr … ut_OSM.jgw : the geographical calibration
These two files are what was originally sent by the MoIn.

http://www.wisdom.weizmann.ac.il/~dmitr … hiput.tiff : I merged the two above into GeoTIFF and added the spatial reference (Israel Grid EPSG:2039)
Source: Ministry of Interior
Updated: August 2010
Terms of use: unrestricted.

Before starting to trace, I see several issues which should be settled.

1) How to overlay? From my experience, the only feasible way to have this raster in JOSM is by installing a local WMS server and pointing JOSM to it. Importing the image directly into JOSM (via ImportImage plugin) eats up all the memory and eventually causes a crash.
I am still looking for a way to make the TIFF transparent.

2) How to tag? First, it's about time to settle the admin_level values. My proposition:

2 - National border
3 -
4 - District (Mahoz)
5 - Sub-district (Nafa)
6 - Natural Region (Ezor Tiv'i)
7 - Metropolitan Area?  - there are only three of those: Tel-Aviv (Gush Dan), Beersheva and Haifa
8 - Cities/regional councils. This is what appears in the raster.
9 -
10 - Municipal subdivision (Shkhuna)

Now we trace the lines from the raster and tag them:
- boundary=administrative
- admin_level=8 (except when this is also a higher-level boundary, such as a District or state border)
- source: MOIN
- date: 08/2010

Then we create a boundary relation with admin_level=8 for each named area in the raster. Select its "outer" members, optional "inner" members and an optional "admin_centre" node. Add name:* tags.

3). Higher-level boundaries. An approximate district and sub-district boundaries can be found here. The district borders are exactly on top of what we have from MOIN (they confirmed this), so there should be no problem having these as well. This is not the case for sub-districts, so perhaps we should leave them for now.

dimka

Last edited by dimka (2011-01-14 01:04:43)

Offline

#2 2011-01-14 11:12:45

Re: Importing official administrative boundaries

Wow!!!
That's GREAT news!
Hopefully, this is only the first in many donations.

dimka wrote:

1) How to overlay? From my experience, the only feasible way to have this raster in JOSM is by installing a local WMS server and pointing JOSM to it. Importing the image directly into JOSM (via ImportImage plugin) eats up all the memory and eventually causes a crash.
I am still looking for a way to make the TIFF transparent.

There are several ways of doing it.
I think the easiest is to have it as a background, e.g. in Potlatch2.
Need to cut the whole image into 256x256 pixels squares, and align them.

The easiest is to decide on a zoom level, say 14, and look at some key tiles, and align according to them.

Then we need to name the tiles according to the standard (zoom level, x, y)
Actually, only one dimension. The other 2 are directories, or using underscores and put it all in the same directory.

And then it would be easy to have as a custom background.

talkat.

Offline

#3 2011-01-14 11:37:29

Mr_Israel
Moderator
From: Israel, Germany
Registered: 2009-03-02
Posts: 505

Re: Importing official administrative boundaries

I can do the graphical cutting. Will not take that much time I think.
Maybe the source image needs to be zoomed before cutting, so you will have a higher zoom level?

Offline

#4 2011-01-14 11:48:00

Re: Importing official administrative boundaries

Another option is to set up a WMS server. It's really easy with Geoserver, takes 10 minutes and works out of the box.  I have already done this on my local machine, unfortunately I am behind a firewall so it's no good for others.
Then you would point Potlatch to something like "http://localhost:8080/geoserver/wms?"

Offline

#5 2011-01-14 11:51:16

Re: Importing official administrative boundaries

1. I've added an entry for Israel here.
2. I've added Northern District here: http://www.openstreetmap.org/browse/relation/1375620

Offline

#6 2011-01-14 11:56:38

Re: Importing official administrative boundaries

dimka wrote:

Another option is to set up a WMS server. It's really easy with Geoserver, takes 10 minutes and works out of the box.  I have already done this on my local machine, unfortunately I am behind a firewall so it's no good for others.
Then you would point Potlatch to something like "http://localhost:8080/geoserver/wms?"

It seems that Potlatch doesn't support WMS, so that's not an option.

Offline

#7 2011-01-14 12:11:19

Re: Importing official administrative boundaries

talkat wrote:

Wow!!!
That's GREAT news!
Hopefully, this is only the first in many donations.

dimka wrote:

1) How to overlay? From my experience, the only feasible way to have this raster in JOSM is by installing a local WMS server and pointing JOSM to it. Importing the image directly into JOSM (via ImportImage plugin) eats up all the memory and eventually causes a crash.
I am still looking for a way to make the TIFF transparent.

There are several ways of doing it.
I think the easiest is to have it as a background, e.g. in Potlatch2.
Need to cut the whole image into 256x256 pixels squares, and align them.

The easiest is to decide on a zoom level, say 14, and look at some key tiles, and align according to them.

Then we need to name the tiles according to the standard (zoom level, x, y)
Actually, only one dimension. The other 2 are directories, or using underscores and put it all in the same directory.

And then it would be easy to have as a custom background.

talkat.

I'm now trying to generate tiles automatically using Geoserver. If successful, I will put them online.

Offline

#8 2011-01-14 12:25:59

Mr_Israel
Moderator
From: Israel, Germany
Registered: 2009-03-02
Posts: 505

Re: Importing official administrative boundaries

I would like to point again on the Palestine authority border issue:
=> http://forum.openstreetmap.org/viewtopic.php?id=8475

Please discuss there how to continue with that issue.
we have to solve that one day.

Offline

#9 2011-01-14 13:41:33

Re: Importing official administrative boundaries

dimka wrote:

I'm now trying to generate tiles automatically using Geoserver. If successful, I will put them online.

Good luck!

I can try and write some script that creates these tiles.
This script would be reusable if/when we get an updated version of this file.
I know this file change once in a while, when municipalities are formed or merged one into another.

If jpg/jgw combination is the standard, then we could use this script in future imports as well.

talkat.

Offline

#10 2011-01-14 15:03:08

Re: Importing official administrative boundaries

My biggest problem right now is: what is the naming scheme for tiles which Potlatch understands?
I managed to produce beautiful tiles which can be overlayed on Google Maps, but not in Potlatch.

Offline

#11 2011-01-14 17:08:23

Re: Importing official administrative boundaries

dimka wrote:

My biggest problem right now is: what is the naming scheme for tiles which Potlatch understands

Slippy map tilenames

talkat.

Offline

#12 2011-01-15 01:34:51

Re: Importing official administrative boundaries

OK, here goes:
set in Potlatch a custom background with the following:
http://www.wisdom.weizmann.ac.il/~dmitr … /!/!/!.png

You can also browse the whole thing via SlippyMap:
http://www.wisdom.weizmann.ac.il/~dmitr … ayers.html

I've generated up to zoomlevel 13 in the meanwhile, I will set up my laptop to generate L14 during the night :-)

Enjoy!

Offline

#13 2011-01-15 07:31:14

Re: Importing official administrative boundaries

dimka wrote:

OK, here goes:
set in Potlatch a custom background with the following:
http://www.wisdom.weizmann.ac.il/~dmitr … /!/!/!.png

You can also browse the whole thing via SlippyMap:
http://www.wisdom.weizmann.ac.il/~dmitr … ayers.html

I've generated up to zoomlevel 13 in the meanwhile, I will set up my laptop to generate L14 during the night :-)

Enjoy!

Wow! Thank you!

Here are the instructions for use in Potlatch2:

Click on the arrow next to "Background"
Click on the "Edit..." button. You'll get a "Background imagery" popup window.
Click on "Add" (bottom right), a new line will be added, and edit it as follows:

(new name) => MOIN (or any other name you like)
(new URL) => http://www.wisdom.weizmann.ac.il/~dmitr … /$x/$y.png

Close the window.

Now you can choose this background on the "Background" drop-down menu.

talkat.

Offline

#14 2011-01-15 12:16:15

Re: Importing official administrative boundaries

Now we also have zoom 14. Please tell me if you need more.

dimka

Last edited by dimka (2011-01-15 12:17:19)

Offline

#15 2011-01-15 14:18:42

Re: Importing official administrative boundaries

dimka wrote:

Now we also have zoom 14. Please tell me if you need more.

Zoom Level 14 is great. Thank you!

talkat.

Offline

#16 2011-01-19 04:39:50

balrog-kun
Super Senior Member
From: Warsaw, Poland
Registered: 2008-08-10
Posts: 1,211
Website

Re: Importing official administrative boundaries

I have played a little with automatic vectorising before and I decided to try my old vectoriser on the .jpg file with the borders.  The results are very bad, probably useless, but if you're curious, I have put up some files to look at:

http://openstreetmap.pl/balrog/borders-no-labels.png <-- this is the input bitmap I supply to the vectoriser, note that I filled all the labels with orange colour to avoid artifacts.

http://openstreetmap.pl/balrog/b0.osm <-- this is the result with orange colour treated like white.
http://openstreetmap.pl/balrog/b1.osm <-- this is the result with orange colour treated like blue.

These results are so bad because the parameters are adjusted for a different task (I had building outlines at very very high resolution, so the vectoriser ignores short segments, and tries to find right angles everywhere, even if there aren't any).  I will play with the parameters a little tomorrow, today I spent all the time trying to get the EPSG:2039 projection right.

Offline

#17 2011-01-19 08:24:51

Re: Importing official administrative boundaries

balrog-kun wrote:

I have played a little with automatic vectorising before and I decided to try my old vectoriser on the .jpg file with the borders.  The results are very bad, probably useless, but if you're curious, I have put up some files to look at:

http://openstreetmap.pl/balrog/borders-no-labels.png <-- this is the input bitmap I supply to the vectoriser, note that I filled all the labels with orange colour to avoid artifacts.

http://openstreetmap.pl/balrog/b0.osm <-- this is the result with orange colour treated like white.
http://openstreetmap.pl/balrog/b1.osm <-- this is the result with orange colour treated like blue.

These results are so bad because the parameters are adjusted for a different task (I had building outlines at very very high resolution, so the vectoriser ignores short segments, and tries to find right angles everywhere, even if there aren't any).  I will play with the parameters a little tomorrow, today I spent all the time trying to get the EPSG:2039 projection right.

Thank you very much for your effort! It would be interesting to compare your automatic results (when successful) with our manual tracing.

Offline

#18 2011-01-19 08:43:46

Re: Importing official administrative boundaries

dimka wrote:
balrog-kun wrote:

I have played a little with automatic vectorising before and I decided to try my old vectoriser on the .jpg file with the borders.  The results are very bad, probably useless, but if you're curious, I have put up some files to look at:

http://openstreetmap.pl/balrog/borders-no-labels.png <-- this is the input bitmap I supply to the vectoriser, note that I filled all the labels with orange colour to avoid artifacts.

http://openstreetmap.pl/balrog/b0.osm <-- this is the result with orange colour treated like white.
http://openstreetmap.pl/balrog/b1.osm <-- this is the result with orange colour treated like blue.

These results are so bad because the parameters are adjusted for a different task (I had building outlines at very very high resolution, so the vectoriser ignores short segments, and tries to find right angles everywhere, even if there aren't any).  I will play with the parameters a little tomorrow, today I spent all the time trying to get the EPSG:2039 projection right.

Thank you very much for your effort! It would be interesting to compare your automatic results (when successful) with our manual tracing.


Thank you balrog-kun!

Dimka, could you ask MOIN for an image file without the names?
Sometimes the names are in the way, like in Abu Gosh / Kiryat Yearim.
We could trace on the nameless file, and use the names from the named file, switching between the2 overlayes.

The nameless file could be used by balrog-kun to get better results.

talakt.

Offline

#19 2011-01-19 18:28:29

balrog-kun
Super Senior Member
From: Warsaw, Poland
Registered: 2008-08-10
Posts: 1,211
Website

Re: Importing official administrative boundaries

Thanks for your comments.

I now basically removed all of the building-related postprocessing and now the results are a little better, I don't think it's possible to do this better except for manual tracing.

Note that the blue lines have a width of 7 pixels, so they are polygons and it's difficult to calculate only the centrelines (I think it's impossible).

http://openstreetmap.pl/balrog/b2.osm <-- this is all of the blue lines traced.
http://openstreetmap.pl/balrog/b3.osm <-- same as above with a 3.5pixel offset added.
http://openstreetmap.pl/balrog/b4.osm <-- same with a -3.5px offset (the detection of "in" and "out" is not always working, so some shapes get offset in the wrong direction... in effect for some areas this file is better and in some areas the previous file is better)

Offline

#20 2011-02-07 11:13:30

Re: Importing official administrative boundaries

When the administrative borders run along streams (e.g. Beit Gamliel). What is more accurate, the borders based on the raster image you got, or the natural borders. And if the latter is true, should we correct them?

Offline

#21 2011-02-07 11:30:19

Re: Importing official administrative boundaries

valleyofdawn wrote:

When the administrative borders run along streams (e.g. Beit Gamliel). What is more accurate, the borders based on the raster image you got, or the natural borders. And if the latter is true, should we correct them?

AFAIK, officially, the raster image is more accurate.
When streams change course, it takes time for the MOIN to do new surveys and update the administrative borders. If at all...

talkat.

Offline

#22 2011-02-07 11:32:43

Re: Importing official administrative boundaries

valleyofdawn wrote:

When the administrative borders run along streams (e.g. Beit Gamliel). What is more accurate, the borders based on the raster image you got, or the natural borders. And if the latter is true, should we correct them?

The raster image is clearly off by a few meters in some obvious places (like border between two cities which should pass in the middle of a highway). The lines on the raster are too thick and in many cases an adjustment is needed based on common sense (for example when a city border is on top of a residential area clearly belonging to the city, the border should be adjusted to be just outside the area).
I don't know if the administrative borders are supposed to coincide with natural boundaries or just be parallel to them. I think that in case of streams it doesn't really matter.

Offline

#23 2011-04-11 06:34:57

Re: Importing official administrative boundaries

Hi guys, if you want to use a WMS like geoserver to use with Potlatch, you should
use a proxy available at http://whoots.mapwarper.net/
The use for geoserver will be something like:
http://whoots.mapwarper.net/tms/!/!/!/L … server/wms

Best regards from Chile

Offline

#24 2011-09-25 13:30:36

Re: Importing official administrative boundaries

Dimka I don't find the map of Israel gvulot_shiput_OSM.jpg on the website attached. From where I can download it?

Offline

#25 2011-09-25 22:07:14

Re: Importing official administrative boundaries

The files were deleted by accident.
I will reinstate them ASAP. Sorry!

dimka

Offline

Board footer

Powered by FluxBB 1.4.8
Hosting sponsored by Oxilion