Class: GeoRuby::GeoJSONParser

Inherits:
Object
  • Object
show all
Includes:
SimpleFeatures
Defined in:
lib/geo_ruby/geojson.rb

Overview

GeoJSON main parser

Constant Summary

Constants included from SimpleFeatures

SimpleFeatures::DEFAULT_SRID, SimpleFeatures::GEORSS_NS, SimpleFeatures::GML_NS, SimpleFeatures::KML_NS, SimpleFeatures::M_MASK, SimpleFeatures::SRID_MASK, SimpleFeatures::W3CGEO_NS, SimpleFeatures::Z_MASK

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#geometryObject (readonly)

Returns the value of attribute geometry.



74
75
76
# File 'lib/geo_ruby/geojson.rb', line 74

def geometry
  @geometry
end

Instance Method Details

#parse(geojson, srid = DEFAULT_SRID) ⇒ Object



76
77
78
79
80
# File 'lib/geo_ruby/geojson.rb', line 76

def parse(geojson, srid = DEFAULT_SRID)
  @geometry = nil
  geohash = JSON.parse(geojson)
  parse_geohash(geohash, srid)
end