Class: Charta::Factory::EwktFeatureBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/charta/factory/ewkt_feature_builder.rb

Instance Method Summary collapse

Instance Method Details

#from_ewkt(ewkt) ⇒ RGeo::Feature::Instance

Parameters:

  • ewkt (String)

    EWKT representation of a feature

Returns:

  • (RGeo::Feature::Instance)


8
9
10
11
12
13
14
# File 'lib/charta/factory/ewkt_feature_builder.rb', line 8

def from_ewkt(ewkt)
  if ewkt.to_s =~ /\A[[:space:]]*\z/
    raise ArgumentError.new("Invalid data: #{ewkt.inspect}")
  end

  Geometry.feature(ewkt)
end