wiki:FdoGdalNotes

Version 6 (modified by tomfukushima, 17 years ago) ( diff )

Change for rc2

FDOGDAL Raster Provider

The fdogdal provider is the open source raster provider for FDO (and hence MapGuide). It is implemented on top of the 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

For MapGuide Users

Using fdogdal in Autodesk MapGuide Studio

To publish rasters using the open source raster provider with 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 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
  1. If desired install the ECW and MrSID packages according to the instructions on Frank's site
  1. 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
  1. 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.
  1. 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.
  1. 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.
  1. 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:
<?xml version="1.0" encoding="utf-8"?>
<FeatureSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="FeatureSource-1.0.0.xsd">
  <Provider>OSGeo.Gdal</Provider>
  <Parameter>
    <Name>DefaultRasterFileLocation</Name>
    <Value>c:\RasterTest\nanaimo</Value>
  </Parameter>
  <ConfigurationDocument>config.xml</ConfigurationDocument>  
</FeatureSource>

  1. Use the MapAgent SetResource call to upload the modified FeatureSource document into the same location that you downloaded it from.
  1. 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.
Note: See TracWiki for help on using the wiki.