Monday, March 15, 2010

Tilecaching MXD/ArcGIS Server to file/folder-based only (e.g. google, mapnik)

So it seems like there's no automated way to go from mxd to file/folder based (rather than web service) tile cache. The best I could do was use maptiler/gdal2tiles (maptiler is a very nice gui for gdal2tiles) to cache raster layers. This will fuse multiple raster layers, but doesn't handle vectors. If you want to pass vectors through here you can always convert to raster with some other tool but you'll end up loosing any scale dependencies. Please note, you'll likely have to incorporate a part of their auto-generated code for google maps, since the file naming doesn't completely conform to x/y/z google scheme naming. I've included my modified tile provider class for the gmap_overlays submodule (part of the gmap addons submod collection ... lives in PATH_TO_DRUPAL\sites\all\modules\gmap_addons\gmap_overlays\js), which handles output from maptiler/gdal2tiles.

note: exposing as wms and using tilecache might be a good idea, but this non-automated solution that is OK for me right now

Thursday, March 11, 2010

AGS error: #000569: Failed to generate cache. All server contexts failed to cache map.

I was getting the following error when trying to cache a map service in ArcGIS Server/ArcCatalog: 000569: Failed to generate cache. All server contexts failed to cache map.

I ultimately resolved this issue by upgrading my server software (ArcGIS Desktop) to the same version as my client (in my case 9.3.1 service pack 1). Caching only within a feature, which in my case was a three county polygon that was much larger than the area I wanted to cache, greatly improved performance ... I'm not sure if it even would have worked without that.

Note: if postinstallation hangs while upgrading server software check out this post:

Thursday, March 4, 2010

Drupal SWFTools Error

Was getting the following error: "You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly." on Chrome and I.E. only. Figured out that by changing the embed method under Embedding settings (Home>Administer>Site configuration>SWF Tools>Embedding settings) back to "Direct embedding - do not use JavaScript replacement" from " SWFObject 2 - JavaScript" I no longer get this error

Tile basemap through Views/GMaps module (Drupal)

To add a tiled basemap to a gmap created with views (and the gmaps) module:

1. First make sure that you have a gmap set up through views. This is a good tutorial:

2. Next download the GMap Addons module, if you haven't already done so

3. Create a map tile structure using something like tilecache, mapcruncher, or ArcGIS (you can generate a map with the google maps scheme, just not sure where to get an xml that would adequately describe the scheme to ArcGIS)

4. Finally add a tile overlay macro within the style (GMap) configuration for this view. Use the following form:

[gmap |overlay=tile:http://host/tilesdirectory/{Z}/{X}/{Y}.png]

... notice you don't need to substitute anything for Z, X, or Y ... these correspond to folder numbering as generated with tilecache (or other tiling program) using the google maps scheme.

If you save the view you should now be able to see your basemap in a page generated by that view.