|
NAMEGeo::GDAL::FFI::Geometry - A GDAL geometrySYNOPSISDESCRIPTIONMETHODSnewmy $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. Clonemy $geom2 = $geom1->Clone; Clones this geometry and returns the clone. GetTypemy $type = $geom->GetType($mode); Returns the type of this geometry. If $mode (optional) is 'flatten', returns the type without Z, M, or ZM postfix. GetPointCountReturns the point count of this geometry.SetPoint$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. GetPointmy $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. GetPointsmy $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. SetPoints$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. GetGeometryCountmy $num_geometries = $geom->GetGeometryCount; GetGeometrymy $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. AddGeometry$polygon->AddGeometry($ring); RemoveGeometry$geom->RemoveGeometry($i); ExportToWKT($variant)my $wkt = $geom->ExportToWKT($variant); Returns the geometry as WKT. $variant is optional (default is 'ISO'). AsTextAlias to ExportToWKT.ExportToGML($options)my $gml = $geom->ExportToGML(%options); Returns the geometry as GML string. %options may contain options as described in GDAL documentation. ExportToJSON($options)my $json = $geom->ExportToJSON(%options); Returns the geometry as JSON string. %options may contain options as described in GDAL documentation. IntersectsEqualsDisjointTouchesCrossesWithinContainsOverlapsBoundaryConvexHullBufferIntersectionUnionDifferenceSymDifferenceDistanceDistance3DLengthAreaCentroidEmptyIsEmptyIsValidIsSimpleIsRingGetEnvelopeReturns a four element array reference containing [Xmin, Xmax, Ymin, Ymax].GetEnvelope3DReturns a six element array reference containing [Xmin, Xmax, Ymin, Ymax, Zmin, Zmax].LICENSEThis software is released under the Artistic License. See perlartistic.AUTHORAri Jolma - Ari.Jolma at gmail.comSEE ALSOGeo::GDAL::FFIAlien::gdal, FFI::Platypus, <http://www.gdal.org>
Visit the GSP FreeBSD Man Page Interface. |