Class GeoRuby::SimpleFeatures::Geometry
In: lib/geo_ruby/simple_features/geometry.rb
Parent: Object

Root of all geometric data classes. Objects of class Geometry should not be instantiated.

Methods

Attributes

srid  [R]  SRID of the geometry
with_m  [RW]  Flag indicating if the m ordinate of the geometry is meaningful
with_z  [RW]  Flag indicating if the z ordinate of the geometry is meaningful

Public Class methods

Creates a geometry based on a EWKB string. The actual class returned depends of the content of the string passed as argument. Since WKB strings are a subset of EWKB, they are also valid.

Creates a geometry based on a EWKT string. Since WKT strings are a subset of EWKT, they are also valid.

sends back a geometry based on the GeoRSS string passed as argument

sends back an array: The first element is the goemetry based on the GeoRSS string passed as argument. The second one is the GeoRSSTags (found only with the Simple format)

Creates a geometry based on a HexEWKB string

Sends back a geometry from a KML encoded geometry string. Limitations : Only supports points, linestrings and polygons (no collection for now). Addapted from Pramukta‘s code

Public Instance methods

Outputs the geometry as an EWKB string. The allow_srid, allow_z and allow_m arguments allow the output to include srid, z and m respectively if they are present in the geometry. If these arguments are set to false, srid, z and m are not included, even if they are present in the geometry. By default, the output string contains all the information in the object.

Outputs the geometry as an EWKT string.

Outputs the geometry in georss format. Assumes the geometries are in latlon format, with x as lon and y as lat. Pass the :dialect option to swhit format. Possible values are: :simple (default), :w3cgeo and :gml.

Outputs the geometry as a HexEWKB string. It is almost the same as a WKB string, except that each byte of a WKB string is replaced by its hexadecimal 2-character representation in a HexEWKB string.

Outputs the geometry as a strict HexWKB string

Iutputs the geometry in kml format : options are :id, :tesselate, :extrude, :altitude_mode. If the altitude_mode option is not present, the Z (if present) will not be output (since it won‘t be used by GE anyway: clampToGround is the default)

Outputs the geometry as a strict WKB string.

Outputs the geometry as strict WKT string.

to be implemented in subclasses

Returns an Envelope object for the geometry

to be implemented in subclasses

[Validate]