Locus Map - forum

Content & Tools => Themes - Vector maps => Topic started by: Magellan on December 10, 2021, 12:06:34

Title: Inaccurate svg rasterization
Post by: Magellan 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

(http://images.vfl.ru/ii/1639133676/045e0efa/37044068_m.jpg) (http://vfl.ru/fotos/045e0efa37044068.html) (http://images.vfl.ru/ii/1639133676/a29529de/37044069_m.jpg) (http://vfl.ru/fotos/a29529de37044069.html)

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

(http://images.vfl.ru/ii/1639133676/cb9ab525/37044070_m.jpg) (http://vfl.ru/fotos/cb9ab52537044070.html)

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....)
Title: Re: Inaccurate svg rasterization
Post by: john_percy 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

Title: Re: Inaccurate svg rasterization
Post by: 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!
Title: Re: Inaccurate svg rasterization
Post by: Magellan on February 11, 2022, 21:26:36
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)
Title: Re: Inaccurate svg rasterization
Post by: michaelbechtold on February 11, 2022, 23:01:09
I would Locus make clean its caches. No guarantees, though.
Title: Re: Inaccurate svg rasterization
Post by: 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).
Title: Re: Inaccurate svg rasterization
Post by: Magellan on February 12, 2022, 08:24:22
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.
Title: Re: Inaccurate svg rasterization
Post by: john_percy 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.
Title: Re: Inaccurate svg rasterization
Post by: john_percy 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.
(https://uploads.tapatalk-cdn.com/20220218/c13a17634d1fc476f0c96faa69db2653.jpg)(https://uploads.tapatalk-cdn.com/20220218/5bf84612c85c8c0eab2d7420b1957e8a.jpg)(https://uploads.tapatalk-cdn.com/20220218/e9e5dd729f352cb566d5780e9f82a401.jpg)
Title: Re: Inaccurate svg rasterization
Post by: Menion on February 18, 2022, 14:10:32
Thanks for the reminder John. I believe I've got it. Check next Beta version please, thanks.
Title: Re: Inaccurate svg rasterization
Post by: john_percy on February 18, 2022, 19:44:57
Yes, now fine for me. Thanks!

Sent from my moto g(6) plus using Tapatalk