logo separator

[mkgmap-dev] Finding administrative areas

From Roger Calvert roger at rogercalvert.me.uk on Tue Aug 7 13:40:18 BST 2012

I have been unable to make this work. I have copied all the admin_level 
rules from the default style files into my style, and introduced 
pre-compiled bounds. Using mkgmap r2130 and Wanmil's sample rule (as 
below),  I always get a java exception (below). I have tried various 
variants on the rule and various data sets, with no differences.

Advice welcomed!

Thanks,

Roger
> java.util.EmptyStackException
>         at java.util.Stack.peek(Unknown Source)
>         at java.util.Stack.pop(Unknown Source)
>         at 
> uk.me.parabola.mkgmap.osmstyle.eval.ExpressionReader.runOp(Expression
> Reader.java:131)
>         at 
> uk.me.parabola.mkgmap.osmstyle.eval.ExpressionReader.readConditions(E
> xpressionReader.java:49)
>         at 
> uk.me.parabola.mkgmap.osmstyle.RuleFileReader.load(RuleFileReader.jav
> a:83)
>         at 
> uk.me.parabola.mkgmap.osmstyle.RuleFileReader.load(RuleFileReader.jav
> a:70)
>         at 
> uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:312
> )
>         at 
> uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:146)
>         at 
> uk.me.parabola.mkgmap.reader.osm.RelationStyleHook.init(RelationStyle
> Hook.java:47)
>         at 
> uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.pluginChain(OsmMapD
> ataSource.java:163)
>         at 
> uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.setupHandler(OsmMap
> DataSource.java:131)
>         at 
> uk.me.parabola.mkgmap.reader.osm.bin.OsmBinMapDataSource.load(OsmBinM
> apDataSource.java:56)
>         at 
> uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:144)
>         at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:56)
>         at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:206)
>         at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:203)
>         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>         at java.util.concurrent.FutureTask.run(Unknown Source)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
> )
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
> Source)
>         at java.lang.Thread.run(Unknown Source)
> Exiting - if you want to carry on regardless, use the --keep-going option
>
> -- 
> ------------------------------------------------------------------------

On 29/07/2012 15:58, WanMil wrote:
> Hi Roger,
>
> you can do that by using the precompiled bounds. The style file already
> contains rules to assign the country/region/city information. You can
> use similar rules for your purpose, e.g.:
>
> mkgmap:admin_level6=Cumbria && highway=primary { set highway=secondary }
>
> This example works only if you use the precompiled bounds. Read step 4
> of http://wiki.openstreetmap.org/wiki/Mkgmap/help/How_to_create_a_map
> how to use them.
>
> WanMil
>
>> A bit of advice, please, if anyone can help.
>>
>> How can one obtain information on the administrative area (e.g. county)
>> an object is in in the style files? For example, I would like to find
>> out if an object is in Cumbria or Lancashire.
>>
>> Some objects have "is_in" tags, but most do not. Such information should
>> be accessible from the surrounding boundaries. Can I access this
>> information in a style file?
>>
>> Thanks,
>>
>> Roger
>> --
>> ------------------------------------------------------------------------
>>
>> Roger Calvert
>> ------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> mkgmap-dev mailing list
>> mkgmap-dev at lists.mkgmap.org.uk
>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>
>

-- 
------------------------------------------------------------------------

Roger Calvert
------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20120807/61c0e225/attachment.html 


More information about the mkgmap-dev mailing list