Author Topic: Inaccurate svg rasterization  (Read 1030 times)

Offline Magellan

  • More than Newbie
  • *
  • Posts: 46
  • Thanked: 53 times
    • View Profile
  • Device: Honor 8X (JSN-L21), Android 10
Inaccurate svg rasterization
« on: December 10, 2021, 12:06:34 »
Hi

I am replacing PNG to SVG graphics in one of the themes.
And I ran into the fact that Locus rasterizes some files inaccurately in the V3 version. For example, here is the petrol station icon in V3


but in the same Locus, but for 4+ maps, the same SVG - everything is fine:


in the Cruiser is also normal

SVG code:
Code: [Select]
<svg width="28" height="28" version="1.1" viewBox="0 0 7.4083 7.4083" xmlns="http://www.w3.org/2000/svg">
 <rect x=".26455" y=".2697" width="6.8792" height="6.8792" rx="1.0583" fill="#0042e8" stroke="#ffffff" stroke-width=".52917"/>
 <rect x=".26455" y=".2697" width="6.8792" height="6.8792" rx="1.0583" fill="#0042e8"/>
 <path d="m4.64884 2.544505 0.49355-0.0109v0.43681c0 0.2912 0.52914 0.5824 0.52914 0.8736v1.456c0 0.1456-0.14557 0.1456-0.14557 0.1456s-0.14563 0-0.14563-0.1456v-0.72801c0-0.1456-0.14557-0.2912-0.2912-0.2912-0.097049 0-0.44029 0.0109-0.44029 0.0109zm-2.654-0.94802h2.1046v1.3054h-2.1046zm-0.25813-0.50799c-0.16129 0-0.29117 0.12988-0.29117 0.29121v4.6592c0 0.1456 0.14555 0.2912 0.29117 0.2912h2.6209c0.1456 0 0.29123-0.1456 0.29123-0.2912v-1.456l0.29469-0.0109c0.14549-5e-3 0.1456 0.1456 0.1456 0.1456v0.58241c0 0.2912 0.14563 0.4368 0.43683 0.4368 0.29117 0 0.4368-0.1456 0.4368-0.4368v-1.6016c0-0.2912-0.52917-0.5824-0.52917-0.8736v-0.87361h-0.2912l-0.49355-0.28027v-0.2912c0-0.16133-0.12988-0.29121-0.29123-0.29121z" color="#000000" fill="#fcec00"/>
</svg>

Rule in theme V3:
Code: [Select]
<rule cat="tms_trans-priv" e="any" k="amenity" v="fuel">
<symbol priority="310" force-draw="1" id="s_trans-priv" src="file:/symbols/s_fuel.svg" symbol-width="12dp" />  <!-- был 2  symbol-height="16"  -->
<caption priority="250" symbol-id="s_trans-priv" cat="tms_land-names" k="name" dy="-12dp" font-style="bold" font-size="9dp" fill="#0036D9" stroke="#FFFFFF" stroke-width="2.0dp" />
</rule>

What can be done in this situation?

(changed sizes and padded, cleared the cache, no correct display....)
« Last Edit: December 10, 2021, 12:27:09 by Magellan »
 

Offline john_percy

  • Expert
  • Master of Locus
  • ****
  • Posts: 961
  • Thanked: 181 times
    • View Profile
  • Device: MotoG
Re: Inaccurate svg rasterization
« Reply #1 on: December 10, 2021, 13:08:16 »
It's the Simple SVG interpreter that has a limited instruction set. I don't know how to deal with this other than by trial and error but generally open the SVG file Inkscape, ungroup everything, convert all to paths, combine paths as far as possible, simplify paths, clean up the document and save as a simple SVG (not an Inkscape SVG). That seems to work but someone may give a better answer.

Sent from my moto g(6) plus using Tapatalk

 
The following users thanked this post: Magellan

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12823
  • Thanked: 952 times
  • Country: cz
    • View Profile
    • https://www.asamm.com
  • Device: Pixel 5, A12
Re: Inaccurate svg rasterization
« Reply #2 on: February 11, 2022, 15:56:37 »
Hi guys, I've just uploaded a new Beta version 4.6.1.1 for the test. It has a united SVG rendering engine across the whole app so all MapsForge versions and also Locus Map itself now use same system.

If possible, give it a try and let me know if all is now correctly rendered. Thank you!
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 
The following users thanked this post: Magellan

Offline Magellan

  • More than Newbie
  • *
  • Posts: 46
  • Thanked: 53 times
    • View Profile
  • Device: Honor 8X (JSN-L21), Android 10
