[mapserver-users] Suggestions welcome ...

BLISS Meredith Meredith.Bliss at ODE-EX1.ODE.STATE.OR.US
Fri Mar 15 16:15:54 PST 2002


After lurking here for quite awhile, I finally have a crime rate map on the
web. This isn't done, but at least it's working, which is quite an
accomplishment. http://www.ocjc.state.or.us/CrimeMap/ORCrimeMap.php

Strangely enough, no one else seems to be doing this except for the
Minnesota site which was one of the first MapServer projects. That despite a
glossy brochure for a commercial product we received not too long ago with a
similar output for crime rates. 

At any rate, this is kind of a kludge -- since PHP won't lock a dbf file,
this uses the script to generate a mapfile from a template. The init page
runs an SQL query to calculate and order the counties by crime rate
(juvenile arrests for robbery for example) and writes the map file to put
the county name into EXPRESSION for the correct position in the order of
counties where the color is "hard wired" into the sequence of counties.
Since multiple users might want to use this at the same time, I use a random
number added to the map file to avoid collisions there. And since there are
umpteen different potential rates which will change when we get new census
estimates, I don't want to just add those to the dbf file.

The init file also writes to TEMPLATE in the mapfile a link for each county
so that clicking on a county will take the user to another PHP page that
delivers a table and graph of crime rates for the selected crime.
(Unfortunately, when the website folks installed the MapServer CGI, they
upgraded PHP to 4.1.2 which seems to have broken the graphing functions, so
that part will probably take awhile longer to fix ... If you click on a
county, you get a table of data, but the graph doesn't appear. I guess that
also precludes me from using PHP/MapScript for awhile.)

The part I like least is the two step process to get to the map, the first
submit button does the query and writes the files, the second one sends the
info to MapServer. Any suggestions here would be appreciated, but remember I
have pretty rudimentary programming skills (i.e., nearly nonexistent). Since
the initialization page recreates the map file each time, I assume that
couldn't be put on the page with the map.

Meredith (Bud) Bliss, Research Analyst
Oregon Criminal Justice Commission 
Asset Forfeiture Oversight Advisory Committee
126 Public Service Building
255  Capitol Street NE, Salem OR 97301
503-378-2053 x25 -- fax: 503-378-8666
> http://www.ocjc.state.or.us
> 



More information about the MapServer-users mailing list