Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - karlchick

Pages: [1]
1
The OS Map theme tries to emulate the Ordnance Survey 1:25k and 1:50k map styles as closely as is possible within the constraints of Locus Map and data provided by the vector maps. It should work with both LoMap and OAM maps (v3 and v4). I must give credit to John Campbell for his Voluntary UK theme that I used as a starting point (v. 190101).

The OS Map theme also provides a darker variation of OS style of map designed for use at night-time to help avoid spoiling night-vision whilst keeping a recognizably Ordnance Survey style of map.

The theme now consists of four main theme files, day/night for v3 maps and day/night for v4 maps. There are two PDF map legends, one for day and one night.

Here is a comparison of the same map rendered with: Internal Theme, Voluntary UK, OS Style and my new 4 OS map styles:


SCROLL TO VIEW THE COMPARISONS >>>>

Here are the list of all the changes made for each release:

v20200427
Initial release for v3 maps only

v20200529
Added v4 map support
Added option to highlight toll roads (default is not highlighted). Highlight means orange outline and orange dots as you zoom in.
Added option to set OS style roads names (pathtext) for countires that are left hand traffic or right hand traffic. This is only applicable to dual carriage ways.
Added drawing of footpaths and bridleways that are on dashed track/service roads.
Added thicker dashed 1:50k style for airport runways (was using thinner 1:25k for 1:50k before)
Added defibrillator symbol (non OS symbols)
Added OS text symbols for: Libraries, Shelters, Cairns, Caves, Adits [Mines, Mines (dis)], Waterfalls (Falls in blue)
Added library buildings to list of important building, i.e bolder outlines.
Added place markers for towns/cities (similar to Elevate theme) at low zoom levels (e.g. 5-7).
Added support for sizing of town/city names based on population density (popcat)
Changed borders (admin_level) to improve support for non-UK counties by grouping togther Parishes=9/10, Districts=7/8, Counties=5/6, National=2/3/4
Changed pharmacy amenity symbol to also include chemist shops (non OS symbols).
Changed order of options, putting least changed options towards bottom of list.
Changed embankments to draw at a higher level priority to avoid them being overdrawn by water ways and residential areas.
Changed footbridges to draw at a higher level priority to avoid them being overdrawn by water ways.
Changed tunnels to use smaller dashes for better match OS map style.
Changed 1:50k trunk_link and motorway_link roads to use correct/matching outline widths on bridges.
Changed highway labels at zoom levels 7-12 to use captions instead of pathtext for OS labels
Changed priorities of several symbols to improve visibility of churches, information and museums at lower zoom levels.
Changed car parks at lower zoom levels (upto zoom 15) to only show ~|destination|customers|public car parks.
Changed hill name sizes slightly larger
Changed (corrected) selection of national hiking routes to only include iwn|nwn, i.e. remove rwn|lwn|uwn.
Changed (corrected) selection of national cycling routes to only include icn|ncn, i.e. remove rcn|lcn|ucn.
Changed (corrected) wells so they now get displayed.
Changed doctors captions from red to black text.
Changed v3 theme place names to match/harmonise to style used on v4 theme.
Removed tourism brown dashed ways accidentally left in from donor theme (UK Voluntary)
Removed access cross hatchings on footpaths accidentally left in from donor theme (UK Voluntary)
Removed surface dashes on 'white' roads accidentally left in from donor theme (UK Voluntary) - If this is going to be in the theme then I need to think about how to do it in an OS style way...

v20200530
Fixed validation errors (one was a real issue in V4 theme for railway stations at zoom 13, rest were technical errors but not impacting display of maps).

v20200607
Split v3 and v4 theme files into separate day and night theme files so they can have different map=background tags, different PDF legends and increase performance.
Added night mode symbols for transmitters, windmills, wind turbines, lighthouses, ruins/archaeological, battlefields, telephones, helipads, bollards.
Added night mode PDF legend.
Added four .lnk files to map the two PDF legends to relevant four theme files.
Changed priority of cemetery symbol lower than church symbol.
Changed night mode track core colour to match service/residential roads.
Changed night mode tunnels to use own night equivalent of day tunnel colours.
Changed night mode steps to look similar to day time steps and less like a ladder.
Changed night mode turning circles and passing places to be more visible.
Changed area ways for residential roads to match residential road outlines for all map themes.
Changed AED, playground and shooting symbols to remove white outline/background to match other symbols.
Changed 50k toilet synbol to fix errors in tiny-svg rendering.

