Class with join

Stephen Lime steve.lime at dnr.state.mn.us
Mon Nov 27 16:00:13 EST 2000


Um, nope. No joins are supported for classification purposes. You can only
use directly attached attributes. This was done for performance reasons. It's
technically feasible though.

There are a couple of work arounds. The most straight forward would be
assign a shape to each record in the taxa dataset. You'll have duplicate
shapes (shapefile spec allows it) but with the maps you want to make that
won't be an issue. You can use mapscript to build the shapefile using your
taxa .dbf file as the new attribute table. Here's the approach

  1) open sites shapefile and taxa dbf file
  2) create a new taxa shapefile (type=point)
  3) for each taxa record
      - find the appropriate shape in sites 
      - read it from sites
      - write it to taxa

It's redundant but space it cheap and it will certainly be a lot faster. You may also
want to add some metrics to sites.dbf as you go like number of taxa, date range
or whatever.

Steve

Stephen Lime
Internet Applications Analyst

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

>>> Erich Schroeder <erich at museum.state.il.us> 11/27/00 01:46PM >>>
Hi,
  I'm hoping that I can do this without mapscript. I have a point coverage
with site locations. Each site can have multiple animal taxa and time
periods associated. I therefore have a sites.dbf file with the following
fields:

    1 AREA        N     12   3
    2 PERIMETER   N     12   3
    3 SITES_      N     11   0
    4 SITES_ID    N     11   0
    5 COUNTRY     C      3   0

and a file with all the taxa and time records with the following fields:

    1 SITES_ID    N      5   0
    2 TAXON       C      6   0
    3 AGE         C      4   0
    4 RESTAXON    C      6   0
    5 RIO         C      3   0

I want to be able to make a map file which will just show sites with a
particular taxon, and ultimately just that taxon from a particular age. 

I tried this:

LAYER
  NAME sites
  TYPE POINT
  STATUS DEFAULT
  DATA sites
  CLASS
    SYMBOL 4
    COLOR 255 0 0
    NAME "BIbi Sites"
    EXPRESSION ([TAXON] = "BIbi")
    JOIN
       table "alltaxa.dbf"
       type single
       from "SITES_ID"
       to "SITES_ID"
    END # join
  END
END

But this doesn't work as Joins are to be used in queries, as I understand.
I'm sure that what I want to do is possible, but I don't know how.

eks

---------------------------------------------------------------------
Erich Schroeder                    Phone: (217)785-0033
Curator, Information Technologies  FAX:   (217)785-2857
Illinois State Museum GIS Lab      Internet: erich at museum.state.il.us 
http://www.museum.state.il.us/ 
---------------------------------------------------------------------





More information about the mapserver-users mailing list