logo separator

[mkgmap-dev] How to display administrative boundaries / shade them?

From Gerd Petermann gpetermann_muenchen at hotmail.com on Wed Jan 19 07:20:25 GMT 2022

Hi all,

see file in https://files.mkgmap.org.uk/detail/545

I think the file is a valid OSM file. JOSM doesn't open it because the meta data is missing, but that can be fixed with osmconvert:
osmconvert conyers.osm --fake-version -o=conyers-fake.osm

However, this doesn't help for mkgmap.
The current implementation of the osm data readers (*.osm *.o5m or *.pbf) in mkgmap cannot handle files where relations appear
before the way or node members of the relation. The effect is that the relation is ignored.
I've uploaded a modified version which shows the expected order: https://files.mkgmap.org.uk/detail/546

I don't know how much work it would be to support this rather special file format. We already have code to handle relations which refer to relations that
were not yet read, I guess it would require similar code for node members and way members.

Let me know if you think this should be done or even better: post a patch ;)

@Craig:
I don't know what exactly you want to do. Normally mkgmap processes rectangular tiles containing all the OSM data for that area.
Such a tile would contain various boundary=administrative relations or ways. Of course it makes no sense to render 0x07 polygons
for all those boundary=administrative objects. You would end up with a huge amount of overlapping 0x07 polygons covering
all of your map.

Gerd





________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen at hotmail.com>
Gesendet: Dienstag, 18. Januar 2022 22:04
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] How to display administrative boundaries /    shade   them?

Hi Craig,

try this overpass query
(
rel(id: 119584);
>>;
);
out;

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Craig Durkin <craigdurkin at gmail.com>
Gesendet: Dienstag, 18. Januar 2022 21:39
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] How to display administrative boundaries / shade      them?

Oh interesting, I wonder what the size difference is. I just uploaded my version of the relation to https://files.mkgmap.org.uk/detail/545 -- it's 159.499 bytes, but it looks complete to me: it has the relation tags with member way references, the constituent nodes (with latitude/longitude), the ways themselves with node references, and tags for everything.

I created it by running the following query on Overpass Turbo (https://overpass-turbo.eu ):
rel(id: 119584);
out body;
>;
out skel qt;

Thanks!
Craig

>From Gerd Petermann gpetermann_muenchen at hotmail.com <mailto:mkgmap-dev%40lists.mkgmap.org.uk?Subject=Re:%20Re%3A%20%5Bmkgmap-dev%5D%20How%20to%20display%20administrative%20boundaries%20/%0A%09shade%09them%3F&In-Reply-To=%3CAM0PR08MB54102C8A6DFD61494B89BF0E9E589%40AM0PR08MB5410.eurprd08.prod.outlook.com%3E> on Tue Jan 18 20:05:16 GMT 2022

Hi Craig,

it works for me when data.osm contains the complete relation. I just downloaded just that relation with all its members in JOSM
and the file has 359.898 bytes.
What's the content of your data.osm?
Maybe upload it to https://files.mkgmap.org.uk/

Gerd
 -

On Tue, Jan 18, 2022 at 2:30 PM Craig Durkin <craigdurkin at gmail.com<mailto:craigdurkin at gmail.com>> wrote:
That's what I would have thought too, but no luck. It seems like the "polygons" file maybe only deals with closed ways and not specifically relations?

For what it's worth, my program is invoked with:

java -jar mkgmap-r4586/mkgmap.jar --gmapsupp --gmapi --transparent --output-dir=gmap_output --style-file=mkgmap-r4586/new_style/ data.osm

and the 'polygons' file in new_style/polygons has the following line in it:
boundary=administrative [0x07 resolution 20]

Craig

>From Gerd Petermann gpetermann_muenchen at hotmail.com <mailto:mkgmap-dev%40lists.mkgmap.org.uk?Subject=Re:%20Re%3A%20%5Bmkgmap-dev%5D%20How%20to%20display%20administrative%20boundaries%20/%20shade%0A%20them%3F&In-Reply-To=%3CAM0PR08MB541016A276CDB396533304559E589%40AM0PR08MB5410.eurprd08.prod.outlook.com%3E> on Tue Jan 18 18:41:33 GMT 2022

Hi Craig,

I think all you need is a rule in style file polygons to render the object.

Gerd

On Tue, Jan 18, 2022 at 1:33 PM Craig Durkin <craigdurkin at gmail.com<mailto:craigdurkin at gmail.com>> wrote:
Hi mkgmap folks -- sorry if this is kind of a beginning question, but I can't for the life of me figure out how to get administrative boundaries (or really any arbitrary polygon) to display with mkgmap. Ideally I'd be able to lightly shade the inside of the boundary polygon, but even displaying the polygon is eluding me.

An example OSM relation that I'm trying to display is Conyers, GA, USA relation ID 119584.

I understand that there might be editing necessary to the style files, but it's not really clear: do I edit relations, lines, or polygons? Or all 3?

Can anyone offer any tips?

Thanks,
Craig
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list