Geo ShapeFile Shape
Details
| Last Update: | 2008-01-15 17:01:17 |
| Version: | Geo::ShapeFile:: |
| License/Program Type: | Perl Artistic License |
| Publisher: | Jason Kohles |
| Price: | $0.00 |
Description:
Geo::ShapeFile::Shape is a Geo::ShapeFile utility class.
SYNOPSIS
use Geo::ShapeFile::Shape;
my $shape = new Geo::ShapeFile::Shape;
$shape->parse_shp($shape_data);
ABSTRACT
This is a utility class for Geo::ShapeFile that represents
shapes.
This is the Geo::ShapeFile utility class that actually contains
shape data for an individual shape from the shp file.
METHODS
new()
Creates a new Geo::ShapeFile::Shape object, takes no arguments
and returns the created object. Normally Geo::ShapeFile does this
for you when you call it's get_shp_record() method, so you
shouldn't need to create a new object. (Eventually this module
will have support for _creating_ shapefiles rather than just
reading them, then this method will become important.
num_parts()
Returns the number of parts that make up this shape.
num_points()
Returns the number of points that make up this shape.
points()
Returns an array of Geo::ShapeFile::Point objects that contains
all the points in this shape. Note that because a shape can contain
multiple segments, which may not be directly connected, you
probably don't want to use this to retrieve points which you are
going to plot. If you are going to draw the shape, you probably
want to use get_part() to retrieve the individual parts
instead.
get_part($part_index);
Returns the specified part of the shape. This is the
information you want if you intend to draw the shape. You can
iterate through all the parts that make up a shape like this:
for(1 .. $obj->num_parts) {
my $part = $obj->get_part($_);
... do something here, draw a map maybe
}
shape_type()
Returns the numeric type of this shape, use
Geo::ShapeFile::type() to determine the human-readable name from
this type.
shape_id()
Returns the id number for this shape, as contained in the shp
file.
x_min() x_max() y_min() y_max()
z_min() z_max() m_min() m_max()
Returns the minimum/maximum ranges of the X, Y, Z, or M values
for this shape, as contained in it's header information.
has_point($point)
Returns true if the point provided is one of the points in the
shape. Note that this does a simple comparison with the points that
make up the shape, it will not find a point that falls along a
vertex between two points in the shape. See the
Geo::ShapeFile::Point documentation for a note about how to exclude
Z and/or M data from being considered when matching points.
contains_point($point);
Returns true if the specified point falls in the interior of
this shape and false if the point is outside the shape. Return
value is unspecified if the point is one of the vertices or lies on
some segment of the bounding polygon.
Note that the return value is actually a winding-number
computed ignoring Z and M fields and so will be negative if the
point is contained within a shape winding the wrong way.
get_segments($part)
Returns an array consisting of array hashes, which contain the
points for each segment of a multi-segment part.
vertex_centroid( $part );
Returns a Geo::ShapeFile::Point that represents the calculated
centroid of the shapes vertices. If given a part index, calculates
just for that part, otherwise calculates it for the entire shape.
See "centroid" for more on vertex_centroid vs area_centroid.
area_centroid( $part );
Returns a Geo::ShapeFile::Point that represents the calculated
area centroid of the shape. If given a part index, calculates just
for that part, otherwise calculates it for the entire shape. See
"centroid" for more on vertex_centroid vs area_centroid.
centroid($part)
For backwards-compatibility reasons, centroid() is currently an
alias to vertex_centroid(), although it would probably make more
sense for it to point to area_centroid(). To avoid confusion (and
possible future deprecation), you should avoid this and use either
vertex_centroid or area_centroid.
dump()
Returns a text dump of the object, showing the shape type, id
number, number of parts, number of total points, the bounds for the
X, Y, Z, and M ranges, and the coordinates of the points in each
part of the shape.
Requirements:
· Perl
0 comments
Add to
Geo ShapeFile Shape Version History
Related Software
|
|
From category: Libraries |
| AI::NeuralNet::BackProp 0.77 is libraries software developed by Josiah Bryan. AI::NeuralNet::BackProp is a simple back-prop neural net that uses Delta\'s and Hebbs\' rule. SYNOPSIS us... |
|
|
From category: Perl-Modules |
| Config::Crontab is a Perl module used to read/write Vixie compatible crontab files.... |
|
|
From category: Perl-Modules |
| VBTK::Http is a web server monitoring tool.... |
|
|
From category: Perl-Modules |
| Untaint is a Perl module for laundering tainted data.... |
|
|
From category: Libraries |
| Convert::EBCDIC 0.06 is libraries software developed by Chris Leach. Convert::EBCDIC, ascii2ebcdic, ebcdic2ascii is a Perl module for string conversion between EBCDIC and ASCII. SYNOPSIS... |
|
|
From category: Version-Control |
| CVS Manager 1.0.0 is version control software developed by AdventNet, Inc.. CodeMiner CVS Manager is a web-based CVS (Concurrent Versioning System) repository monitoring/management and reporting so... |
|
|
From category: Perl-Modules |
| PerlSpeak is a Perl module for text to speech with festival, espeak, cepstral and others.... |
|
|
From category: Libraries |
| Cal3D 0.11.0 is libraries software developed by Cal3D Team. Cal3d project is a skeletal based 3d character animation library written in C++ in a platform-/graphic API-independent way. Origin... |
|
|
From category: Libraries |
| Tinymail is a library for developing mobile applications with E-mail functionality.... |
|
|
From category: Preprocessors |
| CLIP 1.2.0 is preprocessors software developed by ITK. CLIP is a Clipper/XBase compatible compiler with initial support other xBase dialects. CLIP project features support for international languag... |
|
|
From category: Libraries |
| File::RdistByRsync 0.3 is libraries software developed by David Muir Sharnoff. File::RdistByRsync is a Perl module that can read rdist distfiles, emulate using rsync. SYNOPSIS... |
|
|
From category: Libraries |
| Java 2 SE Runtime Environment 6 offers a \'feature complete\' version of Sun\'s next major release of the Java SE platform.... |
|
|
From category: Libraries |
| DBIx::HTMLinterface 0.11 is libraries software developed by Ron Crisco. DBIx::HTMLinterface is a class for creating a CGI interface to a database. SYNOPSIS use CGI; use DBI;... |
|
|
From category: Libraries |
| Cairo is a vector graphics library with cross-device output support.... |
|
|
From category: Libraries |
| elemenope 5.1 is libraries software developed by createTank, LLC.. elemenope is an Enterprise Application Integration, Service Oriented Architecture, and general messaging framework. elemenope prov... |
Leave a comment