Condividi tramite


Terrain Imagery Overlays

There are four ways to add custom imagery to VE3D.  The first three involve using built-in classes, and you just have to provide information on where to get the data.  The fourth involves implementing your own DataSource.

Terrain Imagery Overlays

See it in action! 

This sample demonstrates how to add common terrain imagery data to the world, and adds a simple tour to display the example data sets.  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.

When the PlugIn is Activated, we create three datasources using built-in settings.  The first uses a SingleImageDataSource, which reads data from a Bitmap object in memory and draws it on the terrain.  The second uses a "content manifest", which is an xml file that describes the data, how to display it, and where to get it.  An example is here.  The last uses a parameter string, and is similar to VETileSourceSpecification.  The % replacement variables in tilesource have the same numbers as those listed at the top of the xml manifest.  The parameter string is also a good method for adding WMS server data.

It is also possible to create your own datasources.

Mandelbrot Image DataSource

See it in action!

This sample demonstrates how to add terrain imagery via a custom datasource.  This one generates a colored Mandelbrot set.

When the PlugIn is Activated, we create our DataSource and add it to the system.  We also save off any existing datasources so we can add them back again later.  Once it is added, the data threads query it when we move into a new area, entering at QueryPrimitivesInternal.  We use the bounding area of the query to generate an appropriate section of the Mandelbrot set, and return it as a rasterized image.  This image is then displayed by the system.

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).  This saves you from having to have a large server dataset of pre-rendered tiles, or execute expensive code on your servers.  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.

Get the code!

Comments

  • Anonymous
    October 12, 2008
    PingBack from http://www.easycoded.com/terrain-imagery-overlays/

  • Anonymous
    October 18, 2010
    I've been runing Bing Maps 3D with manual rendering and custom terrain using the Mandelbrot plugin as an example and it has been working fine. However when I move everything to offline machines, which I am unable to connect to the internet, I find that the Mandelbrot Data Source is being called via QueryPrimitivesInternal(...), but the patches that are returned aren't being rendered on the globe. Is there any reason why an offline machine which has never been connected to the Internet wouldn't be able to render the textures and elevations coming from custom data sources? i.e. does Bing Maps 3D need to activate itself when you first run it as I notice that it is making some pki request to a microsoft server.

  • Anonymous
    October 19, 2010
    I've worked out I just need to feed it this file crl.microsoft.com/.../WinIntPCA.crl and then it seems to work.