[mapserver-users] WFS from database WKT: CONFIG "ODBC_OGR_FID" problem with text field

CrispinF crispinf at esdm.co.uk
Tue Mar 9 10:26:28 EST 2010


Hi all
Mapserver 5.6 WFS generated from WKT in SQL Server 2000 database. Connecting
with:
CONNECTIONTYPE OGR
CONNECTION "ODBC:username/pwd at DSNname,viewname(geometryfieldname)"
PROCESSING "CLOSE_CONNECTION=DEFER"

All works fine for WMS, but for WFS requests I see the same SQL executed at
the server for every record, along these lines
Select * from viewname WHERE XMAX > 545000.00000000 AND XMIN <
550786.00000000 AND YMAX > 260040.00000000 AND YMIN < 270000.00000000
which works OK for small areas, but is tragic for larger ones.
>From posts on these lists I realised MapServer cannot work out which is the
PK, so I added this setting
CONFIG "ODBC_OGR_FID" "UID"
But IF my "UID" field is text, then it breaks my WFS completely. In the SQL
trace I see this:
Select * from viewname WHERE UID = 0  (which gives an error, and the WFS
returns no records. I don't know where it makes up the 0 from, as that is
not in my UID field - perhaps an arbitrary rowID assigned by MS?).
Now if I make sure my table has an integer unique field, and refer to this
in the CONFIG setting, it all works fine, but this is rather inconvenient in
my scenario.
I'm thinking this is a new bug in 5.6, because we used this setting in 4.10
to make GetFeatureInfo work and it liked text fields then. 
NB this setting with a text field also breaks GetFeatureInfo - I get an
exception.
Any tips on how to make this work with text field greatly appreciated, or
perhaps confirmation that this is a bug?
thanks
Crispin
-- 
View this message in context: http://n2.nabble.com/WFS-from-database-WKT-CONFIG-ODBC-OGR-FID-problem-with-text-field-tp4702079p4702079.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list