<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Virtual Earth 3D team blog : DataSource</title><link>http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx</link><description>Tags: DataSource</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>X File bulk display</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/09/20/x-file-bulk-display.aspx</link><pubDate>Mon, 21 Sep 2009 00:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9897332</guid><dc:creator>NikolaiF</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9897332.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9897332</wfw:commentRss><description>&lt;P&gt;I was asked the other day about how to load multiple x file -based models into VE3D without having to place each one manually.&amp;nbsp; I've written up a &lt;A title="X File DataSource sample" href="http://www.veteam.members.winisp.net/Spaceland/blog/XFileDataSource.zip" mce_href="http://www.veteam.members.winisp.net/Spaceland/blog/XFileDataSource.zip"&gt;sample here&lt;/A&gt;.&amp;nbsp; The idea is more or less a fusion of the existing ActorDataSource and XFile samples, using the actor from the XFile sample rather than the bunnies.&amp;nbsp; I've also mocked up a very simple data file that contains placement information, rather than generating data on the fly as for the bunnies.&lt;/P&gt;
&lt;P&gt;The way I've done this, the parsing code for the x files is done in the actor.&amp;nbsp; In this way, swapping out file formats should be straightforward so long as you have parsing code for it (sorry, only x files are directly implemented in the engine, but the results of any parse should still be easily convertible into VE3D graphics objects).&lt;/P&gt;
&lt;P&gt;For the sake of simplicitly I did do one thing wrong.&amp;nbsp; The flow of the code is like this:&amp;nbsp; multiple background threads all execute QueryPrimitivesInternal at the same time, and when they are finished, they move through a lock into ActorBuilder.&amp;nbsp; They are still on background threads, but they now execute serially.&amp;nbsp; So, really the data retrieval (in this case, loading from resources, but probably a network request) and the parsing, as appropriate, should happen in QueryPrimitivesInternal, and the action in ActorBuilder should be kept to a minimum.&amp;nbsp; I violated this rule in the sample code for the sake of illustration, but you should be aware of it.&lt;/P&gt;
&lt;P&gt;Finally, an important consideration is level of detail.&amp;nbsp; Dense and numerous models can slow down loading and rendering.&amp;nbsp; DataSources take advantage of the ActorBounds and scale concepts, such that it is possible to use simplified models at certain LODs, and switch to more detailed as the user zooms in.&amp;nbsp; If your needs are less extreme, then you can simply use scale to cause models to stop rendering when not in view, and at a certain distance, which is what I have done in the sample.&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897332" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/X+File/default.aspx">X File</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Actor/default.aspx">Actor</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Bing+Maps+3D/default.aspx">Bing Maps 3D</category></item><item><title>Actor data source questions</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/07/26/actor-data-source-questions.aspx</link><pubDate>Sun, 26 Jul 2009 21:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9849338</guid><dc:creator>NikolaiF</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9849338.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9849338</wfw:commentRss><description>&lt;P&gt;I just fielded a few good questions via email about actor data sources, and thought it would make a good post.&lt;/P&gt;
&lt;P&gt;Actor data sources are a way of getting little bits of your code (actors) into the world, handing spatial indexing and cache management for you.&amp;nbsp; When each actor is in view, they are given the opportunity to execute code in the Render and Update functions.&amp;nbsp; When the cache is full and an actor is evicted, they again may execute code in the OnRemove function.&lt;/P&gt;
&lt;P&gt;You create them by implementing a DataSource with usage Actor, and an ActorBuilder which translates the Primitives returned into Actor objects, along with information like what areas of the Earth the actors should be used in, as an ActorBounds object.&amp;nbsp; All of this can be seen in the &lt;A title=ActorDataSource href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/ActorDataSource/TestPage.htm" mce_href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/ActorDataSource/TestPage.htm"&gt;ActorDataSource&lt;/A&gt; &lt;A title=Samples href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" target=_blank mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;sample&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In the sample, however, only one Primitive is returned per request, and only one Actor.&amp;nbsp; What if you want more?&amp;nbsp; The important thing to know is that there has to be a 1-1 correspondence between Primitives and Actors *.&amp;nbsp; You must create one Actor for every Primitive used.&amp;nbsp; If you create more than one Actor for a single Primitive, only one will appear.&lt;/P&gt;
&lt;P&gt;The reason for this is the Actor update story.&amp;nbsp; It is possible to update an Actor already in the system by two methods.&amp;nbsp; When an Actor is updated, the PrimitiveId from the passed-in primitive is used to find and update the actor in question.&amp;nbsp; If you add multiple actors per primitive, an ambiguity arises as to what you actually want to do.&lt;/P&gt;
&lt;P&gt;It is possible to resolve this ambiguity by creating "nested" actors.&amp;nbsp; This is simple.&amp;nbsp; Just create the actors you want, and then a "container"&lt;/P&gt;
&lt;P&gt;*:&amp;nbsp; actually you can create a single Actor with multiple Primitives, but I don't want to confuse the issue for now.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;U&gt;Updating an Actor:&lt;/U&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Expiration.&lt;/STRONG&gt;&amp;nbsp; On the Entity attached to your primitive, add a property "ExpiresInSeconds":&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;e.EntityTypes["bunny"].Properties.Create("ExpiresInSeconds", typeof(double));&lt;/P&gt;
&lt;P mce_keep="true"&gt;...&lt;/P&gt;
&lt;P mce_keep="true"&gt;entitySpec.Properties.SetValue("ExpiresInSeconds", 10.0);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Your QueryPrimitivesInternal function will be called again for every area the affected Actors live, and OnRemove will be called for the expiring Actors.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Manual.&lt;/STRONG&gt;&amp;nbsp; You can specify a specific PrimitiveId to update using OnDataChanged in your source DataSource.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;PrimitiveIdWriteableCollection wc = new PrimitiveIdWriteableCollection();&lt;BR&gt;wc.Add(new BunnyPrimitiveId(this, tile));&lt;BR&gt;OnDataChanged(new SpatialExtent(null, null, wc.GetReadOnlyCopy()));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;You must also implement the QueryPrimitivesByIdsInternal function.&amp;nbsp; A collection of ids is provided, and you must return an array of Primitives that matches the input (so, the first item in the id collection should result in a Primitive at array index 0, etc).&amp;nbsp; If an element of the array is left null, that means to delete the Actor corresponding to that PrimitiveId.&amp;nbsp; Your ActorBuilder is then called to allow you to create the new replacement Actors.&lt;/P&gt;
&lt;P mce_keep="true"&gt;You can also specify a region of the Earth to update in the SpatialExtent, but update by entity is not supported.&amp;nbsp; Updating very large areas can be expensive, so use spatial regions with care.&amp;nbsp; Update by PrimitiveId is the most efficient.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9849338" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Actor/default.aspx">Actor</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Bing+Maps+3D/default.aspx">Bing Maps 3D</category></item><item><title>WMS Data</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/06/09/wms-data.aspx</link><pubDate>Tue, 09 Jun 2009 20:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9716735</guid><dc:creator>NikolaiF</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9716735.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9716735</wfw:commentRss><description>&lt;P&gt;I was having a discussion with&amp;nbsp;Kurt Guenther from &lt;A title="Infusion Surface Blog" href="http://www.infusion.com/surfaceblog/" target=_blank mce_href="http://www.infusion.com/surfaceblog/"&gt;Infusion&lt;/A&gt; yesterday on the topic of WMS servers and VE3D.&amp;nbsp; There is a large amount of very interesting spatial data out there served by &lt;A title="WMS on Wikipedia" href="http://en.wikipedia.org/wiki/Web_Map_Service" target=_blank mce_href="http://en.wikipedia.org/wiki/Web_Map_Service"&gt;Web Map Services&lt;/A&gt;, or WMS servers.&amp;nbsp; VE3D is able to process this data using ConnectionParameter-based DataSources.&amp;nbsp; Setting it up is pretty easy:&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt"&gt;ConnectionParameters&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt; cp = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ConnectionParameters&lt;/SPAN&gt;(&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_Neighborhoods_AGO/MapServer/export?bbox=%7b16%7d,%7b17%7d,%7b18%7d,%7b19%7d&amp;amp;bboxSR=4326&amp;amp;layers=&amp;amp;layersDefs=&amp;amp;size=256,256&amp;amp;imageSR=102113&amp;amp;format=png&amp;amp;transparent=true&amp;amp;dpi=&amp;amp;f=image"&gt;&lt;FONT color=#0000ff&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_Neighborhoods_AGO/MapServer/export?bbox={16},{17},{18},{19}&amp;amp;bboxSR=4326&amp;amp;layers=&amp;amp;layersDefs=&amp;amp;size=256,256&amp;amp;imageSR=102113&amp;amp;format=png&amp;amp;transparent=true&amp;amp;dpi=&amp;amp;f=image&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; connectionParameters = cp.ToString();&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;DataSourceLayerData&lt;/SPAN&gt; layerData = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DataSourceLayerData&lt;/SPAN&gt;(LayerName, Name, connectionParameters, &lt;SPAN style="COLOR: #2b91af"&gt;DataSourceUsage&lt;/SPAN&gt;.TextureMap);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Host.DataSources.Add(layerData);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Drop this in to your Activate (plug-in) or Initialized handler (winforms etc) app and fly to Portland, OR to see the data (thanks to ArcGIS for the sample data and Kurt for the pointer).&lt;/P&gt;
&lt;P mce_keep="true"&gt;I won't go into all the details of the WMS spec here, but I will call out a few important parts.&amp;nbsp; First, in order for this to work you must specify the bbox to be in Geographic coordinates (4326).&amp;nbsp; This is usually the default.&amp;nbsp; Second, you must pay attention to the returned projection.&amp;nbsp; In the above case, we have instructed the server to return 102113, which is Web Mercator, VE3D's native image projection.&amp;nbsp; This data can be consumed directly with very little overhead.&amp;nbsp; However, different servers support only certain formats and projections, and you must be careful for any particular server (it is possible to query this using WMS's GetCapabilities).&amp;nbsp; Nearly all support returning images in Geographic coordinates, 4326.&amp;nbsp; It is possible to instruct VE3D to reproject this to Web Mercator (this is the only reprojection VE3D will do for you, fortunately it will work for the majority of data).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now, to look at ConnectionParameters and what it can do for you.&amp;nbsp; First, there's the big url.&amp;nbsp; Notice that the bbox has string.Format replacement variables in it:&amp;nbsp; {16}, {17}, etc.&amp;nbsp; Requests to the server are made on a per-tile basis (the &lt;A title="Debug keys" href="http://blogs.msdn.com/virtualearth3d/archive/2008/10/29/debug-key-shortcuts.aspx" target=_blank mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/10/29/debug-key-shortcuts.aspx"&gt;T key&lt;/A&gt; is useful here).&amp;nbsp; For each request, these variables are replaced with data specific to the tile in question.&amp;nbsp; Here is a list of available parameters:&lt;/P&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;0 Reserved&lt;/P&gt;
&lt;P&gt;1 Map Style&lt;/P&gt;
&lt;P&gt;2 Round-robin integer&lt;/P&gt;
&lt;P&gt;3 Reserved&lt;/P&gt;
&lt;P&gt;4 Quadkey&lt;/P&gt;
&lt;P&gt;5 Extension&lt;/P&gt;
&lt;P&gt;6 Generation&lt;/P&gt;
&lt;P&gt;7 Stripe (0-3)&lt;/P&gt;
&lt;P&gt;8 Tile Host&lt;/P&gt;
&lt;P&gt;9 App Host&lt;/P&gt;
&lt;P&gt;10 Language code&lt;/P&gt;
&lt;P&gt;11 Region code&lt;/P&gt;
&lt;P&gt;12 Tile LOD&lt;/P&gt;
&lt;P&gt;13 Tile X&lt;/P&gt;
&lt;P&gt;14 Tile Y&lt;/P&gt;
&lt;P&gt;15 Low order stripe (0-1)&lt;/P&gt;
&lt;P&gt;16 MinLong&lt;/P&gt;
&lt;P&gt;17 MinLat&lt;/P&gt;
&lt;P&gt;18 MaxLong&lt;/P&gt;
&lt;P&gt;19 MaxLat&lt;/P&gt;
&lt;P&gt;20 RequestToken&lt;/P&gt;
&lt;P&gt;21 Culture name&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;The most interesting ones are 4 (the main quad-key, very useful for already-tiled data), 12, 13, 14, and and 16-19.&amp;nbsp; To see some of this in action, check out the &lt;A title="Terrain Images live sample" href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/TerrainImages/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samplesv4/TerrainImages/TestPage.htm"&gt;TerrainImages sample&lt;/A&gt;&amp;nbsp;(also available in the &lt;A title=Samples href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" target=_blank mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;sample code&lt;/A&gt; of course).&amp;nbsp; Programatically, you can&amp;nbsp;investigate these values using the TileId class, using GetRequestCode, GetPosition, and GetLatLonBoundingBox.&lt;/P&gt;
&lt;P mce_keep="true"&gt;As for other values on ConnectionParameters, you can control reprojection (if your data is in Geographic, specify CoordinateReferenceSystem = WGS84CoordinateReferenceSystem.Instance, as noted before this is the only reprojection natively supported, so otherwise leave this field uninitialized), the bounds of where the data is valid is terms of Lat/Long and LOD (useful to reducing unnecessary network requests), and caching behavior.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Caching behavior deserves special discussion, because WMS servers are often quite slow.&amp;nbsp; By default, data loaded using ConnectionParameters is not cached locally.&amp;nbsp; Once it moves out of memory, it must be re-queried.&amp;nbsp; If you set CacheRetention however, the data will be kept locally for the period of time specified (unless it is evicted due to space restrictions in the interim).&amp;nbsp; If you set CacheRetention = new TimeSpan(24, 0, 0), for example, for 24 hours from the time of query a given tile will not be re-queried.&amp;nbsp; Note that some servers are dynamic, such as weather data, so it's important to use an appropriate value here.&lt;/P&gt;
&lt;P mce_keep="true"&gt;And just to give Kurt a poke in the ribs, please remember to only add DataSources after/during the Initialized event!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;John Fletcher from &lt;A href="http://www.latitudegeo.com/" target=_blank mce_href="http://www.latitudegeo.com/"&gt;Latitude Geographics&lt;/A&gt; pointed out that the example I give above isn't actually WMS compliant in its query parameters.&amp;nbsp; He suggests an alternate sample, of the British Columbia, CA&amp;nbsp;area:&lt;/P&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;
&lt;P&gt;ConnectionParameters&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; p = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ConnectionParameters&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"http://openmaps.gov.bc.ca/mapserver/libcwms2?SERVICE=WMS&amp;amp;VERSION=1.1.1&amp;amp;REQUEST=GetMap&amp;amp;LAYERS=DBM_7H_MIL_BATHYMETRIC_POLY,BC_LABEL,DBM_7H_MIL_DRAINAGE_LINE,DBM_7H_MIL_DRAINAGE_POLY,DBM_7H_MIL_ROADS_LINE,DBM_7H_MIL_POLITICAL_POLY_PS,DBM_7H_MIL_POPULATION_POINT&amp;amp;STYLES=,,,,,,&amp;amp;SRS=EPSG:4326&amp;amp;BBOX={16},{17},{18},{19}&amp;amp;WIDTH=256&amp;amp;HEIGHT=256&amp;amp;FORMAT=image/png&amp;amp;TRANSPARENT=TRUE&amp;amp;EXCEPTIONS=application/vnd.ogc.se_inimage&amp;amp;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;
&lt;P&gt;p.CoordinateReferenceSystem = Microsoft.MapPoint.CoordinateSystems.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Wgs84CoordinateReferenceSystem&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Instance;&lt;/P&gt;
&lt;P&gt;Host.DataSources.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DataSourceLayerData&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"foo"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"bar"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, p.ToString(), &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DataSourceUsage&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.TextureMap));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;John&amp;nbsp;also provided a link to the WMS spec repository&amp;nbsp;(&lt;A href="http://www.opengeospatial.org/standards/wms"&gt;http://www.opengeospatial.org/standards/wms&lt;/A&gt;).&amp;nbsp; Note that the sample above is for WMS 1.1.1.&amp;nbsp; The most current version is 1.3.0, but many servers use the older, or support both.&amp;nbsp; No matter which you use (or even for something a little off spec like my original example) the interface with VE3D is the same.&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9716735" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Cache/default.aspx">Cache</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/WMS/default.aspx">WMS</category></item><item><title>Data Format Revision</title><link>http://blogs.msdn.com/virtualearth3d/archive/2009/04/06/data-format-revision.aspx</link><pubDate>Mon, 06 Apr 2009 20:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9534085</guid><dc:creator>NikolaiF</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9534085.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9534085</wfw:commentRss><description>&lt;P&gt;As part of our version update, we are also updating the file format of our 3D buildings.&amp;nbsp; The upside is that the new data format is significantly smaller, for faster download.&amp;nbsp; The downside is that old versions of the code cannot understand the new data.&amp;nbsp; However, in the short term this should not affect you.&amp;nbsp; There will be a period where old data will still be served to clients that are using the Javascript API and the Managed API.&amp;nbsp; This represents a bit of a compromise, because even clients that have updated to the new version will get the old data for this period, but we felt that this was better than releasing new code and breaking old (and existing) code on the same day.&lt;/P&gt;
&lt;P&gt;To see the new data&amp;nbsp;after the version update, simply navigate to maps.live.com and click 3D.&amp;nbsp; The new data will be live on the site.&lt;/P&gt;
&lt;P&gt;Once this period is over, clients that have updated will automatically begin receiving the new data without any required changes or interruptions.&amp;nbsp; You will probably hardly notice, except that buildings of course will load faster.&amp;nbsp; Clients that have not updated will break!&amp;nbsp; You've been warned!&amp;nbsp; The only issue really will be that buildings will not appear, and only if your code is directly adding model data sources.&lt;/P&gt;
&lt;P&gt;The exact length of this period is TBD, but probably about a month.&amp;nbsp; Our hope is that most everyone will update by then anyway, because the new version really is better.&amp;nbsp; I will blog a reminder when the date is decided and approaching.&amp;nbsp; As always, let me know if you will need any help during the transition.&lt;/P&gt;
&lt;P&gt;In addition, in several samples I directly linked to the manifest files for some resources, like imagery, dem, and models.&amp;nbsp; These are the urls used when creating DataSourceLayerData objects.&amp;nbsp; I encourage you to instead use fwlinks, which are just redirects to the same resources.&amp;nbsp; This will help us update data while minimizing impact to clients.&lt;/P&gt;
&lt;P&gt;Road:&amp;nbsp;&amp;nbsp;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=98770" mce_href="http://go.microsoft.com/fwlink/?LinkID=98770"&gt;http://go.microsoft.com/fwlink/?LinkID=98770&lt;/A&gt;&lt;BR&gt;Aerial:&amp;nbsp;&amp;nbsp;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=98771" mce_href="http://go.microsoft.com/fwlink/?LinkID=98771"&gt;http://go.microsoft.com/fwlink/?LinkID=98771&lt;/A&gt;&lt;BR&gt;Hybrid:&amp;nbsp;&amp;nbsp;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=98772" mce_href="http://go.microsoft.com/fwlink/?LinkID=98772"&gt;http://go.microsoft.com/fwlink/?LinkID=98772&lt;/A&gt;&lt;BR&gt;DEM:&amp;nbsp;&amp;nbsp;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=98774" mce_href="http://go.microsoft.com/fwlink/?LinkID=98774"&gt;http://go.microsoft.com/fwlink/?LinkID=98774&lt;/A&gt;&lt;BR&gt;Models:&amp;nbsp;&amp;nbsp;&lt;A href="http://go.microsoft.com/fwlink/?LinkID=98775" mce_href="http://go.microsoft.com/fwlink/?LinkID=98775"&gt;http://go.microsoft.com/fwlink/?LinkID=98775&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; took down the traffic link.&amp;nbsp; If you are interested in traffic data, please see here:&amp;nbsp; &lt;A href="http://msdn.microsoft.com/en-us/library/bb877877.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb877877.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9534085" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Virtual+Earth+3D/default.aspx">Virtual Earth 3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category></item><item><title>Actors and DataSources</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/10/27/actors-and-datasources.aspx</link><pubDate>Mon, 27 Oct 2008 23:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9019051</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/9019051.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=9019051</wfw:commentRss><description>&lt;P&gt;In this sample, we create a DataSource, which is a class that can be used for large-scale data sets.&amp;nbsp; It provides hooks into the system's spatial index, memory cache, and background data threads.&amp;nbsp; Data from the DataSource will only be requested when it is in view, and will be automatically cached according to how often it is used and how much memory it consumes.&amp;nbsp; The DataSource we create is a purely generated one consisting of a large number of animated bunnies spread&amp;nbsp;evenly across the globe, and would be impossibly large to try to deal with all at once.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Bunny Sample" href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm"&gt;&lt;IMG title="Bunny Sample" style="WIDTH: 916px; HEIGHT: 685px" height=685 alt="Bunny Sample" src="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/sample.jpg" width=916 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Bunny Sample" href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/ActorDataSource/TestPage.htm"&gt;See it in action!&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the PlugIn is Activated, the ActorDataSource is created and added to the system.&amp;nbsp; When we create the DataSource we set up its Ontology, which is a system for defining the type of data the DataSource contains.&lt;/P&gt;
&lt;P&gt;The next time the Camera Query runs, a set of areas in the Spatial Index that are in view are determined,&amp;nbsp;called tiles.&amp;nbsp; Each tile is sent as a lat/long bounding box to the Data Threads, which call all added DataSources, including ours.&amp;nbsp; The entry point here is QueryPrimitivesInternal.&amp;nbsp; In this function we would normally do some sort of query to a backend, such as a SQL database or the network, but for simplicity we simply create a BunnyPrimitive in the center of the query region.&amp;nbsp; A primitive is a piece of data that represents a thing in the world, in the case a Bunny, but is not itself an Actor.&amp;nbsp; When we return the Primitive, it is passed to our ActorBuilder, called BunnyBuilder.&amp;nbsp; This creates actual Actors which can render or react to the data&amp;nbsp;represented by each Primitive.&amp;nbsp; Each Actor also needs an ActorBounds, which represents a spatial area that, when&amp;nbsp;in view, should cause it to render.&amp;nbsp; When this happens each Actor's Update and Render functions are called on the Render Thread just like normal Actors.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Get the code!" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;Get the code!&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9019051" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Actor/default.aspx">Actor</category></item><item><title>Terrain Imagery Overlays</title><link>http://blogs.msdn.com/virtualearth3d/archive/2008/10/12/terrain-imagery-overlays.aspx</link><pubDate>Sun, 12 Oct 2008 20:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8996717</guid><dc:creator>NikolaiF</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/virtualearth3d/comments/8996717.aspx</comments><wfw:commentRss>http://blogs.msdn.com/virtualearth3d/commentrss.aspx?PostID=8996717</wfw:commentRss><description>&lt;P&gt;There are four ways to add custom imagery to VE3D.&amp;nbsp; The first three involve using built-in classes, and you just have to provide information on where to get the data.&amp;nbsp; The fourth involves implementing your own DataSource.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Terrain Image Overlays" href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm"&gt;&lt;IMG title="Terrain Imagery Overlays" style="WIDTH: 737px; HEIGHT: 529px" height=529 alt="Terrain Imagery Overlays" src="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/sample.jpg" width=737 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Terrain Image Overlays" href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/TerrainImages/TestPage.htm"&gt;See it in action!&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sample demonstrates how to add common terrain imagery data to the world, and adds a simple tour to display the example data sets.&amp;nbsp; We then use two events, one a built in data load event, and the other a custom event we created using the Step class, to tell the control to FlyTo a series of locations.&lt;/P&gt;
&lt;P&gt;When the PlugIn is Activated, we create three datasources using built-in settings.&amp;nbsp; The first uses a SingleImageDataSource, which reads data from a Bitmap object in memory and draws it on the terrain.&amp;nbsp; The second uses a "content manifest", which is an xml file that describes the data, how to display it, and where to get it.&amp;nbsp; An example is &lt;A class="" title="Aerial with Labels manifest" href="http://maps.live.com/Manifests/HT.xml" target=_blank mce_href="http://maps.live.com/Manifests/HT.xml"&gt;here&lt;/A&gt;.&amp;nbsp; The last uses a parameter string, and is similar to &lt;A class="" title=VETileSourceSpecification href="http://msdn.microsoft.com/en-us/library/bb544970.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/bb544970.aspx"&gt;VETileSourceSpecification&lt;/A&gt;.&amp;nbsp; The % replacement variables in tilesource have the same numbers as those listed at the top of the xml manifest.&amp;nbsp; The parameter string is also a good method for adding WMS server data.&lt;/P&gt;
&lt;P&gt;It is also possible to create your own datasources.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Mandelbrot Image DataSource" href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm"&gt;&lt;IMG title="Mandelbrot Image DataSource" style="WIDTH: 829px; HEIGHT: 663px" height=663 alt="Mandelbrot Image DataSource" src="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/sample.jpg" width=829 mce_src="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/sample.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Mandelbrot Image DataSource" href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm" target=_blank mce_href="http://www.veteam.members.winisp.net/Spaceland/Samples/Mandelbrot/testpage.htm"&gt;See it in action!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This sample demonstrates how to add terrain imagery via a custom datasource.&amp;nbsp; This one generates a colored Mandelbrot set.&lt;/P&gt;
&lt;P&gt;When the PlugIn is Activated, we create our DataSource and add it to the system.&amp;nbsp; We also save off any existing datasources so we can add them back again later.&amp;nbsp; Once it is added, the data threads query it when we move into a new area, entering at QueryPrimitivesInternal.&amp;nbsp; We use the bounding area of the query to generate an appropriate section of the Mandelbrot set, and return it as a rasterized image.&amp;nbsp; This image is then displayed by the system.&lt;/P&gt;
&lt;P&gt;This method is good if you have special request logic, or want to do some of the work client-side (in this case, all the work is client-side).&amp;nbsp; This saves you from having to have a large server dataset of pre-rendered tiles, or execute expensive code on your servers.&amp;nbsp; There are notes in the sample code for how to use this code to get information about the area you are looking at and generate appropriate request URLs, etc.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Sample code" href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx" mce_href="http://blogs.msdn.com/virtualearth3d/archive/2008/09/25/current-samples.aspx"&gt;Get the code!&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8996717" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/VE3D/default.aspx">VE3D</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/Plug-In/default.aspx">Plug-In</category><category domain="http://blogs.msdn.com/virtualearth3d/archive/tags/DataSource/default.aspx">DataSource</category></item></channel></rss>