itemnquery mode and postgis help
Zamil Murji
Zamil.Murji at DIVESTCO.COM
Fri Jan 14 10:53:00 PST 2005
Hello,
I'm having trouble getting info using itemnquery cgi mode. I have found many examples that use shapefiles but I have yet to see one that uses postgis. So, I'm having a bit of trouble getting info from the db.
Here is how I run the command:
./mapserv QUERY_STRING="mode=itemnquery&map=/mapfiles/idcdev_canada-itemnquery.map&imgext+3674226.39765+-183134.22738+3676417.48504&mapsize=688+434&imgbox=195+11+570+401&source=TIG600&qlayer=wells&map_wells_filter=%2F100032300505W500%7C200B067H082G0700%2F&uwi=100032300505W500&uwi=200B067H082G0700&layers=wells+wells-selected"
It comes back with:
Content-type: text/html
<HTML>
<HEAD><TITLE>MapServer Message</TITLE></HEAD>
<!-- MapServer version 4.2-beta2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=EPPL7 INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE -->
<BODY BGCOLOR="#FFFFFF">
msQueryByAttributes(): Query error. No query expression defined. <br>
Here is my mapfile (BTW, nquery works with this mapfile - I've been using http://maps.dnr.state.mn.us/mapserver_demos/tests40/itemquery/case2.map as an example):
NAME TEST1
PROJECTION
"proj=merc"
"lat_ts=54.458353"
"lon_0=-111.729444"
"ellps=GRS80"
"datum=NAD83"
END
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 255 255 0
END
LAYER
NAME "wells"
# DEBUG on
TYPE point
STATUS off
MAXSCALE 800000
CONNECTIONTYPE postgis
CONNECTION "user=idc dbname=idc host=idcmap port=5432"
# DATA "the_geom from main_well2"
DATA "the_geom from (select oid, to_date(main_well2.spud_date, 'YYYY-MM-DD') as pretty_spud_date, to_date(main_well2.rig_release_date, 'YYYY-MM-DD') as pretty_rig_release_date, prettyuwi(main_well2.uwi) as prettyuwi, well_status(plot_symbol) as well_status, * from main_well2) as new_table using unique oid"
TEMPLATE "./idcdev_wells.html"
PROJECTION
"init=epsg:4269"
END
END
END
Any help would be appreciated
More information about the MapServer-users
mailing list