Geo::GDAL 1.8.0

Geo::OGR::Geometry Class Reference

Inheritance diagram for Geo::OGR::Geometry:
Inheritance graph
[legend]

List of all members.

Public Class Methods

Geo::OGR::Geometry new (scalar type=scalar Geo::OGR::wkbUnknown, scalar WKT=undef, scalar WKB=undef, scalar GML=undef)
Geo::OGR::Geometry create (scalar type)
Geo::OGR::Geometry create (hash params)

Public Object Methods

 FlattenTo2D ()
scalar CoordinateDimension (scalar dimension)
scalar GetCoordinateDimension ()
 SetCoordinateDimension (scalar dimension)
scalar GetDimension ()
scalar AsText ()
scalar AsBinary (scalar byte_order= 'XDR')
scalar ExportToGML ()
scalar ExportToKML ()
 AddPoint (scalar x, scalar y, scalar z)
 AddPoint_2D (scalar x, scalar y)
 AddPoint_3D (scalar x, scalar y, scalar z)
 SetPoint (scalar index, scalar x, scalar y, scalar z)
 SetPoint_2D (scalar index, scalar x, scalar y)
 SetPoint_3D (scalar index, scalar x, scalar y, scalar z)
scalar GetPointCount ()
list GetPoint (scalar index=0)
scalar GetPoint_2D (scalar index=0)
scalar GetPoint_3D (scalar index=0)
scalar GetX (scalar index=0)
scalar GetY (scalar index=0)
scalar GetZ (scalar index=0)
list Point (scalar index, scalar x, scalar y, scalar z)
listref Points (listref points)
 Empty ()
scalar IsEmpty ()
scalar IsRing ()
scalar IsSimple ()
scalar IsValid ()
 Move (scalar dx, scalar dy, scalar dz)
 AddGeometryDirectly (scalar other)
 AddGeometry (scalar other)
Geo::OGR::Geometry Clone ()
scalar GeometryType ()
scalar GetArea ()
scalar GetGeometryCount ()
scalar GetGeometryRef (scalar index)
Geo::OGR::Geometry GetBoundary ()
Geo::OGR::Geometry ConvexHull ()
Geo::OGR::Geometry BuildPolygonFromEdges (scalar BestEffort=0, scalar AutoClose=0, scalar Tolerance=0)
Geo::OGR::Geometry Collect (list geometries)
list Dissolve ()
Geo::OGR::Geometry ForceToPolygon ()
Geo::OGR::Geometry ForceToMultiPoint (list points)
Geo::OGR::Geometry ForceToMultiLineString (list linestrings)
Geo::OGR::Geometry ForceToMultiPolygon (list polygons)
Geo::OGR::Geometry ForceToCollection (list geometries)
Geo::OGR::Geometry Buffer (scalar distance, scalar quadsecs=30)
Geo::OGR::Geometry Intersection (scalar other)
Geo::OGR::Geometry Union (scalar other)
Geo::OGR::Geometry Difference (scalar other)
Geo::OGR::Geometry SymmetricDifference (scalar other)
scalar Distance (scalar other)
scalar Intersect (scalar other)
scalar Equal (scalar other)
scalar Disjoint (scalar other)
scalar Touches (scalar other)
scalar Crosses (scalar other)
scalar Within (scalar other)
scalar Contains (scalar other)
scalar Overlaps (scalar other)
 TransformTo (scalar srs)
 Transform (scalar trans)
Geo::OSR::SpatialReference GetSpatialReference ()
 AssignSpatialReference (scalar srs)
 CloseRings ()
listref GetEnvelope ()
Geo::OGR::Geometry Centroid ()
scalar WkbSize ()
scalar GetGeometryType ()
scalar GetGeometryName ()

Member Function Documentation

Geo::OGR::Geometry::AddGeometry ( scalar  other)

Add a copy of another geometry to a geometry collection

