Thursday, 6 June 2013

MapGuide tidbits: The GDAL and OGR FDO providers

Here's a some tidbits about the GDAL and OGR FDO providers that come with MapGuide Open Source.

What version of GDAL/OGR?

If the name of the dll didn't give it away, the latest stable release of MapGuide Open Source (2.5) uses GDAL and OGR FDO providers compiled with GDAL 1.9. For older releases, just looking at the name of the gdal dll in the FDO directory should easily tell you what version we're working with.

What drivers/formats are supported?

When building FDO, GDAL/OGR is built with default settings, so whatever format that GDAL or OGR says it's compiled by default, said formats will probably also work out of the box with the GDAL and OGR providers that come with MapGuide.

For the OGR provider, what do you put in for the "DataSource" connection parameter?

The same thing you would put in for a data source in ogrinfo.exe, ogr2ogr.exe, etc. Some examples:

  • MapInfo:  The directory containing your tab files
  • ESRI Shapefiles: The directory containing your shapefiles. (arguments about why you're not using the SHP FDO provider aside)
  • GeoJSON: The GeoJSON file path or URL
When in doubt, consult the OGR drivers page to see how to build the OGR connection string for your particular data source.

Test the connectivity with ogrinfo.exe, if it gives you the all clear, that's what you plug in as the DataSource parameter for the OGR provider.

It goes without saying that having a separate standalone GDAL/OGR installation present will greatly help in this matter. If the OGR FDO provider has issues accessing a given data source, you can run the same data source through ogrinfo.exe to see if it has the same issues.

I need support for a format/driver that's not compiled by default

Hop on over to gisinternals and grab the equivalent GDAL binary package. Make sure that it's for the same GDAL/OGR version that MapGuide is using and is built with the same MSVC compiler that was used to build MapGuide and FDO. For the current stable release of FDO (3.8), you need a MSVC2010 compiled version of GDAL 1.9

For raster formats like ECW, you need to make sure any GDAL plugins paths are set up properly. There's wiki-fied instructions for MapGuide Open Source 2.2 and an updated discussion thread for MapGuide Open Source 2.4. 2.5 uses the same GDAL version so instructions should be pretty much the same.

Hope this helps

1 comment:

Gabriele said...

To support other driver in Linux, you can compile gdal/ogr by yourself, choosing the stable version in 1.9 branch, currently 1.9.2.
It's very easy and quick to do.

This allow to obtain bugfixes and enhancements made in the library.

For instance you can use ogr provider to connect to PostgreSQL/PostGIS (instead of using the FDO PostgreSQL provider)