Attached is a copy of the day time legend for the theme, but I can't attached the other legend or the theme ZIP because of the 2MB attachment limit of the forum... so I have placed all the versions of the theme onto google drive:

     OS Map Theme Releases

Link to latest release:

     OS Map v20200607.zip

Links to the OS Map Legends:

     OS Map Day Legend
     OS Map Night Legend

Install in the usual way of unzipping in Locus Map's _theme folder, e.g.:

\<root>\Android\data\menion.android.locus.pro\files\Locus\mapsVector\_themes

If you have already started using the earlier OS Map theme version then you probably should delete it before installing this updated version as it uses the same theme folder called "OS Map" but now uses four different named theme files - to cover day/night themes for v3/v4 maps.

Note that the legends are now included in the theme and can now be viewed directly from the theme menu in LM 3.46+ via a long press of the theme icon.
The following users thanked this post: menion, Leeds Tyke, balloni55, Andrew Heard, LocusUser#1, Viajero Perdido

2
Themes - Vector maps / How to check when layer is not selected?
« on: May 22, 2020, 18:19:38 »
Is there a way to use layer options and apply things based on both when the layer is selected and something else when the layer of NOT selected?

In my OS Map theme I have an option to display road labels similar to OS maps as path text along the side of the road. For single carriage roads this works fine for both left and right drive maps/counties.

However, for dual carriage ways I have used a DY setting for the path text that places the road labels to the left of the road for left hand drive maps/countries. In right hand maps/countries the offset is wrong and the road labels appear on the roads instead of to the side:



The left is UK left hand traffic and the right is Germany rigth hand traffic with labels in wrong place...

I thought I would use a layer option to allow you to indicate if you want right hand traffic or not... if not, then I assume left hand traffic. I would then use a positive or negative DY offset based on selected or not:



Anyone know if this is possible?
thanks
Karl.

PS: Yes that is a v4 map and yes the OS Map theme for v4 maps is very close to ready...
The following users thanked this post: Henk van der Spek

3
Versions / Re: [APP] - version 3.45.+ ( 14. 4. 2020 )
« on: May 18, 2020, 18:22:52 »
Just spotted this new development of linking PDF legends. I'm guessing that we can only have one legend PDF per theme (per locale). My OS Map theme contains two styles of maps, so has two legends. Attached is a PDF that combines both legends into a single PDF with a front page index with hyperlink to quickly jump the relevant legend section (Explorer 1:25k or Landranger 1:50k).

The map legend index list on front page are each clickable hyperlinks/shortcuts to relevant legends. But not all PDF viewers support links in PDFs... Acrobat does on Android works fine though...

Karl.

Update: I've joined the beta release scheme, downloading latest...  Yay! It works!

Not so keen on the overlayed green icon indicator blocking the theme logo, I could change the os map thene logo to better suit the indicator... maybe
The following users thanked this post: Andrew Heard, Joska

4
Themes - Vector maps / Re: [Theme] Voluntary UK
« on: May 10, 2020, 17:32:56 »
Screenshots of selected areas, tidied up and cropped in Paint.net, Word document output to pdf. I wish there was an easier way.

I used PowerPoint set to A4 portrait and save to PDF. PowerPoint is so much easier to create graphically rich content.

What would be  really cool is if someone could create a small map that is actually a legend built with all the supported ways and nodes, then you would have a legend built that works with all themes.
The following users thanked this post: Andrew Heard, poutnikl

5
In the following post I used a script to semi-automatically convert the Waymark-V2a LoMap theme to be compatible with the MF v4 map theme renderer, i.e. so it would "work" with v4 maps:

https://forum.locusmap.eu/index.php?topic=6948.msg59452#msg59452

I used the Waymark-V2a theme purely as a test of the script as it is quite a large theme file, and it "worked" with v4 maps, in so much that it is displayed something. However it was pointed out that it didn't display the hiking trails, cycle routes or waymark symbols.

