Class: Sequel::Postgres::GeoDatabaseMethods::Geometry
- Inherits:
-
Object
- Object
- Sequel::Postgres::GeoDatabaseMethods::Geometry
- Defined in:
- lib/stack-service-base/db_ext/geo_ext.rb
Constant Summary collapse
- FACTORY =
4326 (WGS 84), 3857 (Web Mercator):
RGeo::Geos.factory(:native_interface => :capi)
- PARSER =
RGeo::WKRep::WKBParser.new(FACTORY, support_ewkb: true, default_srid: 4326)
Class Attribute Summary collapse
-
.to_json_format ⇒ Object
wkb, geojson.
Instance Attribute Summary collapse
-
#wkb_string ⇒ Object
Returns the value of attribute wkb_string.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(wkb_string) ⇒ Geometry
constructor
A new instance of Geometry.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(wkb_string) ⇒ Geometry
Returns a new instance of Geometry.
37 38 39 |
# File 'lib/stack-service-base/db_ext/geo_ext.rb', line 37 def initialize(wkb_string) @wkb_string = wkb_string end |
Class Attribute Details
.to_json_format ⇒ Object
wkb, geojson
34 35 36 |
# File 'lib/stack-service-base/db_ext/geo_ext.rb', line 34 def to_json_format @to_json_format end |
Instance Attribute Details
#wkb_string ⇒ Object
Returns the value of attribute wkb_string.
36 37 38 |
# File 'lib/stack-service-base/db_ext/geo_ext.rb', line 36 def wkb_string @wkb_string end |
Instance Method Details
#as_json ⇒ Object
45 46 47 |
# File 'lib/stack-service-base/db_ext/geo_ext.rb', line 45 def as_json @wkb_string.to_s end |
#to_json(*a) ⇒ Object
41 42 43 |
# File 'lib/stack-service-base/db_ext/geo_ext.rb', line 41 def to_json(*a) @wkb_string.to_json end |