Sha256: 3cb2328ebcf66b92320d435f777e1cd36c9edf809cac40bfa7eeaa26bcf337b4

Contents?: true

Size: 432 Bytes

Versions: 1

Compression:

Stored size: 432 Bytes

Contents

def geometry_from_text(text, srid = 4326)
  GeoRuby::SimpleFeatures::Geometry.from_ewkt "SRID=#{srid};#{text}"
end

def point(x=0.0, y=0.0, srid = 4326)
  GeoRuby::SimpleFeatures::Point.from_x_y x, y, srid
end

def line_string(*points)
  if points.one? and String === points.first
     geometry_from_text("LINESTRING(#{points.first})")
  else
    GeoRuby::SimpleFeatures::LineString.from_points(points, points.first.srid)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_road-0.0.2 spec/support/georuby_ext.rb