I started to look at why and realised that the Waymark-V2a theme was developed purely for Locus Map maps and did not appear to support OAMaps. I have made some further tweaks to the converted version from the link above and got the cycleways, hiking routes and waymarks to display now. You can also select/deselect the hiking/cycle routes. However, I do not think it will be possible to deselect waymark symbols for specific OSMC colour routes. For now, the theme only switches on/off all waymark symbols. Also not finding a way to not show trails when waymark routes are selected - other than overdraw the trails, but the route labels still show... so I left it alone for now).

I've not packaged it up into a ZIP with all the resources yet, because it is really just an experimental theme at this stage which will require some more testing/feedback, especially considering the original is set up for LoMap tags and not OAMap tags. There will probably be many other missing items for this reason. Probably a Waymark-V2a user will spot them very quickly!

To try it you will need to have the Waymark-V2a theme already installed and also a v4 map that supports OSMC waymarks (the UK maps I use do not).

You just need to copy the attached Waymark-V4a.xml and Waymark-V4a.png files into the same directory as the original Waymark-V2a.xml theme file is stored (will depend on where you chose to install Locus Maps I suspect).  Will be something like:

/storage/6345-6342/Android/data/menion.android.locus.pro/files/Locus/mapsVector/_themes/Waymark-V2a/
/storage/emulated/0/Android/data/menion.android.locus.pro/files/Locus/mapsVector/_themes/Waymark-V2a/

I'm wondering if there is any point using the Waymark theme, now that Elevate 4 supports Waymarks...
The following users thanked this post: Magellan, poutnikl

6
Another candidate is the Waymark v2a theme.

In another post I provided an example of using a script to semi-automatically convert outdoor and Waymark v2a locus map v3 map themes into v4 map themes for locus map. Here is a link to the post:

https://forum.locusmap.eu/index.php?topic=6948.msg59452#msg59452

I hope ManfredG doesn't mind me using his Waymark-v2a theme as a guinea-pig. It might not work perfectly in v4 maps and certainly hasn't been checked rigorously. But it would probably make a good starting for point for creating a v4 map version of the Waymark-v2a theme... But note, it is a very large theme consisting of over 8700 lines!   
The following users thanked this post: poutnikl

7
If you wish to try out any of these converted themes, you should be able to copy the v4 xml file into the directory containing the original v3 theme file, if you are using the latest version of Locus Map as this now seems to support multiple theme files in the same directory. 

If you really want to use the converted theme and want the same icon, you could create a copy of the PNG icon file with the same name as the v4 theme.
The following users thanked this post: Andrew Heard

8
Here is an example of adding customization code to the script. I used the Outdoor theme from locus store which works with v3 maps because it is a very small and simple theme (only 1400 lines).

In the customisation section of the script is uses the keys and values of rules in the theme to isolate and apply specific modifications to certain tags and their attributes, e.g.:

      if inscope(current_keys, "highway") then
         if current(current_vals) = "motorway_junction" then
            if current_tag = "circle" then
               line = update_tag(line, "r", 1.5, 0)
               line = update_tag(line, "stroke-width", 2, 0)
            end if
            if current_tag = "caption" then
               line = update_tag(line, "font-size", 1, 3)
               if instr(line,"caption k="+Chr(34)+"addr:housenumber"+Chr(34)) > 0 then
                  line = update_tag(line, "dy", 0, 0)
               end if
            end if
         end if
      end if


This looks for lines of the theme that are in scope of k="highway" v="motorway_junction" and then tweaks:
   - the circle's radius and stroke-width
   - its caption's  font-size and dy offset (but only for addr:housenumbers captions).

Here is the theme content before from v3:

<!-- highway exits -->
<rule e="node" k="highway" v="motorway_junction" zoom-min="11" zoom-max="13">
   <circle r="6" scale-radius="false" fill="#dFdFFF" stroke="#FF0000" stroke-width="2.0"/>
</rule>
<rule e="node" k="highway" v="motorway_junction" zoom-min="14">
   <circle r="6" scale-radius="true" fill="#dFdFFF" stroke="#FF0000" stroke-width="1.2"/>
   <caption k="addr:housenumber" display="always" dx="-2" dy="10" priority="95" font-style="bold" font-size="6dp" fill="#FF0000" stroke="#FFFF00" stroke-width="1.2dp" scale-font-size="14,1.3"/>
   <caption k="name" display="always" dy="-14dp" scale-dy-size="16,1.2" font-style="bold" font-size="7dp" fill="#0100C8" stroke="#FFFFFF" stroke-width="1.2dp" scale-font-size="14,1.3"/>
