Module: Sequel
- Defined in:
- lib/stack-service-base/db_ext/geo_ext.rb
Overview
Example usage:
DB.create_table? :geoms do
primary_key :id
Geometry :geom
end
DB.execute "INSERT INTO geoms(geom) VALUES( ST_GeomFromText('POINT(-71.060316 48.432044)', 4326));"
gs = DB[:geoms].all
# Output as WKB format
Sequel::Postgres::GeoDatabaseMethods::Geometry.to_json_format = :wkb
p gs[0].to_json
# Output as GeoJSON format
Sequel::Postgres::GeoDatabaseMethods::Geometry.to_json_format = :geojson
p gs[0].to_json