Class: Charta::Factory::Transformers::FromGmlTransformer

Inherits:
EwktTransformer show all
Defined in:
lib/charta/factory/transformers/from_gml_transformer.rb

Instance Method Summary collapse

Instance Method Details

#handles?(value, format:) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/charta/factory/transformers/from_gml_transformer.rb', line 8

def handles?(value, format:)
  value.is_a?(String) && format == 'gml' && Charta::GML.valid?(value)
end

#transform(value, srid: nil, format: nil) ⇒ String

Returns ewkt representation of value.

Parameters:

  • value (String, Hash)

Returns:

  • (String)

    ewkt representation of value



14
15
16
# File 'lib/charta/factory/transformers/from_gml_transformer.rb', line 14

def transform(value, srid: nil, format: nil)
  Charta::GML.new(value, srid).to_ewkt
end