</rule>


and after in the converted v4 version:

<!-- highway exits -->
<rule e="node" k="highway" v="motorway_junction" zoom-min="10" zoom-max="12">
   <circle r="2.7" scale-radius="false" fill="#dFdFFF" stroke="#FF0000" stroke-width="0.9"/>
</rule>
<rule e="node" k="highway" v="motorway_junction" zoom-min="13">
   <circle r="2.7" scale-radius="true" fill="#dFdFFF" stroke="#FF0000" stroke-width="0.54"/>
   <caption k="addr:housenumber" display="always" dy="0" priority="95" font-style="bold" font-size="9" fill="#FF0000" stroke="#FFFF00" stroke-width="1.08" />
   <caption k="name" display="always" dy="-14" font-style="bold" font-size="10" fill="#0100C8" stroke="#FFFFFF" stroke-width="1.08" />
</rule>


I should point out that the stroke-width of circles also have a scale of 0.9 and 0.25 applied to it elsewhere in the script, hence 2 * 0.9 * 0.25 * 2 = 0.9. As you can guess, I was just applying correction by trial error until things looked reasonable...

Note the parameters for update_tag are:
   - update_tag( line, tag_name, scale, offset )
and it applies a scale and offset to numerical tag values. E.g. The following line:

         line = update_tag(line, "font-size", 2, -4)

when applied to the following theme line:

   <pathText k="name" font-style="bold" font-size="9" fill="#606060" stroke="#ffffff" stroke-width="2.0"/>

will result in the font-size being processed as:  new-font-size = (old-font-size * 2) - 4 = 14. i.e.:

   <pathText k="name" font-style="bold" font-size="14" fill="#606060" stroke="#ffffff" stroke-width="2.0"/>.

The script has a variable called "zoom_offset" which is set to -1 in this example. It subtracts 1 from all the zoom-min and zoom-max values to readjust the v4 converted theme to look similar in scales as the original v3 theme. Of course, if there are map elements that appear at zoom level 14, the will not appear at zoom level 13 in the v4 map.

The screenshots show the original v3 Outdoor theme, converted to v4 theme and the original OutdoorV4 theme.



I'm posting the converted outdoor theme only as an example of what the script can do. I haven't checked it extensively and you are probably better off using the official OutdoorV4 theme.
The following users thanked this post: jonny.blue

9
Attached is the Waymark-V2a theme in two forms:
   - Waymark-V4.xml is converted using the attached version of the v3_to_v4_Waymark.vbs script.
   - Waymark-V4a.xml is after some manual tweaks, read on...
 
the V4 of the theme is straight out of the script from V2a, with just one customisation to correct a syntax error:

      line = replace_text(line, "case="+Chr(34), "cat="+Chr(34) )

In the screenshots you can see that V4 has a rendering problem with service|raceway roads. I fixed this manually in V4a.



The script pseudo-converts the v3 extensions for rectangle captions using a thick outlined caption, as these are not supported in v4 mapsforge rendering engine.

The other thing you'll notice is when you switch to a v4 map the zoom level is out by 1, and you can see that some items that render at Z16, do not render at Z15, hence screenshot 4 shows them appearing as you zoom in to Z16.

Note that I have not checked if everything else in the theme works or not. But it probably is a good starting point now for getting a v4 map version of the Waymark-V2a theme working, if required.
The following users thanked this post: Viajero Perdido, poutnikl

10
At the moment I'm converting my OS Map theme from v3 to v4. I have been finding the process very mechanical and repetitive, so much so that once I I done around 2,500 lines out of 10,000 lines by hand I decided to quick put together a script to do most of the changes programatically. 

Attached is a VBScipt that does most of the changes required to convert a v3 theme to v4.

I quickly discovered that  v4 render engine is very intolerant to syntax errors and if any are present it will refuse to display anything. This means manually removing parts of the generated v4 theme until it works and locating the syntax error. The following are some examples of errors I found in several themes:
   - stroke-width="1.2p"
   - <rule case="off_pl"
   - close="yes"  (should be closed="yes")

