Need Help Displaying Info from DBFs
Michael Elepano
michael at LIVEPROCESS.COM
Fri Jan 14 13:03:40 PST 2005
On Jan 14, 2005, at 1:56 PM, Skweda O'Bomsawin wrote:
> 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.
Actually, the server does not crash with my DATA. It seems MapServer
disregards everything after (and including) the dot on the DATA name.
So, in the example below, I can have "counties.foo" as my DATA and the
shape file will still load properly.
To answer your questions, "counties" consists of a shp, shx, and dbf.
"avalanche" only has a dbf.
I have discovered something interesting: In the example below, it
seems the JOIN doesn't respond regardless what I place as the TABLE,
FROM, and TO. I can use:
TABLE "this_is"
FROM "complete"
TO "nonsense"
and no errors will be generated. Am I doing something wrong? Should
the JOIN be in the CLASS or in the LAYER?
BTW, I'm on MapServer 4.3
TIA
Michael
>
> 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