[Gdal-dev] ogr_miattrind.cpp dependency

Frank Warmerdam warmerdam at pobox.com
Mon Feb 6 08:37:53 EST 2006


On 2/6/06, Mateusz Łoskot <mateusz at loskot.net> wrote:
> Hi,
>
> As I revealed ogr\ogrsf_frmts\generic\ogr_miattrind.cpp file
> is dedicated to MapInfo and has nothing to do with other drivers.
> Am I right?
>
> If I am, then why it seems to be required dependency even if I want to
> build only shapefile support.
> Generic OGRLayer::InitializeIndexSupport
> calls OGRCreateDefaultLayerIndex and the only implementation of
> OGRCreateDefaultLayerIndex function is available from ogr_miattrind.cpp
> file:
>
> OGRLayerAttrIndex *OGRCreateDefaultLayerIndex()
> {
>      return new OGRMILayerAttrIndex();
> }
>
> But as I said, ogr_miattrind.cpp is coupled with MapInfo driver, so
> currently there is no way to build OGR with shapefile driver but without
> MapInfo driver.
> Am I right or I've missed something while analysing OGR sources.

Mateusz,

You are correct that you cannot currently build the shapefile
driver without also having the mapinfo driver.  The ogr_mitattrind.cpp
implements a "generic" attribute indexing mechanism that other
drivers can use.  But it is implemented using mapinfo TAB format,
hence the dependency.  Currently only the shapefile driver uses
this indexing mechanism.

I think the best solution to this would be to add some sort
of build/preprocessor magic so that if the mapinfo driver isn't
included in a build, the attribute indexing will also be dropped.
This may be a bit messy.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list