= FDOGDAL Raster Provider = The fdogdal provider is the open source raster provider for FDO (and hence !MapGuide). It is implemented on top of the [http://www.gdal.org/ GDAL] raster library. Frank Warmerdam (warmerdam at pobox.com) is the primary author of fdogdal. Questions about the provider may asked on the fdo or mapguide users lists. = Documents = * [http://fdo.osgeo.org/fdogdal/index.html User Documentation] * [http://fdo.osgeo.org/files/fdo/docs/GDAL/index.html FDO API Documentation] = For !MapGuide Users = == Using fdogdal in Autodesk !MapGuide Studio == To publish rasters using the open source raster provider with [http://usa.autodesk.com/adsk/servlet/index?id=7176611&siteID=123112 Autodesk MapGuide Studio] use the following steps: 1. Start Studio and connect to your !MapGuide Open Source 1.1.0 server. 2. Then do File > New > Data Connection... 3. In the Connect To Data dialog that comes up, select OSGeo FDO Provider for Raster, then press OK. An editor that says "Configure a Feature Resource using the Generic Editor" will display. 4. In the Connection Properties grid, there is a !DefaultRasterFileLocation property. Click in the value column and enter the directory where your image files are. On Linux it has the form /home/thf/myimages and on Windows it has the form C:\myimages. 5. The configuration of the raster source is now complete, save the resource and start using it. Notes: * The layer definition preview will not show the raster. In order to preview the data, create a map definition and set the extents of the map to contain the raster data. If the extents are set correctly the raster data should show in the preview. == Debugging with Rasters == It can be instructive to run !MgServer.exe at the command line in interactive mode, with the CPL_DEBUG environment variable set to ON. This will report various GDAL level debugging output. At the very least this should give an idea of the files that GDAL is trying to open. eg. {{{ cd \"Program Files"\MapGuideOpenSource\server\bin set CPL_DEBUG=ON mgserver stop mgserver run }}} == Frank's fdogdal Downloads == === !MapGuide 1.1.0 === Visit the Frank's '''fdogdal 3.2.0 updates for !MapGuide 1.1.0''' download site for ecw, and mrsid support, as well as several bug fixes and features improvements: http://home.gdal.org/dl/mapguide/ There are instructions in these packages, but basically you just unzip into the C:\Program Files\!MapGuideOpenSource\Server\Bin directory. === !MapGuide 1.2.0 === !MapGuide 1.2.0 uses FDO 3.2.2, and requires a slightly different procedure. Do '''not''' download the mg_fdogdal_110.zip file from Frank's site. First, download and apply the ECW and MrSID packages from Frank's site as above. Second, obtain the [http://download.osgeo.org/mapguide/releases/1.2.0-rc2/MGOS1.2.0GDALPatch.zip MapGuide 1.2.0 gdalfdo patch] and apply it in the same manner. == Raster performance enhancements == Raster performance in the current released provider degrades when accessing many image files for a single layer. This is because there was no way of referencing the spatial bounds of each image without opening the image and asking it "Image, what are your bounds?". In order to address this problem, the raster provider's config file schema was extended (initially to meet the same need with the proprietary Autodesk raster provider) to store bounding boxes for the images in the feature source. Using this new schema as a guideline, Frank has added preliminary bounds support to the fdogdal provider, and this has been sucessfully tested in several environments. Further testing is encouraged. === Downloads === (coming soon) These files are required to test the bounds functionality: * The new fdogdal package for Jason's site (for now), which includes the same gdal.dll as is in the 1.2.0 patch package * The ECW and MrSID packages from Frank's site if desired * Jason's really crude (to be refined) php script for generating a config document which includes image boundaries. === Usage === 1. Install the new fdogdal package into the C:\Program Files\!MapGuideOpenSource\Server\Bin\FDO directory 2. If desired install the ECW and MrSID packages according to the instructions on Frank's site 3. Extend the setting for maximum_execution_time in the php.ini file to at least two minutes. This file is located at C:\Program Files\!MapGuideOpenSource\!WebServerExtensions\Php\php.ini by default 4. Place Jason's script in the C:\Program Files\!MapGuideOpenSource\!WebServerExtensions\www directory. Edit the script to point the image path to your locally stored images. Make sure to specify a trailing slash. 5. Run this script in your web browser by pointing to your !MapGuide installation (e.g. http://localhost:8008/mapguide/rasterconfig.php ). If all goes well, you should be prompted to download a config.xml file. 6. Create an OSGeo Raster Provider !DataSource (following the instructions at the top of this page) that points to the same location for the images as the config file that you generated. 7. Use the !MapAgent (http://localhost:8008/mapguide/mapagent/index.html) or Studio to download the existing !DataSource as an XML file, using the !GetResourceContent call. Edit the file, inserting a !ConfigurationDocument line, so that it looks something like this: {{{ OSGeo.Gdal DefaultRasterFileLocation c:\RasterTest\nanaimo config.xml }}} 8. Use the !MapAgent SetResource call to upload the modified FeatureSource document into the same location that you downloaded it from. 9. Again, using the !MapAgent use the !SetResourceData operation to upload the config.xml file as resource data for your modified !DataSource. Make sure that you specify the same name for the file as you entered in the !ConfigurationDocument line above. For simplicity, it's recommended to leave it as config.xml. Please, let us know how this works on the !MapGuide users, or FDO users mailing lists. === Source === Currently, the source for these modifications is only available as a patch in Ticket #87. Once stable, hopefully they will be integrated into the 3.2.x branch somehow. === Known Issues === * Currently, !MapGuide no longer checks each image when first loading the map, but the first time it does fetch the layer, each image is still enumerated. Subsequent fetches only address the images required for the area that the user is zoomed to.