Parameters:
othera Geo::OGR::Geometry object
Geo::OGR::Geometry::AddGeometryDirectly ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Geo::OGR::Geometry::AddPoint ( scalar  x,
scalar  y,
scalar  z 
)

Set the data of a point or add a point to a line string. Consider using Geo::OGR::Geometry::Points. Note that the coordinate dimension is automatically upgraded to 25D (3) if z is given.

Parameters:
x
y
z[optional] Calls internally the 2D or 3D version depending on the number of parameters.
Geo::OGR::Geometry::AddPoint_2D ( scalar  x,
scalar  y 
)

Set the data of a point or add a point to a line string. Consider using Geo::OGR::Geometry::Points.

Parameters:
x
y
Geo::OGR::Geometry::AddPoint_3D ( scalar  x,
scalar  y,
scalar  z 
)

Set the data of a point or add a point to a line string. Note that the coordinate dimension is automatically upgraded to 25D (3). Consider using Geo::OGR::Geometry::Points.

Parameters:
x
y
z
scalar Geo::OGR::Geometry::AsBinary ( scalar  byte_order = 'XDR')

This geometric object as a Well-known binary string. Alternative name: ExportToWkb.

Parameters:
byte_orderXDR or NDR
Returns:
a WKB binary string
Geo::OGR::Geometry::AssignSpatialReference ( scalar  srs)
Parameters:
srsa Geo::OSR::SpatialReference object
scalar Geo::OGR::Geometry::AsText ( )

This geometric object in Well-known text. Alternative name: ExportToWkt.

Returns:
a WKT string
Geo::OGR::Geometry Geo::OGR::Geometry::Buffer ( scalar  distance,
scalar  quadsecs = 30 
)
Parameters:
distance
quadsecs
Returns:
a new Geo::OGR::Geometry object
Geo::OGR::Geometry Geo::OGR::Geometry::BuildPolygonFromEdges ( scalar  BestEffort = 0,
scalar  AutoClose = 0,
scalar  Tolerance = 0 
)

Attempt to create a polygon from a collection of lines or from a multilinestring.

Parameters:
BestEffortFor future
AutoCloseAssure the first and last points of rings are same.
ToleranceSnap distance.
Exceptions:
Severalpossibilities, some are reported, some are general errors.
Returns:
a new Geo::OGR::Geometry object (Polygon)
Geo::OGR::Geometry Geo::OGR::Geometry::Centroid ( )
Returns:
a new Geo::OGR::Geometry object
Geo::OGR::Geometry Geo::OGR::Geometry::Clone ( )
Returns:
a new Geo::OGR::Geometry object
Geo::OGR::Geometry::CloseRings ( )
Geo::OGR::Geometry Geo::OGR::Geometry::Collect ( list  geometries)

Create a geometrycollection from this and possibly other geometries.

Parameters:
geometries[optional] More geometries to add to the collection.
Returns:
a new Geo::OGR::Geometry object of type geometrycollection.
scalar Geo::OGR::Geometry::Contains ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
Geo::OGR::Geometry Geo::OGR::Geometry::ConvexHull ( )
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::CoordinateDimension ( scalar  dimension)
Parameters:
dimension[optional]
Returns:
2 or 3
Geo::OGR::Geometry Geo::OGR::Geometry::create ( scalar  type)
Parameters:
typeOne of geometry type strings: 'Point', 'LineString', etc.

Usage:

$g = Geo::OGR::Geometry->create(...arguments...);
Returns:
a new Geo::OGR::Geometry object
Geo::OGR::Geometry Geo::OGR::Geometry::create ( hash  params)
Parameters:
%paramsA named parameter, possible are: GeometryType, WKT, WKB, HEXWKB, GML, GeoJSON, arc, and Points (as in method Geo::OGR::Geometry::Points).

  • arc An anonymous list of [CenterX, CenterY, CenterZ, PrimaryRadius, SecondaryRadius, Rotation, StartAngle, EndAngle, MaxAngleStepSizeDegrees]

