The support forum is temporarily read-only. For urgent requests, please email contact[at]psyberia.net

[closed] Problem: aqx file for unusual wms tile server not working

Any question about the app? Ask it here
Post Reply
Jochem
Posts: 15
Joined: Wed Oct 09, 2019 6:36 am

[closed] Problem: aqx file for unusual wms tile server not working

Post by Jochem »

Hi,

I've been using the app for some time, but only recently found out the power of adding maps with aqx files. I love it. I added a few normal ZXY and WMS tile servers, which was quite easy.

Now I am trying a more challenging WMS tile server. The problem with this tile server is that it only produces tiles of 200 by 200 pixels and 2 by 2 km. Moreover, the bbox expects NW and SE corners in projected coordinates rounded to even kilometres.

Unformunately, the tile server isn't public, therefore I can't share the URL and I'll use another normal tile server to simulate the problem with the aqx file below.

In the a aqx file I tried some additional settings in two different ways. The first is only producing empty tiles, the second gives an offset (for the non-public tile server), which I can't fix as it seems to ignore the projection-offset parameter. Any ideas why and how to fix it?

Kind regards, Jochem

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<aqx version="9">
  <name>a test</name>
  <source id="MAP01">
    <name>1st Test 1:50 000</name>
    <zoom-levels z="14">
      
      <projection-code>EPSG:28992</projection-code>
      <projection-resolution>10</projection-resolution>
      <tiles-size>200</tiles-size>
      <expression set="x2" type="int">x+2000</expression>
      <expression set="y2" type="int">y+2000</expression>

      <server><![CDATA[https://geodata.nationaalgeoregister.nl/top50raster/wms?service=wms&REQUEST=GetMap&VERSION=1.1.1&LAYERS=top50raster&FORMAT=image/png&BBOX={$x},{$y},{$x2},{$y2}&SRS=EPSG:28992&WIDTH=200&HEIGHT=200&styles=default]]></server>
    </zoom-levels>
  </source>

  <source id="MAP02">
    <name>2nd Test 1:50 000</name>
    <zoom-levels z="14">
      
      <bbox-crs-code>EPSG:28992</bbox-crs-code>
      <projection-code>EPSG:28992</projection-code>
      <projection-resolution>10</projection-resolution>
      <tiles-size>200</tiles-size>
      <projection-offset-y>2000.0</projection-offset-y>

      <server><![CDATA[https://geodata.nationaalgeoregister.nl/top50raster/wms?service=wms&REQUEST=GetMap&VERSION=1.1.1&LAYERS=top50raster&FORMAT=image/png&BBOX={$bbox}&SRS=EPSG:28992&WIDTH=200&HEIGHT=200&styles=default]]></server>
    </zoom-levels>
  </source>
</aqx>
Psyberia-Support
Site Admin
Posts: 6407
Joined: Wed Apr 14, 2010 9:41 pm

Re: Problem: aqx file for unusual wms tile server not working

Post by Psyberia-Support »

Hi and sorry for the delay.
First advice when trying to setup custom maps, is to add the user setting "maps.debug=1". It will make the application display tiles bounds and their x/y/z coordinates on the map, and log all generated URLs ([app folder]/logs/application.log), so you can check if the generated URLs are correct.
Then, concerning the rounded coordinates, you can use the "{$ibbox}" variable instead of {$bbox}, which will give you integer (rounded) values.
Also, I don't understand why you need an offset. The app will take care of correctly computing the bbox based on the chosen resolution.

Finally, you get this conf, which I have successfully tested:

Code: Select all

<source id="MAP03">
    <name>3rd Test 1:50 000</name>
    <zoom-levels z="14">
      <projection-code>EPSG:28992</projection-code>
      <projection-resolution>10</projection-resolution>
      <bbox-crs-code>EPSG:28992</bbox-crs-code>
      <tiles-size>200</tiles-size>
      <server><![CDATA[https://geodata.nationaalgeoregister.nl/top50raster/wms?service=wms&REQUEST=GetMap&VERSION=1.1.1&LAYERS=top50raster&FORMAT=image/png&BBOX={$ibbox}&SRS=EPSG:28992&WIDTH=200&HEIGHT=200&styles=default]]></server>
    </zoom-levels>
  </source>
  
Do you like AlpineQuest ? Leave a small comment on Google Play !
Jochem
Posts: 15
Joined: Wed Oct 09, 2019 6:36 am

Re: Problem: aqx file for unusual wms tile server

Post by Jochem »

Thanks!

Such good help is worth waiting for. Using {$ibbox} solves the problem. Also the offset is gone, which probably was caused by the WMS server's response to unrounded coordinates. It works perfectly now. Nevertheless, I tried the user setting maps.debug=1. This will be very helpful if I run into problems with other tile servers in the future.

Kind regards, Jochem
Post Reply