[UMN_MAPSERVER-USERS] Need Help Displaying Info from DBFs

Skweda O'Bomsawin sobomsawin at KASSINI.COM
Fri Jan 14 10:56:14 PST 2005


AFAIK, your server will crash with this mapfile...  Fisrt, you need a shp
file as DATA, not the dbf (what we call a shapefile is actually made of 3 or
more files: a shp (geographic information), a shx (index info) and a dbf
(tabular information related to the shp)).  Mapserver uses the shp to
display geographic information.  The dbf is only used to filter this
information or to query the geographic info.

If you only have a dbf file, that means you will need a latitude and a
longitude column in your dbf file to display something...

At this point, you need to check:
        - what kind of dbf file you have (alone or with shp and shx)
        - If you have a shp and a shx, you just have to replace the DATA and
section of your mapfile and you're done!
        - if your dbf is alone, do you have an X and Y or latitude and
longitude column?
        - If you have these columns, you will need to create a shapefile
with these coordinates or use the virtual layer function of mapscript...

We are waiting for your input...

Skweda

-----Message d'origine-----
De : UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] De la
part de Michael Elepano
Envoyé : 14 janvier 2005 13:09
À : MAPSERVER-USERS at LISTS.UMN.EDU
Objet : [UMN_MAPSERVER-USERS] Need Help Displaying Info from DBFs

Hey:

I've been using MapServer for about a month now and have gotten 
relatively far with it.  But now I've hit a brick wall.

The problem I'm having is showing info from DBFs on my map of the US.  
I've got two DBFs (one with all the US counties and one with data-- say 
occurences of avalanches-- for each of those county).  I'm trying to 
color code each county according to occurences of avalanches.

Each DBF has a column called FIPS.  The avalanche DBF has a column 
called COUNT that is the basis for my colors.  I can use EXPRESSION to 
single out any column in my county DBF, but I can't seem to reach my 
avalanche DBF.

I'm assuming I'll need to do a JOIN.  My attempt follows below.  Any 
advice would be appreciated.

Michael

######################
## my attempt at an avalanche layer
######################
        LAYER
                NAME "layerAvalanche"
                TYPE POLYGON
                STATUS ON
                DATA "counties.dbf"
                PROJECTION
                        "proj=latlong"
                        "ellps=GRS80"
                        "datum=NAD83"
                END
                                        	
                CLASS
                        NAME "classGreen"
                        OUTLINECOLOR 255 0 255
                        COLOR 0 255 0
                        EXPRESSION ([COUNT] > 5)
                END
        	
                JOIN
                        NAME "joinAvalanche"
                        TABLE "C:\my\path\to\avalanches.dbf"
                        FROM "FIPS"
                        TO "FIPS"
                END
        END
=

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 2005-01-12
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 2005-01-12
 



More information about the MapServer-users mailing list