class with join

Stephen Lime steve.lime at dnr.state.mn.us
Tue Feb 13 12:35:40 EST 2001


I assuming you're refering to the part:

  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 just a way to build a shapefile around an existing dbf file. If I remember 
right each site maps to multiple records in the taxa file, and the taxa records
are unique to a particular point. My suggestion was to create a point file (based
on sites) for the taxa dbf file. So, the taxa file would end up containing the
same site point many times. Does this make sense?

Steve

Stephen Lime
Internet Applications Analyst

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

>>> Zolla Michalak <michalak at hwr.arizona.edu> 02/07/01 06:45PM >>>

We are using JOIN to bring in new attributes to a layer, and need to make
classes based on the joined attributes, but just discovered by reading the
archives that this is not possible, directly. 

I'm trying to figure out what our options are. One option would be to edit
the dbf file of the shape file, adding our new attributes directly, rather
than using JOIN. But I wanted to see if there is an easier way before I go
that route.

Here is a copy of resonse to a previous question about class with join
that we found in the archives. Steve, could you explain in more detail the
options listed here in the following message?


>>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
---------------------------------------------------------------------------


-Thanks!

***************************************************
   Zolla Michalak 
   Support Systems Analyst
   Hydrology, University of Arizona
   (520) 626-8746   http://hydis.hwr.arizona.edu 
***************************************************






More information about the mapserver-users mailing list