[gdal-dev] OGR and SpatiaLite

Brent Fraser bfraser at geoanalytic.com
Fri Mar 12 11:27:44 EST 2010


Thanks!  I keep forgetting about those builds.

But I do think the SQLite driver should report if it supports SpatiaLite.  For 
example, in ogrsqlitedriver.cpp have something like:


const char *OGRSQLiteDriver::GetName()

{
#ifdef HAVE_SPATIALITE
     return "SQLite+SpatiaLite functions";
#else
     return "SQLite";
#endif
}

   Although looking at the driver code, the support really isn't as simple as 
that.  As the OGR driver doc mentions the OGR implementation of SQLite will read 
and write SpatiaLite databases, it just will not do spatial indexes or 
SpatiaLite spatial functions (as these are in the code library, not in the 
database as Stored Procedures as with other spatial database types like 
PostGIS).  But it WILL read and write SpatiaLite's flavour of geometry, and 
create SpatiaLite-compatible databases (it even creates the geometry_columns and 
spatial_ref_sys tables!).  I think these points need to be stated explicitly in 
the driver doc.

Best Regards,
Brent Fraser

Tamas Szekeres wrote:
> Check out the recent builds from here:
> http://vbkto.dyndns.org/sdk/
> 
> Those have been compiled with spatialite support.
> 
> Best regards,
> 
> Tamas
> 
> 
> 
> 2010/3/11 Brent Fraser <bfraser at geoanalytic.com 
> <mailto:bfraser at geoanalytic.com>>
> 
>     Tamas,
> 
>      I was afraid of that.  I'm having trouble getting MS4W 3 Beta 10's OGR
>     to read my SpatiaLite database.  I suspect it's because SpatiaLite was
>     not compiled in (I'm a SQLite newbie so I'm not sure); but there's no
>     way to tell.
> 
>     Thanks!
>     Brent
> 
>     >  Brent,
>     >
>     >  It should be "SQLite" in both cases.
>     >
>     >  Best regards,
>     >
>     >  Tamas
>     >
>     >
>     >  2010/3/11 Brent Fraser <bfraser at geoanalytic.com
>     <mailto:bfraser at geoanalytic.com>>
>     >
>     > > What would "ogrinfo --formats" show if GDAL was compiled with
>     > > HAVE_SPATIALITE set?
>     > > What would it show if only SQLite (and not SpatiaLite) was
>     compiled in?
>     > >
>     > > Thanks!
>     > > Brent Fraser
>     > >
>     > >
>     > > _______________________________________________
>     > > gdal-dev mailing list
>     > > gdal-dev at lists.osgeo.org <mailto:gdal-dev at lists.osgeo.org>
>     > > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>     > >
>     >
> 
> 
> 
> 



More information about the gdal-dev mailing list