Monday, January 21, 2008
Posted on Monday, January 21, 2008 6:36:06 PM (Mountain Standard Time, UTC-07:00)  Comments [3] | 
Categories: ArcGIS Server | ASP.NET

I keep getting more requests for the code, so I'm just going to put it up here. I sent the code out to a bunch of people over the weekend, and I thought I should put the same disclosure here...

As I said in the posting - this is really hacked up, pure "can it work" research code – it’s based on Rob Blackwell’s VE WMS Tile Server sample, with some “create a map” stuff from the AGS SOAP documentation added, and a few lines of projection stuff smashed in.

Known Issues:

Currently the projection is not exactly right, the caching stuff is just plain ugly, and requires that ASPNET (or whatever identity you run the handler as) have write access to the hard coded path. All the tiles are stored in the same folder, which clearly won’t scale. The Handler matches *.png, which means you need to map that extension to the aspnet_isapi.dll for the web application you drop this into. The SOAP end point is poorly named. And there are no comments of any use.

So – I think that about covers it – you have been warned! That said have fun with it, and let me know how it goes.

Download

Monday, January 21, 2008 6:35:50 PM (Mountain Standard Time, UTC-07:00)
I've gone towards using a Generic handler (i.e. a ASHX file) in .NET versus mapping .png files. That way you don't have to modify the web.config file or make the aspnet_isapi.dll mapping for your application in IIS. I'm not certain, but it might be as easy as copying and pasting the contents of the VEHttpHandler.cs file into an ASHX file and having your VE Tile Layer reference that handler file, i.e. http://myserver/myapp/myvetilehandler.ashx?%4.png

As far as your caching goes, I would set it to only cache images down to a certain zoom level. As you start zooming in closer, your map rendering engine's ability to generate a dynamic image on the fly makes dealing with tens or hundreds of thousands of tile images unnecessary (at least, that's my experience thus far).

This tile layer capability makes VE a tremendous map publishing platform.
Tim Maddle
Tuesday, January 22, 2008 11:15:39 PM (Mountain Standard Time, UTC-07:00)
Tim,

Thanks for the comment - I actually arrived at this same solution while flying out to Tahoe - I'm using a path=*/tiles/*.ashx so that this handler deals with any ashx requests under the tiles path. I ended up here because my notebook is running vista and I can't see to get VS2005 to place nice with IIS7 on Vista Home Premium!

I also like your idea about only caching down to some level - good tradeoff between storage and performance.

Thanks!

Dave
Sunday, January 27, 2008 6:51:22 AM (Mountain Standard Time, UTC-07:00)
Taking this one step further, if you want your tiles to update automatically on a certain schedule, you could incorporate a date into the tile filename and either determine the appropriate date on the fly with each request or maintain an application variable with that data. If you want to refresh the tiles every week and you reboot your server every week, it would be easy enough to refresh the tile date variable when the server reboots. What would be a little trickier is if you have multiple layers that need to be refreshed on different schedules, but it would still be very doable.
Tim Maddle
Comments are closed.