Usage:

$g = Geo::OGR::Geometry->create(...arguments...);
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::Crosses ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
Geo::OGR::Geometry Geo::OGR::Geometry::Difference ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::Disjoint ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
list Geo::OGR::Geometry::Dissolve ( )

Dissolve a geometrycollection into separate geometries.

Returns:
a list of new Geo::OGR::Geometry objects cloned from the collection.
scalar Geo::OGR::Geometry::Distance ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
Geo::OGR::Geometry::Empty ( )

Clear geometry data.

scalar Geo::OGR::Geometry::Equal ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
scalar Geo::OGR::Geometry::ExportToGML ( )

This geometric object as a GML string. Alternative name: AsGML.

Returns:
a GML string
scalar Geo::OGR::Geometry::ExportToKML ( )

This geometric object as a KML string. Alternative name: AsKML.

Returns:
KML string
Geo::OGR::Geometry::FlattenTo2D ( )
Geo::OGR::Geometry Geo::OGR::Geometry::ForceToCollection ( list  geometries)

Create a geometrycollection from the geometry.

Parameters:
polygons[optional] More geometries to add to the collection.
Returns:
a new Geo::OGR::Geometry object of type geometrycollection.
Geo::OGR::Geometry Geo::OGR::Geometry::ForceToMultiLineString ( list  linestrings)

Attempt to create a multilinestring from the geometry, which must be a linestring.

Parameters:
linestrings[optional] More linestrings to add to the collection.
Returns:
a new Geo::OGR::Geometry object of type multilinestring.
Geo::OGR::Geometry Geo::OGR::Geometry::ForceToMultiPoint ( list  points)

Attempt to create a multipoint from the geometry, which must be a point.

Parameters:
points[optional] More points to add to the collection.
Returns:
a new Geo::OGR::Geometry object of type multipoint.
Geo::OGR::Geometry Geo::OGR::Geometry::ForceToMultiPolygon ( list  polygons)

Attempt to create a multipolygon from the geometry, which must be a polygon.

Parameters:
polygons[optional] More polygons to add to the collection.
Returns:
a new Geo::OGR::Geometry object of type multipolygon.
Geo::OGR::Geometry Geo::OGR::Geometry::ForceToPolygon ( )

Attempt to create a polygon from the geometry.

