PHP mapscript and JOINS

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Aug 8 13:04:20 EDT 2005


Hi Eric: The JOIN support for MapServer is pretty much limited to queries and
query template files. That is, it all goes on behind the scenes. I don't believe that
any of the JOIN functionality is even exposed via MapScript- PHP or any other
language.  One reason being that the scripting languages that support MapScript
provide better access to a database (flat files, DBF files, Oracle or Postgres) than
MapScript. So number 2 below is a very viable option, as of course is number 3.

Another option would be to use OGR since it has join abilities built in as well.

Steve

>>> Eric Shuman <erics at AMERI-TITLE.COM> 08/05/05 12:17 PM >>>
OK I am stumped again.

Using PHP mapscript I have gotten some results from a spatial query.  I now
want to create a table showing data from an associated dbf file for the
query results.  What is the best method of joining the query results to a
dbf in PHP?

1. Should I be using a JOIN object in the map file for the layer queried?
If so what is the syntax for accesing the join fields?  (I have only been
able to get the original shapefile values)

2. Should I be using the PHP dbase extension? I'm assuming this might be
slow since I would have to query the dbf for each result from the spatial query.

3.  Am I going to have to delv into PostGIS, and convert all my data into it?

Any guidance would be appreciated!


~Eric



More information about the mapserver-users mailing list