JOIN / ODBC

Frank Warmerdam warmerdam at POBOX.COM
Wed Nov 23 11:20:21 EST 2005


On 11/23/05, robert fritz <robert-fritz at web.de> wrote:
> Hello,
>
> it is possible to join a layer to an odbc database. i use the join to an access database::
>
>
> GROUP "G_BPLiv"
> NAME "BPLiv"
> TYPE POLYGON
> STATUS ON
> CONNECTIONTYPE OGR
> CONNECTION "D:\MS_Data\fgt\data\shapes\satzungen\bplaene_iv.shp"
>
> DATA "SELECT * FROM bplaene_iv LEFT JOIN 'ODBC:satz_blp'.satzungen ON bplaene_iv.DB_ID = Satzungen.SATZUNGSID"

Robert,

I think this should work.  I would suggest you
test it first with ogrinfo and see if that works.

eg.

ogrinfo -ro D:\MS_Data\fgt\data\shapes\satzungen\bplaene_iv.shp \
      -sql "select ..."

If the Satzungen.SATZUNGSID field isn't indexed performance will
be very poor.  In any event performance isn't likely to be great if you are
dealing with a very large number of features, since a new SELECT on
a particular ID will be issued to the ODBC datasource for each record
selected from the shapefile.

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 mapserver-users mailing list