Exceptions:
Nonereported. If this method fails, just a copy is returned.
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::GeometryType ( )
Returns:
the geometry type
scalar Geo::OGR::Geometry::GetArea ( )
Returns:
a number
Geo::OGR::Geometry Geo::OGR::Geometry::GetBoundary ( )
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::GetCoordinateDimension ( )
Returns:
an integer
scalar Geo::OGR::Geometry::GetDimension ( )
Returns:
0, 1, or 2
listref Geo::OGR::Geometry::GetEnvelope ( )
Returns:
arrayref = [$minx, $maxx, $miny, $maxy]
scalar Geo::OGR::Geometry::GetGeometryCount ( )
Returns:
an integer
scalar Geo::OGR::Geometry::GetGeometryName ( )
Deprecated:
use string names
Returns:
a string
scalar Geo::OGR::Geometry::GetGeometryRef ( scalar  index)
Parameters:
index
Returns:
a new Geo::OGR::Geometry object whose data is a part of the parent geometry
scalar Geo::OGR::Geometry::GetGeometryType ( )
Deprecated:
use Geo::OGR::Geometry::GeometryType, which returns the type as a string
Returns:
type as an integer
list Geo::OGR::Geometry::GetPoint ( scalar  index = 0)
Parameters:
index
Returns:
(x,y) or a list with more coordinates
scalar Geo::OGR::Geometry::GetPoint_2D ( scalar  index = 0)
Parameters:
index
Returns:
(x,y) or a list with more coordinates
scalar Geo::OGR::Geometry::GetPoint_3D ( scalar  index = 0)
Parameters:
index
Returns:
(x,y) or a list with more coordinates
scalar Geo::OGR::Geometry::GetPointCount ( )
Returns:
an integer
Geo::OSR::SpatialReference Geo::OGR::Geometry::GetSpatialReference ( )
Returns:
a new Geo::OSR::SpatialReference object
scalar Geo::OGR::Geometry::GetX ( scalar  index = 0)
Parameters:
index
Returns:
a number
scalar Geo::OGR::Geometry::GetY ( scalar  index = 0)
Parameters:
index
Returns:
a number
scalar Geo::OGR::Geometry::GetZ ( scalar  index = 0)
Parameters:
index
Returns:
a number
scalar Geo::OGR::Geometry::Intersect ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
Geo::OGR::Geometry Geo::OGR::Geometry::Intersection ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::IsEmpty ( )
Returns:
boolean
scalar Geo::OGR::Geometry::IsRing ( )
Returns:
boolean
scalar Geo::OGR::Geometry::IsSimple ( )
Returns:
boolean
scalar Geo::OGR::Geometry::IsValid ( )
Returns:
boolean
Geo::OGR::Geometry::Move ( scalar  dx,
scalar  dy,
scalar  dz 
)
Parameters:
dx
dy
dz[optional]
Geo::OGR::Geometry Geo::OGR::Geometry::new ( scalar  type = scalar Geo::OGR::wkbUnknown,
scalar  WKT = undef,
scalar  WKB = undef,
scalar  GML = undef 
)
Deprecated:
use Geo::OGR::Geometry::create, which accepts type as a string
Parameters:
typeone of Geo::OGR::wkb*
WKT
WKB
GML
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::Overlaps ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
list Geo::OGR::Geometry::Point ( scalar  index,
scalar  x,
scalar  y,
scalar  z 
)

Get or set the point

Parameters:
indexThe index of the point. Optional (ignored if given) for Point and Point25D geometries.
x[optional]
y[optional]
z[optional]
Returns:
listref Geo::OGR::Geometry::Points ( listref  points)

Get or set the points of the geometry. The points (vertices) are stored in obvious lists of lists. Note that unique points structures may be different geometries depending on the actual geometry type. When setting, the geometry is first emptied. The method uses internally either AddPoint_2D or AddPoint_3D depending on the GeometryType.

Parameters:
points[optional]
Returns:
Geo::OGR::Geometry::SetCoordinateDimension ( scalar  dimension)
Parameters:
dimension
Geo::OGR::Geometry::SetPoint ( scalar  index,
scalar  x,
scalar  y,
scalar  z 
)

Set the data of a point or a line string. Note that the coordinate dimension is automatically upgraded to 25D (3) if z is given.

Parameters:
index
x
y
z[optional]
Geo::OGR::Geometry::SetPoint_2D ( scalar  index,
scalar  x,
scalar  y 
)
Parameters:
index
x
y
Geo::OGR::Geometry::SetPoint_3D ( scalar  index,
scalar  x,
scalar  y,
scalar  z 
)

Set the data of a point or a line string. Note that the coordinate dimension is automatically upgraded to 25D (3).

Parameters:
index
x
y
z
Geo::OGR::Geometry Geo::OGR::Geometry::SymmetricDifference ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::Touches ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
Geo::OGR::Geometry::Transform ( scalar  trans)
Parameters:
transa Geo::OSR::CoordinateTransformation object
Geo::OGR::Geometry::TransformTo ( scalar  srs)
Parameters:
srsa Geo::OSR::SpatialReference object
Geo::OGR::Geometry Geo::OGR::Geometry::Union ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
a new Geo::OGR::Geometry object
scalar Geo::OGR::Geometry::Within ( scalar  other)
Parameters:
othera Geo::OGR::Geometry object
Returns:
boolean
scalar Geo::OGR::Geometry::WkbSize ( )
Returns:
an integer

The documentation for this class was generated from the following file: