Inaccurate svg rasterization

Started by Magellan, December 10, 2021, 12:06:34

0 Members and 1 Guest are viewing this topic.

Magellan

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:
<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:

<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....)
  •  

john_percy

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

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  
    The following users thanked this post: Magellan

Menion

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 Release download
  •  
    The following users thanked this post: Magellan

Magellan

#3
Quote from: Menion 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!
Hi, Menion!
The problem with rasterization of difficult SVGs seems to be gone. But the map is like this:
(cache cleared)
  •  

michaelbechtold

I would Locus make clean its caches. No guarantees, though.
  •  

Menion

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 Release download
  •  

Magellan

#6
Quote from: Menion 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).
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.
  •  

john_percy

#7
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.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

john_percy

#8
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.

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Menion

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 Release download
  •  

john_percy

Yes, now fine for me. Thanks!

Sent from my moto g(6) plus using Tapatalk

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  
    The following users thanked this post: Menion