[mapserver-users] DBF Queries

Steve Lime steve.lime at dnr.state.mn.us
Fri Feb 8 22:00:32 PST 2002


It's also worth considering using cron to run a script to dump from the
main datasource (Oracle, flat file or whatever) to a shapefile. Perhaps
it's not as slick, but it's likely better for performance and may allow
you to use the CGI version of the MapServer- less code to write (beyond
the converter).

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Searle Ross" <Ross.Searle at nrm.qld.gov.au> 02/07/02 19:30 PM >>>
Francisco,

One simple solution to your problem is is to store your point data in a
postgres database and use postgis to display your dynamic info. We have
got an application that does this and it works fine.

Ross 

-----Original Message-----
From: Francisco Delgado [mailto:delgadof at marn.gob.sv]
Sent: Friday, 8 February 2002 10:08 AM
To: Steve Lime; fgclaram at alu-ab.uclm.es; pushkar at ERC.MsState.Edu
Cc: mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] DBF Queries


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><t
d>[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</t
h><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
------------------------------------------------------------------------
----
--



************************************************************************
The information in this e-mail together with any attachments is
intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.

Any form of review, disclosure, modification, distribution
and/or publication of this e-mail message is prohibited.  

If you have received this message in error, you are asked to
inform the sender as quickly as possible and delete this message
and any copies of this message from your computer and/or your
computer system network.  
************************************************************************





More information about the MapServer-users mailing list