Module: TheGeomGeoJSON
- Defined in:
- lib/the_geom_geojson.rb,
lib/the_geom_geojson/version.rb,
lib/the_geom_geojson/examples.rb,
lib/the_geom_geojson/active_record.rb
Defined Under Namespace
Modules: ActiveRecord
Constant Summary collapse
- Dirty =
Class.new(RuntimeError)
- VERSION =
'0.1.0'
- EXAMPLES =
{ burlington: '{"type":"Polygon","coordinates":[[[-73.223,44.491],[-73.171,44.49],[-73.146,44.447],[-73.211,44.439],[-73.229,44.462],[-73.223,44.491]]]}', burlington_point: '{"type":"Point","coordinates":[-73.193,44.477]}', burlington_downtown: '{"type":"Polygon","coordinates":[[[-73.218,44.487],[-73.203,44.482],[-73.203,44.475],[-73.211,44.466],[-73.22,44.473],[-73.218,44.487]]]}', burlington_downtown_point: '{"type":"Point","coordinates":[-73.21,44.476]}', south_burlington: '{"type":"Polygon","coordinates":[[[-73.175,44.474],[-73.169,44.473],[-73.158,44.466],[-73.162,44.456],[-73.182,44.46],[-73.175,44.474]]]}', south_burlington_point: '{"type":"Point","coordinates":[-73.17,44.467]}', montpelier: '{"type":"Polygon","coordinates":[[[-72.228,44.426],[-72.367,44.204],[-72.442,44.128],[-72.588,44.16],[-72.683,44.013],[-72.916,44.071],[-72.91,44.281],[-72.804,44.451],[-72.653,44.398],[-72.596,44.479],[-72.49,44.425],[-72.433,44.506],[-72.228,44.426]]]}', montpelier_point: '{"type":"Point","coordinates":[-72.486,44.185]}', vermont: '{"type":"Polygon","coordinates":[[[-71.494,45.02],[-71.551,44.58],[-72.03,44.306],[-72.047,44.093],[-72.397,43.542],[-72.466,42.729],[-73.253,42.751],[-73.241,43.542],[-73.423,44.079],[-73.291,44.449],[-73.353,45.009],[-71.494,45.02]]]}', montreal_canada: '{"type":"Polygon","coordinates":[[[-74.064,45.694],[-73.641,45.775],[-73.256,45.614],[-73.234,45.325],[-73.674,45.228],[-74.069,45.34],[-74.064,45.694]]]}', northampton_ma_point: '{"type":"Point","coordinates":[-72.638,42.318]}', }
Class Method Summary collapse
Class Method Details
.ewkb_to_geojson(ewkb) ⇒ Object
10 11 12 13 |
# File 'lib/the_geom_geojson.rb', line 10 def ewkb_to_geojson(ewkb) parser = RGeo::WKRep::WKBParser.new nil, support_ewkb: true JSON.dump RGeo::GeoJSON.encode(parser.parse(ewkb)) end |