I have converted the following themes using the script, in some cases requiring some additional custom mods:
   - OS Map
   - Outdoor (because it is small, simple and already has a v4 theme to compare with)
   - Waymark2a

I would consider the output of the script as a starting point only and not a final theme. In some cases it is possible to tweak the theme using the script, see the Outdoor script for an example. In some cases there are differences that have to manually changed in the generated theme. Waymark2a is an example of this, seems the v4 rendering in LoMaps has a bug, the following puts green dashes on service roads as well as raceways:

<rule e="way" k="highway" v="service|raceway" zoom-min="14">
   <line stroke="#ffffff" stroke-width="0.81" />
   <rule e="way" k="highway" v="raceway" zoom-min="14">
      <line stroke="#a5cba5" stroke-width="0.54" scale="all" stroke-dasharray="1,1" stroke-linecap="butt" />
   </rule>
   :


so I had to manually separate service and raceway rules to fix this:

<!-- service raceway -->
<rule e="way" k="highway" v="service" zoom-min="14">
   <line stroke="#ffffff" stroke-width="0.81" />
   :
<rule e="way" k="highway" v="raceway" zoom-min="14">
   <line stroke="#ffffff" stroke-width="0.81" />
   <line stroke="#a5cba5" stroke-width="0.54" scale="all" stroke-dasharray="1,1" stroke-linecap="butt" />
   :
 


I'll add the converted Outdoor and Waymark example themes in the next few posts. I'm using the initial conversion of my OS Map theme as a starting point for a v4 OS Map theme. I'm about 50% complete so far, but am battling with lack of symbol and text scaling in v4...

Please note that this script is a quick hack, there are probably better ways using XML libraries to do this... It does no error checking and you'll probably need to modify it for best results. It is a visual basic script and should work on a Windows command line using the following command line syntax:

     cscript v3_to_v4.vbs <v3 rendertheme>.xml <v4 rendertheme>.xml

Where:

        v3_to_v4.vbs                 -- Name of this script
        <v3 rendertheme>.xml         -- Input file that is a v3 rendertheme file, e.g. VoluntaryV3.xml
        <v4 rendertheme>.xml         -- Output file to be created as a v4 rendertheme file, e.g. VoluntaryV4.xml


Just putting this out there in case it is useful to other theme writers. It isn't really suitable for most people to use, but anyone with a basic understanding of visual basic and renderthemes should be OK.
I would check the examples in the following posts for examples of how to use the custom coding section and supporting functions...

Karl.
The following users thanked this post: Magellan

11
Themes - Vector maps / Re: [Theme] OS Map (v3 maps)
« on: April 20, 2020, 14:24:21 »
I've started porting the theme into a version for v4 maps. It is going well so far, I am transferring section by section.  However, the OS Map theme makes extensive use of many v3 locus extended rendering options that are not supported in v4, so i do not think the v4 version will be as good as the v3 version.  Missing the ability for dash arrays to scale up as you zoom in. This will affect a lot of the theme elements that make it similar to OS maps.
The following users thanked this post: tapio, Andrew Heard

12
Themes - Vector maps / Re: [Theme] OS Map (v3 maps)
« on: April 19, 2020, 19:49:23 »
For me I am also missing the names of the hiking trails like E3 and GR5.
And also please put a .nomedia  file in your directories :) otherwise my Gallery App is flooded.  :)

I've replaced the theme with an updated version that now contains .nomedia files. I had them in there originally, but got over zealous deleting unused files before posting.

The hiking trails by default do not display their name labels (CW) but rather their full textual names (Cotswold Way). This is to be as compliant with Ordnance Survey's own maps. I have noticed that most non-LoMaps do not support this full name text of hiking trails, so I have included support for displaying the hiking trail labels, these are enabled by selecting the overlay "non-OS symbols" - you'll see in the Legends that all the non-OS symbols have a little 'cross' symbol next to them and a foot-note that tells you which overlay option selects them.

Hope that helps, Karl.
The following users thanked this post: Henk van der Spek

