wiki:FdoGdalNotes

Version 25 (modified by warmerdam, 16 years ago) ( diff )

Added Jason Birch's details on coordinate system overrides.

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.

Index

Documentation

MrSID and ECW Plugin Support (Windows)

MrSID and ECW are popular wavelet compression formats used for imagery. Support for these formats is not included in the official FDO or MapGuide releases due to licensing issues, but you can add GDAL plugins for these formats to your installation.

Make sure to read the appropriate license agreements (MrSID , ECW) and if you agree then follow these instructions for your version of FDO/MapGuide.

FDO 3.2.0 / MapGuide 1.1.0

The plugins for this version of FdoGdal are available here:

http://home.gdal.org/dl/mapguide/

Follow the instructions in the readme file (http://home.gdal.org/dl/mapguide/README.txt), downloading and unzipping the files mg_fdogdal_110.zip, mg_ecw.zip, and/or mg_mrsid.zip into your MapGuideOpenSource/Server/Bin directory

FDO 3.2.3 / MapGuide 1.2.0

The plugins for this version of FdoGdal are available here:

http://home.gdal.org/dl/mapguide/

Only download and unzip the mg_ecw.zip and/or mg_mrsid.zip files into your MapGuideOpenSource/Server/Bin directory

FDO 3.3.0 / MapGuide 2.0.0

This version uses the standard Visual C 2005 GDAL plugins:

http://home.gdal.org/dl/gdal14_vc8/

There are three files in this directory:

  • ecw_plugin_gdal14_vc8.zip : ECW GDAL Plugin
  • mrsid_plugin_gdal14_vc8.zip : MrSID GDAL Plugin
  • gdal144_vc8_sdk.zip : Do NOT download, not required for MapGuide or FDO.

Each file contains a "gdalplugins" folder, as well as some dlls in the root of the zipfile. To install these plugins into MapGuide, you need to:

  1. Extract the zipfile to a temporary location
  2. Copy the "gdalplugins" folder to the MapGuide installation directory under Server/Bin/
  3. Copy the dll files that unzipped into the root of the temporary location to the MapGuide installation directory under Server/Bin/Fdo/

The final location for the ECW files should look something like this:


 Server/Bin/Fdo/libecwj2.dll
 Server/Bin/gdalplugins/gdal_ECW.dll

And for the MrSID files, like this:


 Server/Bin/Fdo/lti_dsdk_cdll.dll
 Server/Bin/Fdo/lti_dsdk_dll.dll
 Server/Bin/gdalplugins/gdal_MrSID.dll

Using with 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 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:

  • In MapGuide 1.1, the layer definition preview does 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.

Overriding Coordinate Systems

MapGuide 2.0 requires that the coordinate system of the data source matches the coordinate system of the map it is being displayed in. If the file lacks a coordinate system or has one that does not match the map coordinate system though it ought to you can override the coordinate system as part of the FDO connection.

In MapGuide Maestro, there is a section called "Coordinate system override". Click on the "Refresh" button to load in the data set's implicit coordinate system. Double-click on the "Default" entry to bring up the override dialogue, and then click on the ellipsis (...) next to "Target" to set the actual coordinate system.

In Autodesk MapGuide Studio (2008 at least), there is a section called "Set coordinate system overrides". To use it, click on the "Refresh" button to load the dataset's implicit coordinate system, highlight the default spatial context, and then click on "Edit" to bring up a coordinate system picker.

Creating Tile Index Config Files

Please note that this only applies to FDO 3.2.3 and MapGuide 1.2 or greater.

If you have a lot of raster images in a single directory, it can be prohibitively slow to read through all of these images just to display a small area of them.

With the release of FDOGDAL 3.2.3, Frank has added support for tile indexes in an XML config file.

MapGuide Maestro will allow you to create these tile indexes in an intuitive GUI.

If you prefer a web-based application, you can easily create a new tile-enabled data connection by running a script that Jason has provided, but this script will likely not be maintained going forward. Usage notes are included:

View Source | README | Zip Download

Debugging Rasters in MapGuide

If your rasters are not showing correctly in MapGuide, 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

In MapGuide 2.0 the raster coordinate system and the map coordinate system MUST be the same. If not, you will recieve an error in the MapGuide log file. Also not that the two coordinate systems must be excatly the same, not just logically equal. If the coordinate systems are logically equal (ea. has the same coordinate values) a coordinate system override must be added to the feature source.

Development Status

This is just a quick reference of outstanding issues / working points

#111
GDAL Override schema does not show bounds support
#654
GDAL FDO does not handle rotate images
#687
GDAL Provider memory leak
#820
FDO GDAL as multithreading data provider
#985
Update GDAL to 3.x
#994
Ship supporting GDAL/OGR tools and data
#995
Open should actually try to GDALOpen the data source in question to test if it valid
#1001
Where possible, the GDAL provider should try to include the result of CPLGetLastErrorMsg() in its exception message before throwing

Note: See TracWiki for help on using the wiki.