Re: Inaccurate svg rasterization
« Reply #3 on: February 11, 2022, 21:26:36 »
Hi guys, I've just uploaded a new Beta version 4.6.1.1 for the test. It has a united SVG rendering engine across the whole app so all MapsForge versions and also Locus Map itself now use same system.

If possible, give it a try and let me know if all is now correctly rendered. Thank you!
Hi, Menion!
The problem with rasterization of difficult SVGs seems to be gone. But the map is like this:
(cache cleared)
« Last Edit: February 11, 2022, 21:30:00 by Magellan »
 

Offline michaelbechtold

  • Expert
  • Professor of Locus
  • *****
  • Posts: 1025
  • Thanked: 126 times
    • View Profile
Re: Inaccurate svg rasterization
« Reply #4 on: February 11, 2022, 23:01:09 »
I would Locus make clean its caches. No guarantees, though.
 

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12823
  • Thanked: 952 times
  • Country: cz
    • View Profile
    • https://www.asamm.com
  • Device: Pixel 5, A12
Re: Inaccurate svg rasterization
« Reply #5 on: February 12, 2022, 06:39:26 »
Hmm, interesting. I've downloaded your latest FzOAM_0_0_2 theme and see no problem. Am I testing the correct theme? Please try also the "Validate" option to check if your theme is correctly installed (long click on the theme in the list).
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 

Offline Magellan

  • More than Newbie
  • *
  • Posts: 46
  • Thanked: 53 times
    • View Profile
  • Device: Honor 8X (JSN-L21), Android 10
Re: Inaccurate svg rasterization
« Reply #6 on: February 12, 2022, 08:24:22 »
Hmm, interesting. I've downloaded your latest FzOAM_0_0_2 theme and see no problem. Am I testing the correct theme? Please try also the "Validate" option to check if your theme is correctly installed (long click on the theme in the list).
FzOAM_0_0_2 - for OAM V4+ and there are no problems with it. And it's not.. There were problems with SVG rasterization on maps V3 (lomaps) on third-party themes. Now, on beta version 4.6.1.1, with V4+ display everything is still fine, V3 is also displayed normally, except for empty tiles that appear randomly on different map zooms.

In the screenshot, two black svg icons (mailbox and post office) are visible in the magnifying glass, which were previously rasterized with an error. Now it rasterizes well. Also visible is the empty area at the bottom of the screenshot. Theme check says - Process successful

This problem occurs on all third-party themes (including Elevate LE and Voluntary LE) with lomaps.
« Last Edit: February 12, 2022, 08:38:21 by Magellan »
 

Offline john_percy

  • Expert
  • Master of Locus
  • ****
  • Posts: 961
  • Thanked: 181 times
    • View Profile
  • Device: MotoG
Re: Inaccurate svg rasterization
« Reply #7 on: February 12, 2022, 22:01:35 »
The same problem with missing tiles for LoMaps happens for me now. Built-in themes are ok, but not the external ones I have been using.

Edit: I'm pretty certain it's connected with SVG icons not being rendered. These are icons that were perfectly ok for both v3 and v4 maps previously. Also some of my SVG patterns for areas are being rendered as solid black now. I can give further details if needed.
« Last Edit: February 13, 2022, 01:02:32 by john_percy »
 

Offline john_percy

  • Expert
  • Master of Locus
  • ****
  • Posts: 961
  • Thanked: 181 times
    • View Profile
  • Device: MotoG
Re: Inaccurate svg rasterization
« Reply #8 on: February 18, 2022, 11:17:29 »
Any progress on this? Maybe it should be under a different heading as it's a serious rendering bug that's been introduced into Locus v4!
The screenshots show the same area with (a) LoMap & Voluntary theme (b) OAMap (same icons and fills) (c) LoMap internal theme
Note missing tiles and some SVG patterns rendered solid black in V3 maps.

« Last Edit: February 18, 2022, 11:43:33 by john_percy »
 

Offline Menion

  • Locus team
  • Professor of Locus
  • *****
  • Posts: 12823
  • Thanked: 952 times
  • Country: cz
    • View Profile
    • https://www.asamm.com
  • Device: Pixel 5, A12
Re: Inaccurate svg rasterization
« Reply #9 on: February 18, 2022, 14:10:32 »
Thanks for the reminder John. I believe I've got it. Check next Beta version please, thanks.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 final download
 

Offline john_percy

  • Expert
  • Master of Locus
  • ****
  • Posts: 961
  • Thanked: 181 times
    • View Profile
  • Device: MotoG
Re: Inaccurate svg rasterization
« Reply #10 on: February 18, 2022, 19:44:57 »
Yes, now fine for me. Thanks!

Sent from my moto g(6) plus using Tapatalk

 
The following users thanked this post: Menion