13
Themes - Vector maps / Re: [Theme] OS Map
« on: April 19, 2020, 12:56:56 »
Hmm... I'm now wondering if I am actually using v3 maps after all... You are correct, all the v4 maps I tried do not work with OS Map theme.... I've started to look into it, seems v4 maps are handled differently in Locus Map from v3. I looked at how Velocity works for v3 and v4 and I got OS Map to be selectable for v4 maps but it displays nothing so far, seems I need would need create a new theme for v4 maps using different scalings/sizes etc... quite a bit of work.  Note Velocity is supporting v4 with a completely different theme with the same name...

For now I would suggest that this theme is for v3 maps only (I changed the post's title to reflect this too). I will look to see if I can get a v4 version working, but I suspect this may take some time. If anyone has any tips of converting v3 theme to v4 theme I would be glad to hear. Seems the zoom levels are reduced by 2 and line thicknesses are narrower and not using "dp" values...

Update: Found this might be useful: http://www.maiwolf.de/locus/
Update: Also found: https://www.openandromaps.org/en/oam-forums/topic/mapsforge-rendertheme-reference

Karl.
The following users thanked this post: Henk van der Spek

14
Themes - Vector maps / [Theme] OS Map (v20200427 for v3 maps only)
« on: April 19, 2020, 01:38:58 »
Having used UK Ordnance Survey (OS) maps all my life, when I started using Locus Map I was desperate for a map theme that looked similar. After using both Voluntary UK and OS Style themes for a while, I still hankered after something closer to the style of the original UK OS maps. So I decided to create my own theme that tries to emulate the Ordnance Survey 1:25k and 1:50k map styles as closely as is possible within the constraints of Locus Map and data provided by the vector maps. It should work with both LoMap and OAM maps. I must give credit to John Campbell for his Voluntary UK theme that I used as a starting point (v. 190101).

There are 6 maps styles provided in the theme:
  • Explorer 1:25k
  • Landranger 1:50k
  • Dynamic Scale
  • Night Mode 1:25k
  • Night Mode 1:50k
  • Night Mode Dynamic
Dynamic Scale automatically switches from 50k to 25k at zoom level 16.
Night Modes provide a darker colour scheme for night usage that preserve the OS colour, but muted a bit. I don't like the built in night mode as it inverts all the colours.

There are also several overlay options:
  • non-OS  symbols
  • non-OS road furniture
  • demanding paths
  • hiking routes, national
  • hiking routes, local
  • emphasise hiking routes
  • cycling routes, national
  • cycling routes, local
  • emphasise cycle routes
  • fill in residential areas
  • grow 50k buildings into town masses
  • emphasise land access
  • OS style road labels
  • level road labels
  • boxed road labels
I used google translate to define the translations, so let me know if there are more appropriate translations.

I also created PDF legends for the 25k and 50k themes to show what is supported/different using a similar style to the original OS legends with screenshots from Locus Map and the theme's own symbols etc.

Last attachment is a ZIP of the theme. (now with .nomedia files, thanks Henk van der Spek for pointing that out).

Install in the usual way of unzipping in Locus Map's _theme folder, e.g.:

\<root>\Android\data\menion.android.locus.pro\files\Locus\mapsVector\_themes

I've only tried this on my phone (Samsung Galaxy A3) and tablet (Samsung Galaxy Note 10.1 2014). It is quite a big theme file now (~10,000 lines)  because it contains so many different categories and overlay options. I am interested to know if it works OK for everyone. I have considered creating a "lite" 25k only option to see it is works faster or not...

I am putting this theme out there as I feel it might be of interest to others. It is provided as is.
I am not inclined to spend a lot of time working on it, but you are welcome to modify it for your own purposes.

Let me know if there some major problems with the theme.

Here is a comparison of the same map rendered with: Internal Theme, Voluntary UK, OS Style and my new 4 OS map styles (also attached as ThemePreviews_LORES.jpg but lower resolution):


USE SCROLL BAR TO VIEW THE REST >>>>

UPDATE 2020.04.27
I have fixed:
   - couple of  mistakes in the legends
   - added to the legends some additional overlay footer notes.
   - country borders to include admin_levels 2, 3 and 4 now.
   - rounded locks in rivers now square
   - some syntax errors I found during porting to v4 (which is now about 50% completed).

I've updated the attachments with new versions, hence their counters are reset.

Pages: [1]