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

AQX Problem

It's all about maps...
Post Reply
furykid
Posts: 9
Joined: Sun Apr 22, 2012 1:55 pm

AQX Problem

Post by furykid »

Hi I am trying to define a mapsource in AQX format but always get parsing errors ( maybe there are redundant or not needed sections and maybe it will not work as intended but primarily I would like to understand the syntax (problems)

here my testfile:

<?xml version="1.0" encoding="utf-8" ?>
<aqx version="1">

<name>Bing Virtual Earth</name>
<description>http://www.bing.com</description>

<source id="BING_VE">

<name>Bing Virtual Earth</name>
<data-source>http://www.bing.com</data-source>
<copyright>Microsoft.com</copyright>

<level type="expr">

<zoom-values>1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19</zoom-values>

<expressions>
<expr set="nb_tiles">pow( 2, z )</expr>
<expr set="tile_id" type="int">quadtree( x, y, z )</expr>
<expr set="reverse_y" type="int">nb_tiles - y</expr>
<expr set="map_type">"a"</expr>
<expr set="url_append">"?g=45"</expr>
<expr set="server">"ortho.tiles.virtualearth.net/tiles"</expr>
</expressions>

<projection>
<projection-name>mercator</projection-name>
<projection-geoid>sphere</projection-geoid>
<projection-origin-x>0</projection-origin-x>
<projection-origin-y>0</projection-origin-y>
<projection-factor-x>nb_tiles / 360</projection-factor-x>
<projection-factor-y>nb_tiles / 360</projection-factor-y>
<projection-offset-x>nb_tiles / 2</projection-offset-x>
<projection-offset-y>nb_tiles / 2</projection-offset-y>
</projection>

<tiles>
<tiles-size-x>256</tiles-size-x>
<tiles-size-y>256</tiles-size-y>
</tiles>

<servers>
<max-threads>2</max-threads>

<server>http://{$map_type}0.{$server}/{$map_type}{$tile_id}.jpg{$url_append}</server>
<server>http://{$map_type}1.{$server}/{$map_type}{$tile_id}.jpg{$url_append}</server>
<server>http://{$map_type}2.{$server}/{$map_type}{$tile_id}.jpg{$url_append}</server>
<server>http://{$map_type}3.{$server}/{$map_type}{$tile_id}.jpg{$url_append}</server>
</servers>

</level>

</source>

</aqx>
Psyberia-Support
Site Admin
Posts: 6406
Joined: Wed Apr 14, 2010 9:41 pm

Re: AQX Problem

Post by Psyberia-Support »

Hi,

You were quite close actually.
Bings maps like Google maps start counting tiles from north, whereas AlpineQuest starts from south, that's why you need to inverse the Y, and use it in the quadtree function.

I have also removed some expressions to add them directly in the server string (so it's faster cause there are less expressions to parse).
Finally I recommend you not to use every zoom level but only one over two, so you have less images to cache, but you can change this like you want.

Be careful to delete your map from the community maps after each changes to delete all previously cached tiles and be able to re-parse the new AQX file version.

Here is a working file:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<aqx version="1">

<name>Bing Virtual Earth</name>
<description>http://www.bing.com</description>

<source id="BING_VE">

<name>Bing Virtual Earth</name>
<data-source>http://www.bing.com</data-source>
<copyright>Microsoft.com</copyright>

<level type="expr">

<zoom-values>5,7,9,11,13,15,17,18</zoom-values>

<expressions>
<expr set="nb_tiles">pow( 2, z )</expr>
<expr set="reverse_y">nb_tiles - y</expr>
<expr set="tile_id" type="int">quadtree( x, reverse_y, z )</expr>
</expressions>

<projection>
<projection-name>mercator</projection-name>
<projection-geoid>sphere</projection-geoid>
<projection-origin-x>0</projection-origin-x>
<projection-origin-y>0</projection-origin-y>
<projection-factor-x>nb_tiles / 360</projection-factor-x>
<projection-factor-y>nb_tiles / 360</projection-factor-y>
<projection-offset-x>nb_tiles / 2</projection-offset-x>
<projection-offset-y>nb_tiles / 2</projection-offset-y>
</projection>

<tiles>
<tiles-size-x>256</tiles-size-x>
<tiles-size-y>256</tiles-size-y>
</tiles>

<servers>
<max-threads>2</max-threads>

<server>http://a0.ortho.tiles.virtualearth.net/tiles/a{$tile_id}.jpg?g=45</server>
<server>http://a1.ortho.tiles.virtualearth.net/tiles/a{$tile_id}.jpg?g=45</server>
<server>http://a2.ortho.tiles.virtualearth.net/tiles/a{$tile_id}.jpg?g=45</server>
<server>http://a3.ortho.tiles.virtualearth.net/tiles/a{$tile_id}.jpg?g=45</server>
</servers>

</level>

</source>

</aqx>
Do you like AlpineQuest ? Leave a small comment on Google Play !
furykid
Posts: 9
Joined: Sun Apr 22, 2012 1:55 pm

Re: AQX Problem

Post by furykid »

Hi,

thank you very much for your quick response and bug fixing!

works like a charme! Thank you for this wonderfull tool !
Post Reply