<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Elevation data caching]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=672</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=672&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Elevation data caching.]]></description>
		<lastBuildDate>Wed, 01 Apr 2020 09:20:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6115#p6115</link>
			<description><![CDATA[<p>The problem is that GetUnscaledElevation requires a position in the scene, relative to the top-left corner of the map.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsElevationManagerBase.html#ae05a9c810f7ff98ab82d3ec87e6b8540">http://infinity-code.com/doxygen/online … c87e6b8540</a><br />You pass geographic coordinates.<br />You need to first convert the coordinates to a position in the scene.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase.html#ae07c16d776478eda7a9b41369ba44098">http://infinity-code.com/doxygen/online … 369ba44098</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 01 Apr 2020 09:20:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6115#p6115</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6113#p6113</link>
			<description><![CDATA[<p>Im sorry, let me explain.</p><p>I want to know the real elevation for my markers on the map. Is it possible to read elevation from tiles for a position on map by just providing latitude, longitude and zoom?</p><p>I try the following code:</p><p>Vector2 center = marker.position;<br />float unscaledElevation = OnlineMapsElevationManagerBase.GetUnscaledElevation(center.x, center.y); // real elevation value</p><p>But the problem is each zoom gives different elevation for my markers. Requesting elevations from tiles would be better?</p>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Tue, 31 Mar 2020 10:44:39 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6113#p6113</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6112#p6112</link>
			<description><![CDATA[<p>CacheMapboxElevation only saves and reads elevation data for the tile from the cache.<br />What is the point of this function if you can get elevation data using OnlineMapsMapboxElevationManager?!</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 30 Mar 2020 19:42:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6112#p6112</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6111#p6111</link>
			<description><![CDATA[<p>Is it possible to add a function in the CacheMapboxElevation (Online Maps v3) for requesting real world elevation for specific coordinates(Lon, Lat) at specific zoom? <br />Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Sun, 29 Mar 2020 12:24:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6111#p6111</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5280#p5280</link>
			<description><![CDATA[<p><a href="http://forum.infinity-code.com/viewtopic.php?pid=5279#p5279">http://forum.infinity-code.com/viewtopi … 5279#p5279</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 09 Jul 2019 21:35:11 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5280#p5280</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5276#p5276</link>
			<description><![CDATA[<p>yes i think i need your help if possible .I still do not master the horizon scripts so it&#039;s a little&nbsp; complicated.<br />Thank you any way</p>]]></description>
			<author><![CDATA[null@example.com (Amen)]]></author>
			<pubDate>Tue, 09 Jul 2019 14:11:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5276#p5276</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5271#p5271</link>
			<description><![CDATA[<p>Yes it is possible.<br />But this will not work with Horizon, which you asked for in another thread.<br />Horizon already has everything to implement caching.<br />You just need to add a save array to the file, check for the existence of the file, and read the array from the file.</p><p>It is so easy that I believe that you can do it.<br />If you still have problems implementing this, write again and I will do it for you.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 05 Jul 2019 18:24:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5271#p5271</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5270#p5270</link>
			<description><![CDATA[<p>it&#039;s possible to have elevation data caching for ArcGIS.<br />THANK YOUU</p>]]></description>
			<author><![CDATA[null@example.com (Amen)]]></author>
			<pubDate>Fri, 05 Jul 2019 09:00:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5270#p5270</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4963#p4963</link>
			<description><![CDATA[<p>This is a script for Online Maps v2.<br />In Online Maps v3, this is much easier:<br /></p><div class="codebox"><pre><code>using System.IO;
using UnityEngine;

public class CacheMapboxElevation: MonoBehaviour
{
    private string GetTilePath(OnlineMapsTiledElevationManager&lt;OnlineMapsMapboxElevationManager&gt;.Tile tile)
    {
        return Application.persistentDataPath + &quot;/Elevation Cache/&quot; + tile.zoom + &quot;/&quot; + tile.x + &quot;/&quot; + tile.y + &quot;.png&quot;;
    }

    private void OnDownload(OnlineMapsTiledElevationManager&lt;OnlineMapsMapboxElevationManager&gt;.Tile tile)
    {
        string path = GetTilePath(tile);
        if (!File.Exists(path))
        {
            OnlineMapsMapboxElevationManager.instance.StartDownloadElevationTile(tile);
            return;
        }

        Texture2D texture = new Texture2D(256, 256);
        texture.LoadImage(File.ReadAllBytes(path));
        OnlineMapsMapboxElevationManager.instance.SetElevationTexture(tile, texture);
        OnlineMapsUtils.Destroy(texture);

        Debug.Log(&quot;Loaded from cache: &quot; + path);
    }

    private void OnDownloadSuccess(OnlineMapsTiledElevationManager&lt;OnlineMapsMapboxElevationManager&gt;.Tile tile, OnlineMapsWWW www)
    {
        string path = GetTilePath(tile);
        FileInfo info = new FileInfo(path);
        if (!info.Directory.Exists) info.Directory.Create();
        File.WriteAllBytes(path, www.bytes);

        Debug.Log(&quot;Elevation saved: &quot; + path);
    }

    private void Start()
    {
        OnlineMapsMapboxElevationManager.instance.OnDownload += OnDownload;
        OnlineMapsMapboxElevationManager.instance.OnDownloadSuccess += OnDownloadSuccess;
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 16 May 2019 17:00:28 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4963#p4963</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4959#p4959</link>
			<description><![CDATA[<p>Hi ,<br />I&#039;have this error using this script</p>]]></description>
			<author><![CDATA[null@example.com (Amen)]]></author>
			<pubDate>Thu, 16 May 2019 14:36:17 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4959#p4959</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3818#p3818</link>
			<description><![CDATA[<p>Hello.</p><p>Please attach a stack trace of the error.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 24 Aug 2018 16:03:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3818#p3818</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3815#p3815</link>
			<description><![CDATA[<p>I&#039;m trying to use this script to achieve the same thing but it doesn&#039;t seem to work, i attached the script to the map object and then supplied the mapbox key but i get an error &quot;Array index out of range&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (matlaray)]]></author>
			<pubDate>Fri, 24 Aug 2018 11:37:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3815#p3815</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3709#p3709</link>
			<description><![CDATA[<p>Yes, you must add the script to the map (or any other) GameObject and enter your Mapbox Access Token.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 17 Jul 2018 19:35:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3709#p3709</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3706#p3706</link>
			<description><![CDATA[<p>Would you pleased to describe how you using the codes?Should I attach a script which contains the codes to the map?</p>]]></description>
			<author><![CDATA[null@example.com (Greenwhich)]]></author>
			<pubDate>Tue, 17 Jul 2018 11:18:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3706#p3706</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation data caching]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3705#p3705</link>
			<description><![CDATA[<div class="quotebox"><cite>leviniarened wrote:</cite><blockquote><p>Now works perfectly.&nbsp; A big thank you to Alex.</p></blockquote></div><p>Would you pleased to describe how you using the codes?Should I attach a script which contains the codes to the map?</p>]]></description>
			<author><![CDATA[null@example.com (Greenwhich)]]></author>
			<pubDate>Tue, 17 Jul 2018 06:46:42 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3705#p3705</guid>
		</item>
	</channel>
</rss>
