[mapserver-users] Length of a line calculation?

Azimuth, Erwin Perik perik at azimuth.nl
Fri Feb 22 08:25:40 EST 2002


Hi V,

Had about the same question to the list a couple of days ago regarding 
getting the points of a shape.

If you found a way to get every point of a shape i'd really appreceate it ;-)

This i got from my Lowell F. :

Perl Mapscript example:
#
# Create shapefile object of existing data.
$shpfile = new shapefileObj("data", -1);
#
# Create shape object.
$shp = new shapeObj(-1);
#
# Retrieve shape into shape object.
$shpfile->get(1,$shp);
#
# Get first line.
my $line = new lineObj();
$line = $shp>{line};
#
# Get the first point of line.
my $point = new pointObj();
$point = $line->{point};
$px = $point->{x};
$py = $point->{y};
print "<br>POINT X=$px Y=$py<br>";
Doing such for each line of a shape and each point of
a line...




At 16:40 21-2-02 -0500, Vinko Vrsalovic wrote:
>On Thu, Feb 21, 2002 at 10:20:29AM -0800, Lowell Filak wrote:
>
>[...]
>
> > This can be done for each point of each line of each
> > shape and the distance calculated betwen points of
> > each line.
>
>You are absolutely right, thank you. I was hoping for a more automatic
>method, though :-).
>
>--
>V. <v at w.cl>


=================
Azimuth Geodetic
Koldingweg 8
9723 HK Groningen
tel. 050-5493454
fax. 050-5497217
=================
www.azimuth.nl
perik at azimuth.nl
=================




More information about the mapserver-users mailing list