[gdal-dev] Auto-selection of geometry column for MS SQL Server is not restrictive enough

Dan Homerick danhomerick at gmail.com
Wed Oct 26 13:29:31 EDT 2011


The current logic for detecting the geometry or geography column will
accept a column of type "image" (a subset of binary string[1]) as the
GeomColumn. Furthermore, the logic checks the column types
sequentially, and will accept an "image" column as the GeomColumn,
even if there is a "geometry" or "geography" later in the list of
columns.

I came across this by trying to do queries on a table which does not
have any spatial data, but which does have column of type "image". The
image column was incorrectly assumed to be a geometry column, which
naturally led to errors. This was despite NOT using "OGRSQL" as the
dialect.

There doesn't appear to be any interface to specify which, if any,
column should be used as the GeomColumn -- am I (hopefully!) just
overlooking something?

[1] http://msdn.microsoft.com/en-us/library/ms187752.aspx

- Dan


More information about the gdal-dev mailing list