Last 3.3 Alpha

Stephen Lime steve.lime at dnr.state.mn.us
Mon Nov 29 22:57:02 PST 1999


Howdy: I posted what I hope will be the last alpha release of 3.3. In addition I posted updated docs (including one for mapscript) on the web site. This new version bulks out mapscript a bit by adding methods for drawing legends, scalebars and
reference maps. In addition I added read access to shapefiles. So now you can write a script to dump a shapefile like this:

#!/usr/bin/perl

use mapscript;

%types = ( '1' => 'point',
                     '3' => 'arc',
                     '4' => 'polygon',
                     '5' => 'multipoint'
                     );

$shapefile = new shapefileObj('railroad') or die 'Unable to open shapefile';

print "Shapefile opened (type=". $types{$shapefile->{type}} .") with ". $shapefile->{numshapes} ." shape(s)\n";

$shape = new shapeObj();

for($i=0; $i<$shapefile->{numshapes}; $i++) {
    
    $shapefile->get($i, $shape);
    print "Shape $i has ". $shape->{numlines} ." part(s)\n";

    for($j=0; $j<$shape->{numlines}; $j++) {
        $part = $shape->get($j);
        print "Part $j has ". $part->{numpoints} ." point(s)\n";

        for($k=0; $k<$part->{numpoints}; $k++) {
            $point = $part->get($k);
            print "$k: ". $point->{x} .", ". $point->{y} ."\n";
        }
    }
}

Write access will be coming soon. Meanwhile, the C code is stabilizing rather nicely. There is still a bit to do with certain types of queries and querymaps but I hope to iron that out yet this week. Have fun.

Steve



More information about the MapServer-users mailing list