GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Geo::GDAL::FFI::Geometry(3) User Contributed Perl Documentation Geo::GDAL::FFI::Geometry(3)

Geo::GDAL::FFI::Geometry - A GDAL geometry

 my $geom = Geo::GDAL::FFI::Geometry->new($geometry_type);

$type must be one of Geo::GDAL::FFI::GeometryTypes().

 my $geom = Geo::GDAL::FFI::Geometry->new($format, $arg, $sr);

$format must be one of Geo::GDAL::FFI::GeometryFormats(), e.g., 'WKT'.

$sr should be a SpatialRef object if given.

 my $geom2 = $geom1->Clone;

Clones this geometry and returns the clone.

 my $type = $geom->GetType($mode);

Returns the type of this geometry. If $mode (optional) is 'flatten', returns the type without Z, M, or ZM postfix.

Returns the point count of this geometry.

 $point->SetPoint($x, $y, $z, $m);

Set the coordinates of a point geometry. The usage of $z and $m in the method depend on the actual 3D or measured status of the point.

 $point->SetPoint([$x, $y, $z, $m]);

Set the coordinates of a point geometry. The usage of $z and $m in the method depend on the actual 3D or measured status of the geometry.

 $geom->SetPoint($i, $x, $y, $z, $m);

Set the coordinates of the ith (zero based index) point in a curve geometry. The usage of $z and $m in the method depend on the actual 3D or measured status of the geometry.

Note that setting the nth point of a curve creates all points 0..n-2 unless they exist.

 $geom->SetPoint($i, $coords);

Set the coordinates of the ith (zero based index) point in this curve. $coords must be a reference to an array of the coordinates. The usage of $z and $m in the method depend on the 3D or measured status of the geometry.

Note that setting the nth point of a curve may create all points 0..n-2.

 my $coords = $geom->GetPoint($i);

Get the coordinates of the ith (zero based index) point in this curve. This method can also be used to set the coordinates of a point geometry and then the $i must be zero if it is given.

Returns the coordinates either as a list or a reference to an anonymous array depending on the context. The coordinates contain $z and $m depending on the 3D or measured status of the geometry.

 my $points = $geom->GetPoints;

Returns the coordinates of the vertices of this geometry in an obvious array based data structure. Note that different geometry types have similar data structures.

 $geom->SetPoints($points);

Sets the coordinates of the vertices of this geometry from an obvious array based data structure. Note that different geometry types may have similar data structures. If the geometry contains subgeometries (like polygon contains rings for example), the data structure is assumed to adhere to this structure. Uses SetPoint and may thus add points to curves.

 my $num_geometries = $geom->GetGeometryCount;

 my $outer_ring = $polygon->GetGeometry(0);

Returns the ith subgeometry (zero based index) in this geometry. The returned geometry object is only a wrapper to the underlying C++ reference and thus changing that geometry will change the parent.

 $polygon->AddGeometry($ring);

 $geom->RemoveGeometry($i);

 my $wkt = $geom->ExportToWKT($variant);

Returns the geometry as WKT. $variant is optional (default is 'ISO').

Alias to ExportToWKT.

 my $gml = $geom->ExportToGML(%options);

Returns the geometry as GML string. %options may contain options as described in GDAL documentation.

 my $json = $geom->ExportToJSON(%options);

Returns the geometry as JSON string. %options may contain options as described in GDAL documentation.

Returns a four element array reference containing [Xmin, Xmax, Ymin, Ymax].

Returns a six element array reference containing [Xmin, Xmax, Ymin, Ymax, Zmin, Zmax].

This software is released under the Artistic License. See perlartistic.

Ari Jolma - Ari.Jolma at gmail.com

Geo::GDAL::FFI

Alien::gdal, FFI::Platypus, <http://www.gdal.org>

2021-03-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.