Friday, March 16, 2007

How to get source image from site created using mapcruncher?

Last week I were told by one of my colleagues to include the image of London 2012 in our POC project for Virtual Earth API's. The site was showing the Olympic stadiums to be build in London.

So first task was for me to extract the source image from that site, first feeling said it is not possible but the xml structure that microsoft research provides for map cruncher projects shows me the path to do so!

  • First of all consider that the site name is www.xyzCrunch.com where the crunched map is hosted.
  • Next step is to get the MapLayers.Crunched xml from this site, so it would be www.xyzCrunch.com/MapLayers.crunched.xml This file contains the name of crunch project in its header against attribute "SourceMashupFilename"; assume it is SourceData/xyzCruch.yum.xml.
  • Now we got the project file name, so open the project xml file , it would be www.xyzCrunch.com/SourceData/xyzCruch.yum.xml.
  • The name of the image file gets stored with each layer and the name of the image file is stored as value for SourceMapFilename attribute under SourceMap element node.The name of the file is xyz.png.
  • Now last step, we have file name & we will get that file from www.xyzCrunch.com/SourceData/xyz.png.
Remember that the Sourcedata folder contains the Map Cruncher project(.YUM) in the xml format & it also contains the source images for each layer.

So, Enjoy Crunching!

No comments:

Post a Comment