Join shape and dbms data: OGR?

Emil Zegers EZS at SYNCERA-ITSOLUTIONS.NL
Mon Nov 15 23:21:20 PST 2004


Hello Michael,

I have a question for you about this approach: when using this kind of join were you able to classify data based on the joined attributes and display this in the map image?

I'm asking this because with normal join operation it is not possible to create thematic maps based on the joined attributes.

If classifcation works based on this approach the enhancement request I put in bugzilla (http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=674) can be closed.

I would be very happy if classifying on joined attributes works this way (had no time to test this approach yet).

Regards,

Emil Zegers


Hi Frank,

thanks for your answer. It is working perfectly now.

For the moment it is only one table i want to join to the geometry of the shp-file, so at first
sight performance is good, but i will play with the indexes a little.

For all who have to use a similar approach here's a mapfile snipplet:

   LAYER
     ...
     CONNECTIONTYPE OGR
     CONNECTION "c:\mstest\data\fnpf.shp"  # shapefile holding only geometry and PID in .dbf
     DATA "SELECT * FROM fnpf LEFT JOIN 'ODBC:fnp'.fnp ON fnpf.PID=fnp.PID"
      # join to systemDSN fnp (here msaccess-db "fnp.mdb" with table fnp) on attribute PID,
      # now all fields of the db are also accessible for mapserver, e.g. "AZJAHR"
     LABELITEM "AZJAHR"
     ...
   END

Thanks, Michael



More information about the MapServer-users mailing list