Geo::OGC::Geometry - Perl extension for OGC simple feature geometries
use Geo::OGC::Geometry; my $point = Geo::OGC::Point->new(Text => 'POINT 1 1');
OGC simple feature geometries is a class hierarchy for geographic information. This module conforms to the document OGC 06-103r4, which is the current document describing the standard. The document is available from http://www.opengeospatial.org/.
This module is currently mostly an interface and storage classes and does not contain implementations of most of the methods for testing spatial relations etc.
Geo::OGC::Geometry is the root class and it represents an arbitrary geospatial geometry.
Create a new Geometry object or a new object belonging to a concrete subclass of Geometry if initialization data is given.
%param is a hash containing named parameters. The keywords are (subclasses of Geometry may add new keywords):
A well-known text to initialize an object of a concrete class.
Sets the Spatial Reference System ID of the object, default is -1.
If specified, has the effect that numeric comparisons in the Equals method is is preceded with a rounding operation (using sprintf "%.pe", where p is the Precision-1, i.e the number of meaningful numbers is Precision). Affects also AsText.
Clones this object, i.e., creates a spatially exact copy.
Sets or gets the precision.
Not in the specification.
The dimension (2 or 3) of this geometric object. In non-homogeneous collections, this will return the largest topological dimension of the contained objects.
Returns the geometry type of this object.
Get or set Spatial Reference System ID for this object.
Compute the minimum bounding box for this geometry as a ring.
This object in Well-known Text representation.
This object in Well-known Binary representation.
Returns true if this object is empty, i.e. contains no points.
Returns true if this geometric object has no anomalous geometric points, such as self intersection or self tangency.
Returns true if this geometric object has z coordinate values.
Returns true if this object has m coordinate values.
Returns the closure of the combinatorial boundary of this object.
Returns true if this object is "spatially equal" to the other geometry.
Returns true if this object is "spatially disjoint" from the other geometry.
Returns true if this object "spatially intersects" the other geometry.
Returns true if this object "spatially touches" the other geometry.
Returns true if this object "spatially crosses" the other geometry.
Returns true if this object is "spatially within" the other geometry.
Returns true if this object "spatially contains" the other geometry.
Returns true if this object "spatially overlaps" the other geometry.
Returns true if this object is spatially related to the other geometry by testing for intersections between the interior, boundary and exterior of the two geometric objects as specified by the values in the intersectionPatternMatrix. This returns FALSE if all the tested intersections are empty except exterior (this) intersect exterior (another).
Returns a derived geometry collection value that matches the specified m coordinate value.
Returns a derived geometry collection value that matches the specified range of m coordinate values inclusively.
Returns the shortest distance between any two points between this object and the other geometry.
Returns a surface whose points are closer than or at the given distance from this object.
Returns a convex hull of this object.
Returns a point set intersection of this object with the other geometry.
Returns a point set union of this object with the other geometry.
Returns a point set difference of this object with the other geometry.
Returns a point set symmetric difference of this object with the other geometry.
Creates a collection which contains this geometry.
transf = A point transformation method which will be applied for all the points in the geometry as:
($new_x, $new_y, $new_z) = $transformation->($x, $y, $z)
A 0-dimensional geometric object.
A new point object can be created (besides using WKT) with
$point = Geo::OGC::Point->new($x, $y); $point = Geo::OGC::Point->new($x, $y, $z); $point = Geo::OGC::Point->new(point => [$x, $y]); $point = Geo::OGC::Point->new(point => [$x, $y, $z]); $point = Geo::OGC::Point->new(point => [$x, $y, $z, $m]); $point = Geo::OGC::Point->new(pointz => [$x, $y, $z]); $point = Geo::OGC::Point->new(pointz => [$x, $y, $z, $m]); $point = Geo::OGC::Point->new(pointm => [$x, $y, $m]); $point = Geo::OGC::Point->new(pointm => [$x, $y, $z, $m]); $point = Geo::OGC::Point->new(pointzm => [$x, $y, $z, $m]); $point = Geo::OGC::Point->new(X => $x, Y => $y); $point = Geo::OGC::Point->new(X => $x, Y => $y, Z => $z); $point = Geo::OGC::Point->new(X => $x, Y => $y, Z => $z, M => $m);
Get or set the z coordinate.
Setting is not in the specification.
Get or set the measure.
A 1-dimensional geometric object.
Adds a point to the end (N+1) of the curve by default.
point = A Point object i [optional] = The location in the sequence (1..N+1) where to add the Point.
Delete a point from the curve.
i = The location in the sequence (1..N) from where to delete the Point.
Return the number of points in the sequence.
Get or set the point of the sequence.
N = A location in the sequence. point [optional] = A Point object, if defined sets the point to index N.
The first point has the index 1 as OGC SF SQL conformance test uses 1-based indexing.
Close the curve by adding the first point also as the last point.
Tests whether this curve is a ring, i.e., closed and simple.
upgrade [optional, not in the specification] = Upgrades this curve into a Ring if this really could be a ring.
Reverse the order of the points in the sequence.
The length of this LineString in its associated spatial reference.
Currently computed as a simple euclidean distance.
Tests whether the given point is within the ring.
Uses the pnpoly algorithm from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html.
Assumes a simple closed ring. May or may not return true if the point is on the border.
Compute the area of the ring. The area is computed as a simple euclidean area.
Assumes a simple closed ring
Returns the area as a negative number if the sense of the rotation of the ring is clockwise.
A 2-dimensional geometric object.
Return the number of interior rings in the polygon.
Return the number of geometries in this collection.
Return the Nth geometry from the collection (the index of the first geometry is 1).
Returns last (latest added) polygon or undef.
The OpenGIS (r) Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture was heavily used in preparation of this module.
https://github.com/ajolma/Geo-OGC-Geometry
Ari Jolma https://github.com/ajolma
Copyright (c) 2008- Ari Jolma
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.
To install Geo::OGC::Geometry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::OGC::Geometry
CPAN shell
perl -MCPAN -e shell install Geo::OGC::Geometry
For more information on module installation, please visit the detailed CPAN module installation guide.