[done] Unix Time Stamp in the aqx maps

Discussions about onboard maps, online maps and Map Creators
alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

[done] Unix Time Stamp in the aqx maps

Post by alexlong » Thu Mar 05, 2020 10:15 am

Hi and thanks for AQ.
Is it possible to add Unix Time Stamp to an aqx map?
There is a map RainViewer is the best free weather radar appfor storm tracking and rain forecast.
API → https://www.rainviewer.com/api.html

The tile update for RainViewer is the best free weather radar appfor storm tracking and rain forecast is 10 minutes.
They use Unix Time.

Code: Select all

<server><![CDATA[https://tilecache.rainviewer.com/v2/radar/1583354400/256/{z}/{x}/{y}/2/1_1_0.png]]></server>
This works only for a certain time.
Is there a way to use this sevrvice in AQ with the time update, for example every 10 minutes?

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Thu Mar 05, 2020 11:17 am

The aqx code is like this:

Code: Select all

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

<name>RainViewer</name>
<description>World Live Weather Radar</description>


    <source id="RAINVIEW" layer="true">
        <name>RainViewer Weather Radar</name>
        <copyright>© 2020 Oleksii Schastlyvyi</copyright>
        <data-source>https://www.rainviewer.com/</data-source>
        <region>WRLD</region>
        <type>OTHE</type>
        <preview-location>38.06,55.7,5</preview-location>
        
        <level>
            <zoom-values>4,5,6,7,8,9,10,11,12,13,14,15,16,17,18</zoom-values>
            
            <update-delay>0D</update-delay>

                <referer><![CDATA[https://www.rainviewer.com/]]></referer>
                <server><![CDATA[https://tilecache.rainviewer.com/v2/radar/1583351400/256/{z}/{x}/{y}/2/1_1_0.png]]></server>
        </level>
    </source>

</aqx>
The map dispalys data only for 1583351400 Unix time.

Psyberia-Support
Site Admin
Posts: 4884
Joined: Wed Apr 14, 2010 9:41 pm

Re: Unix Time Stamp in the aqx maps

Post by Psyberia-Support » Thu Mar 05, 2020 3:06 pm

Hi Alex,
I've published a new beta (2.2.5.r6151), when you have it you'll be able to use this map.
Note that aqx version is now "10", because this map is not working on other versions of the app (new function "unixtime").

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<aqx version="10">
	<name>RainViewer</name>
	<description>World Live Weather Radar</description>
	<source id="RAINVO" type="other" layer="true">
		<name>RainViewer Overlay</name>
		<copyright>rainviewer</copyright>
		<preview-location>-3,50,6</preview-location>
		<zoom-levels z="1,2,3,4,5,6,7,8,9,10,11,12">
			<update-delay>600S</update-delay>
			<expression set="t" type="long">floor((unixtime()-10)/600)*600</expression>
			<referer><![CDATA[https://www.rainviewer.com/]]></referer>
			<server><![CDATA[https://tilecache.rainviewer.com/v2/radar/{$t}/256/{$z}/{$x}/{$y}/2/1_1_0.png]]></server>
		</zoom-levels>
	</source>
</aqx>
Do you like AlpineQuest ? Leave a small comment on Google Play !

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Thu Mar 05, 2020 4:13 pm

Hi, François!
Thank you so much for your help. I will try the map as soon as I get the new beta.
Yesterday I checked zoom levels available for this map.
Maximal zoom was 18.

Psyberia-Support
Site Admin
Posts: 4884
Joined: Wed Apr 14, 2010 9:41 pm

Re: Unix Time Stamp in the aqx maps

Post by Psyberia-Support » Thu Mar 05, 2020 7:03 pm

You're right for the zoom level, but it doesn't give more details when you zoom, and only take more storage space.
From what I've seen, 12 is good and after the application will take care of increasing the size when you zoom more.
Do you like AlpineQuest ? Leave a small comment on Google Play !

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Thu Mar 05, 2020 7:16 pm

Ok, i see there is no need to use large zooms in this map. Probably 12 is enough.

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Fri Mar 06, 2020 12:11 pm

Hi, François!
How can I use unixtime in

Code: Select all

<server><![CDATA[https://tilecache.rainviewer.com/v2/radar/{$t}/256/{$z}/{$x}/{$y}/2/1_1_0.png]]></server>
?
For example, if I need to have a look at the past precipitation and calculate the dynamics.

Psyberia-Support
Site Admin
Posts: 4884
Joined: Wed Apr 14, 2010 9:41 pm

Re: Unix Time Stamp in the aqx maps

Post by Psyberia-Support » Fri Mar 06, 2020 12:17 pm

Hi Alex,
the "{$t}" is computed with this line:

Code: Select all

<expression set="t" type="long">floor((unixtime()-10)/600)*600</expression>
If you want the time 10 minutes before now, you can remove 600 seconds (=10 mins), and so you have:

Code: Select all

<expression set="t" type="long">(floor((unixtime()-10)/600)*600)-600</expression>
The server tag remains unchanged.
Do you like AlpineQuest ? Leave a small comment on Google Play !

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Fri Mar 06, 2020 12:47 pm

Thank you so much!!! It is very useful!

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Tue Mar 10, 2020 9:08 am

Hi, François!
How can I add to AlpineQuest map the code like this?

Code: Select all

radar/{ts}/{size}/{z}/{latitude}/{longitude}/{color}/{options}.png
Radar data with center at specified coordinate (EPSG:4326) with desired zoom size.

{latitude}, {longitude} - Latitude and longitude of specific coordinates accordingly. Decimal format. Must contain dot in the number. Example: -32.7892, 108.67821.
https://www.rainviewer.com/api.html

I need to know how to add {z}/{latitude}/{longitude}

For example
59.99095, 30.315868
Zoom 9

Thanks in advance

Psyberia-Support
Site Admin
Posts: 4884
Joined: Wed Apr 14, 2010 9:41 pm

Re: Unix Time Stamp in the aqx maps

Post by Psyberia-Support » Tue Mar 10, 2020 12:45 pm

Hi Alex,
Why would you like to use "{z}/{latitude}/{longitude}" instead of "{z}/{x}/{y}"?
This version is only when you need a single image over one particular location, for example if you want an image of the current weather over Moscow to put on your website. Then you use the {latitude}/{longitude} of Moscow.
But in the application it doesn't make sense, because you just have to move the map over Moscow and you'll see the data.
Do you like AlpineQuest ? Leave a small comment on Google Play !

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Tue Mar 10, 2020 3:48 pm

Hi, François!
It may sound stupid but the idea was to open a map at the same place. For example I need to see an area over Moscow. I may move the screen center during the work with AQ but any time I open this particular map I would like to be over the Moscow region.
But you are right – my idea is not working and it doesn't make sense.
Forget about it
Thanks a lot for unixtime and for

Code: Select all

<expression set="t" type="long">(floor((unixtime()-10)/600)*600)-600</expression>
– it's really good.
I made it moving.
Animated gif

Psyberia-Support
Site Admin
Posts: 4884
Joined: Wed Apr 14, 2010 9:41 pm

Re: Unix Time Stamp in the aqx maps

Post by Psyberia-Support » Tue Mar 10, 2020 3:59 pm

If you want to make a map of Moscow, then you can add this:

Code: Select all

<outline>37.292177,55.988068 38.009035,55.989605 38.009035,55.496418 37.256471,55.488638</outline>
If you're away from Moscow, the application will ask if you want to move over Moscow.
And if you click on this map in the "Displayed maps" list, then the map will move over Moscow.
Do you like AlpineQuest ? Leave a small comment on Google Play !

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Tue Mar 10, 2020 4:03 pm

Oh, thanks.
I've just forgotten about <outline></outline> tag!
And what happens if I have 2 maps in favourites – the main map (ex Google map) and the Rainviewer layer. Where should I add <outline></outline>? Will it work if I add <outline></outline> in Rainviewer layer and Rainviewer layer will be over the main map?

alexlong
Posts: 470
Joined: Fri Jul 31, 2015 8:06 am
Location: Russia

Re: Unix Time Stamp in the aqx maps

Post by alexlong » Tue Mar 10, 2020 4:14 pm

I checked it – it does not work if to open the main map and the Rainviewer layer as a favourite.
So let it be as it is. Unixtime works fine an it's important.

Post Reply