<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — OnGenerateBuildingHeight coordinates]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=925&amp;type=atom" />
	<updated>2018-11-14T18:09:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=925</id>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4233#p4233" />
			<content type="html"><![CDATA[<p>Hello.</p><p>The answer is in OnlineMapsBuildingBuiltIn.AnalizeHouseTags (line: 55).</p><p>return false;</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-11-14T18:09:55Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4233#p4233</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4232#p4232" />
			<content type="html"><![CDATA[<p>Hi Alex,</p><p>I&#039;m just trying this functionality, but shouldn&#039;t this method return true?</p><p>&nbsp; &nbsp; protected static bool GetHeightFromString(string str, ref float height)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (string.IsNullOrEmpty(str)) return false;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; int l = str.Length;<br />&nbsp; &nbsp; &nbsp; &nbsp; if (!TryGetFloat(str, 0, l, out height))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (str[l - 2] == &#039;c&#039; &amp;&amp; str[l - 1] == &#039;m&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (TryGetFloat(str, 0, l - 2, out height))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height /= 10;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if (str[l - 1] == &#039;m&#039;) return TryGetFloat(str, 0, l - 1, out height);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; return false ------- true????;<br />&nbsp; &nbsp; }</p>]]></content>
			<author>
				<name><![CDATA[rooi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=786</uri>
			</author>
			<updated>2018-11-14T14:21:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4232#p4232</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4150#p4150" />
			<content type="html"><![CDATA[<p>Thanks Alex!<br />I&#039;ll try it out very soon</p>]]></content>
			<author>
				<name><![CDATA[rooi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=786</uri>
			</author>
			<updated>2018-11-04T14:39:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4150#p4150</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4138#p4138" />
			<content type="html"><![CDATA[<p>We added an event:<br /></p><div class="codebox"><pre><code>public Action &lt;OnlineMapsOSMWay, List&lt;OnlineMapsOSMNode&gt;&gt; OnlineMapsBuildings.OnPrepareCreateBuilding</code></pre></div><p>to which the way and used nodes are passed.</p><p>To specify the height of the building, simply add the height tag to the way.</p><br /><br /><p>I do not know why buildings must be centered based on a polylabel.<br />But we have added you the way to do it.<br />We added event:<br /></p><div class="codebox"><pre><code>public Func &lt;List&lt;Vector3&gt;, Vector3&gt; OnlineMapsBuildings.OnCalculateBuildingCenter</code></pre></div><p>so that you can intercept the calculation of the center point, and calculate it based on polylabel.</p><p>The new version will be available in 24 hours.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-31T18:12:56Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4138#p4138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4120#p4120" />
			<content type="html"><![CDATA[<p>Hi Alex,</p><p>Another request/suggestion if you&#039;ll find time to work on the API change. Perhaps you can include polylabel like functionality in finding the &quot;center&quot; of the polygon. This gives much better results in my application with concave buildings.</p><p>This is some example code:<br /><a href="https://github.com/mapbox/polylabel/issues/26">https://github.com/mapbox/polylabel/issues/26</a></p><p>Roy</p>]]></content>
			<author>
				<name><![CDATA[rooi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=786</uri>
			</author>
			<updated>2018-10-30T13:19:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4120#p4120</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4118#p4118" />
			<content type="html"><![CDATA[<p>Great, thanks!</p><p>I&#039;ve found a workaround, which uses the OnCreateBuilding to save the OnlineMapsBuildingsNodeData and use this to find the usedNodes and recalculate the center. This is not ideal, so anything you can add to the API would be great.</p>]]></content>
			<author>
				<name><![CDATA[rooi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=786</uri>
			</author>
			<updated>2018-10-29T21:26:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4118#p4118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4117#p4117" />
			<content type="html"><![CDATA[<p>Hello.</p><p>OnGenerateBuildingHeight is not suitable for your purposes.<br />Right now Online Maps has no good way to do this.<br />Give me 1-2 days, and I&#039;ll add some API so you can do what you want.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-10-29T20:30:20Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4117#p4117</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[OnGenerateBuildingHeight coordinates]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4115#p4115" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I would like to implement a custom method to set proper buidling heights when non can be found in OSM using the height or level tag. I&#039;ve found the OnGenerateBuildingHeight func and it allow me to set custom heights. However, I need to get the coordinates (lat lon, or tile) in order to obtain the correct building height but I see no way of deriving this from the OnlineMapsOSMWay argument.</p><p>Am I missing some way of obtaining the coordinates from the way object or is the OnGenerateBuildingHeight func not intended for this purpose? Do you recommend another manner of implementing this custum buildingheight functionality?</p><p>Thanks!</p><p>Roy</p>]]></content>
			<author>
				<name><![CDATA[rooi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=786</uri>
			</author>
			<updated>2018-10-29T15:44:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4115#p4115</id>
		</entry>
</feed>
