[mapserver-users] GetFeatureInfo using MySQL join
Dejan Gambin
dejan.gambin at coin.hr
Mon Sep 12 05:03:53 PDT 2011
Hi,
After solving my compile problem (thanks to thomas), I need to do GetFeatureInfo to a shape layer joined to MySQL table (non-spatial join).
I compiled MapServer with MySQL support and everything seems ok, but "mapserv -v" doesn't return "INPUT=MYSQL". Is it supposed to anyway? Or it is enough to be compiled with gdal/ogr that supports MySQL?
Because - when I do this:
ogrinfo -sql "SELECT * FROM my LEFT JOIN 'MYSQL:gis,host=localhost,user=gis,password=gis'.katastar_vodnjan ON my.KO_KC=katastar_vodnjan.broj_ko_kc" /var/www/data/vodnjan/my.shp
I get all the attributes from shape (dbf) and MySQL, so everything seems fine
But using thi:
LAYER # katastar vodnjan poligoni
NAME "mylayer"
STATUS ON
CONNECTIONTYPE ogr
CONNECTION "/var/www/data/vodnjan/my.shp"
DATA "SELECT * FROM my LEFT JOIN 'MYSQL:gis,host=localhost,user=gis,password=gis'.katastar_vodnjan ON my.KO_KC=katastar_vodnjan.broj_ko_kc"
TYPE POLYGON
...
I don't get any information with GetFeatureInfo. The request is like:
http://www.coin.hr/cgi-bin/mywms61?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=5403800,4981350,5403980,4981460&SRS=EPSG:31275&WIDTH=400&HEIGHT=300&LAYERS=katastar_vodnjan_poligon&STYLES=&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=mylayer&INFO_FORMAT=gml&X=200&Y=100
Using the same request with regular mapfile:
LAYER # katastar vodnjan poligoni
NAME "mylayer"
STATUS ON
DATA "my"
TYPE POLYGON
...
returns one feature and its attributes from the dbf (tha is OK)
I have also tried with JOIN clause in LAYER part, but this doesn't work either. Do I have to use owf? Am I doing something wrong?
regards, dejan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110912/0ea48afd/attachment.htm>
More information about the MapServer-users
mailing list