[UMN_MAPSERVER-USERS] itemnquery mode and postgis help

Zamil Murji Zamil.Murji at DIVESTCO.COM
Fri Jan 14 14:53:24 EST 2005


Skweda and list,

I've taken into account some of the things you have said and I have changed my command to:
./mapserv QUERY_STRING="mode=itemnquery&map=/mapfiles/idcdev_canada-itemnquery.map&qlayer=wells&map_wells_filter=%2F100032300505W500%7C200B067H082G0700%2F&uwi=100032300505W500&uwi=200B067H082G0700&layers=wells+wells-selected"

All the extra stuff was there because I was trying to use a working nquery command. I have taken out the source parameter, however, the uwi (= unique id) is what I would like to filter with.

Thanks
Zamil

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
Behalf Of Skweda O'Bomsawin
Sent: Friday, January 14, 2005 12:20 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] RE : [UMN_MAPSERVER-USERS] itemnquery
mode and postgis help


Zamil,

I am frequently using itemnquery in cgi mode with PostGIS data and it works
very well.  

There is a lot of things confused in your query string:

        - Use a mapext instead of a imgext
        - the MAXY coordinate of your imgext (mapext) is missing
        - Since you have an imgbox, I understand you want to do a nquery not
an itemnquery (itemnquery is for selecting data based on a query in the
table VS a nquery wich is for selecting data spatially), so change the mode
to nquery
        - I don't know the "source" parameter.  Are you using it somewhere
in your code???
        - The same goes for "uwi"

Let's give it a try with these corrections...

Skweda

-----Message d'origine-----
De : UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] De la
part de Zamil Murji
Envoyé : 14 janvier 2005 13:53
À : MAPSERVER-USERS at LISTS.UMN.EDU
Objet : [UMN_MAPSERVER-USERS] itemnquery mode and postgis help

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&img
ext+3674226.39765+-183134.22738+3676417.48504&mapsize=688+434&imgbox=195+11+
570+401&source=TIG600&qlayer=wells&map_wells_filter=%2F100032300505W500%7C20
0B067H082G0700%2F&uwi=100032300505W500&uwi=200B067H082G0700&layers=wells+wel
ls-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

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 2005-01-12
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 2005-01-12
 



More information about the mapserver-users mailing list