Inconsistent map level when using OkMap and OruxmapDesktop to generate maps

Started by Breto, June 27, 2020, 08:00:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Breto

Hi,

Here is the flow I use to generate offline OruxMaps maps:
- I generate a high resolution png image from a an online map website with a script,
- I use OkMap v14.12.3 to geolocalize the map and save the data in a .map file (OziExplorer format), knowing the coordinate of two points and the projection.
- Then I use OkMap and OruxmapDesktop to generate the Oruxmap map.

With the first map, I got level 15 with OruxmapDesktop and level 14 with OkMap. I then zoom twice on the website and generate another png image, it is too large for OruxmapDesktop and I get level 16 with OKmap (14+2 as expected). I then crop a small part of that second image, and I get level 17 maps both with Oruxmapdesktop and OkMap.

Back to the first map, I compared the xml files:

** OruxmapDesktop **
<?xml version="1.0" encoding="UTF-8"?>
<OruxTracker xmlns:orux="http://oruxtracker.com/app/res/calibration"
versionCode="3.0">
<MapCalibration layers="true" layerLevel="0">
<MapName><![CDATA[Corse_zoom_15]]></MapName>
<OruxTracker versionCode="2.1">
<MapCalibration layers="false" layerLevel="15">
<MapName><![CDATA[Corse_zoom_15 15]]></MapName>
<MapChunks xMax="26" yMax="55" datum="WGS 1984:Global Definition@WGS 1984:Global Definition" projection="Mercator,0.0" img_height="512" img_width="512" file_name="Corse_zoom_15 15" />
<MapDimensions height="27845" width="12988" />
<MapBounds minLat="41.265568103787" maxLat="43.0367246591817" minLon="8.49274408839779" maxLon="9.60644714917127" />
<CalibrationPoints>
<CalibrationPoint corner="TL" lon="8.49274408839779" lat="43.0367246591817" />
<CalibrationPoint corner="BR" lon="9.60644714917127" lat="41.265568103787" />
<CalibrationPoint corner="TR" lon="9.60644714917127" lat="43.0367246591817" />
<CalibrationPoint corner="BL" lon="8.49274408839779" lat="41.265568103787" />
</CalibrationPoints>
</MapCalibration>
</OruxTracker>
</MapCalibration>
</OruxTracker>

** OkMap **
<?xml version="1.0" encoding="UTF-8"?>
<OruxTracker versionCode="3.0" xmlns="http://oruxtracker.com/app/res/calibration">
  <MapCalibration layers="true" layerLevel="0">
    <MapName><![CDATA[Corse_zoom_15]]></MapName>
    <OruxTracker versionCode="2.1" xmlns="http://oruxtracker.com/app/res/calibration">
      <MapCalibration layers="false" layerLevel="14">
        <MapName><![CDATA[Corse_zoom_15 14]]></MapName>
        <MapChunks xMax="26" yMax="55" datum="WGS 1984:Global Definition@WGS 1984:Global Definition" projection="Mercator,0" img_height="512" img_width="512" file_name="Corse_zoom_15 14" />
        <MapDimensions height="27845" width="12988" />
        <MapBounds minLat="41.265568103787" maxLat="43.0367246591817" minLon="8.49274408839779" maxLon="9.60644714917127" />
        <CalibrationPoints>
          <CalibrationPoint corner="TL" lon="8.49274408839779" lat="43.0367246591817" />
          <CalibrationPoint corner="BR" lon="9.60644714917127" lat="41.265568103787" />
          <CalibrationPoint corner="TR" lon="9.60644714917127" lat="43.0367246591817" />
          <CalibrationPoint corner="BL" lon="8.49274408839779" lat="41.265568103787" />
        </CalibrationPoints>
      </MapCalibration>
    </OruxTracker>
  </MapCalibration>
</OruxTracker>

It's remarkable that resolution, tile size and number of tiles are the same in both files, but not the zoom level. Why is that? How do I get the right level when generating the map with OkMap? Why did I get a higher zoom level on a crop image with OkMap?

Breto

I investigated a bit more this issue. The source website is using Mercator WGS84 epsg:3857 projection, same zoom definition as Oruxmaps, so it's easy to find out the source zoom level. It was 14 (9.55 m/pix at equator).

In Oruxmaps, when zooming in multiple time from a correct level 12 maps:

- with level 14 map: 12@100%, 12@200% (distance increase by 2x), switch to map level 14@100% (distance increase by 2x) => correct behavior
- with (incorrect) level 15 map: 12@100%, 12@200% (distance increase by 2x), 12%400% (distance increase by 2x), switch to map level 15@100% (distance remain the same => is actually level 14 but reported as zoom level 15)

So although the map is set at level 15, it is displayed like a level 14 map. It's however sometimes confusing Oruxmaps when toggling to lower or higher zoom level maps.

As a side note, I checked that all maps are correctly geolocalized in Oruxmaps.

Conclusion, it seems that both OruxmapDesktop and OkMap are sometimes not picking up the right zoom level although the map is already exactly rasterized at a given zoom level as the source website is using the same projection and zoom level definition. Am I doing something wrong?

Breto

Nobody has any hint or trick to get the right zoom level?

Like forcing something in OKMap, or changing format...

Or fixing it in the file after correction?