[mapserver-users] DBF Queries

Francisco Delgado delgadof at marn.gob.sv
Thu Feb 7 16:08:23 PST 2002


Not exactly. I've used classes for that matter, but what I have is a dynamic
database that is growing daily and in each record I have lat/long
coordinates that should be added to the map without having to generate a new
shapefile every time records are added.

Thank you very much

Atentamente,
------------------------------------------------
Francisco Jose Delgado - Director de Informatica MARN
http://www.marn.gob.sv
delgadof at marn.gob.sv
Tel. (503) 260-5637


-----Mensaje original-----
De: Steve Lime [mailto:steve.lime at dnr.state.mn.us]
Enviado el: Thursday, February 07, 2002 5:32 PM
Para: fgclaram at alu-ab.uclm.es; pushkar at ERC.MsState.Edu;
delgadof at marn.gob.sv
CC: mapserver-users at lists.gis.umn.edu
Asunto: RE: [mapserver-users] DBF Queries


That's what classes are for. So if you have a variable named population
and you want all features with a value greater than 5000 you'd do
something like

CLASS
  NAME 'Cities with more the 5000 people in them.'
  EXPRESSION ([POPULATION] > 5000)
  COLOR 255 0 0
END

The net effect is that only those features matching the expression (a
query) are drawn. You can build these expressions dynamically or
hardcode them in a map file. I believe the mapfile how-to explains the
variety of expressions that you can do.

Is this sort of what you're looking for?

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Francisco Delgado" <delgadof at marn.gob.sv> 02/07/02 05:18PM >>>
Yes, it has changed. Now both TEMPLATE, HEADER and FOOTER definitions
go
inside the QUERY object of each LAYER object, but I think what Fran is
trying to do is to query a database that gets some records with
Latitude/Longitud data within the returned fields and plot them over
an
existing map. Could somebody tell us (I want to do the same) how to do
that?

Atentamente,
------------------------------------------------
Francisco Jose Delgado - Director de Informatica MARN
http://www.marn.gob.sv
delgadof at marn.gob.sv


-----Mensaje original-----
De: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu]En nombre de Pushkar
Pradhan
Enviado el: Thursday, February 07, 2002 1:34 PM
Para: Francisco
CC: mapserver-users at lists.gis.umn.edu
Asunto: Re: [mapserver-users] DBF Queries


Hi,
I am giving you an example from MS 3.3 I don't know whether it is
changed,
but you will get an idea of a simple query.
QUERYMAP
  SIZE 200 200
  STATUS ON
  STYLE HILITE
  COLOR 255 0 0
END
This will enable query for only this layer:
LAYER
  NAME majr
  TYPE LINE
  STATUS ON
  DATA majr

  CLASS
    NAME "Major Rivers"
    COLOR 0 0 255
  END

  HEADER "majr_header.html"
  FOOTER "majr_footer.html"
  QUERY
    TEMPLATE "majr.html"
  END

  TOLERANCE 5
END # end of layer object - major rivers
The majr.html is the main file here which contains attrib. from your
.dbf file:
<tr><td>[LENGTH]</td><td>[MAJR_]</td><td>[MAJR_ID]</td><td>[NAME]</td><td>[R
NUM]
</td></tr>
length, name etc.. are attribs. from the dbf file.
_header.html: (only for html presentation)
<font size+1><b>Layer: majr</b></font><p>
<table cellpadding=5 cellspacing=2 border=0>
<tr
bgcolor=#CCCCCC><th>LENGTH</th><th>MAJR_</th><th>MAJR_ID</th><th>NAME</th><t
h>RNUM</th></tr>
The footer is simply html decoration:
</table><p>

>
> Hello all.
>
> First of all, thank you for your help with the Angle labels.
>
> Now, I'm looking for documentation or examples about queries to DBF
files.
> I use ArcView files (Shp, DBF, Shx) and i would like to show some
points
> from a query in a map.
> Someone know where I can find something about it?.
>
>
> Thank you,
>
> Regards!
> Fran.
>
>

----------------------------------------------------------------------------
--
PUSHKAR S. PRADHAN
Research Assistant
MISSISSIPPI STATE UNIVERSITY,
STARKVILLE, MS 39759.

Engineering Research Center
Box 9627
Mississippi State, MS 39762-9627
----------------------------------------------------------------------------
--




More information about the MapServer-users mailing list