class Geos::WktReader
Attributes
ptr[R]
Public Class Methods
new(*args)
click to toggle source
# File lib/ffi-geos/wkt_reader.rb, line 12 def initialize(*args) ptr = if args.first.is_a?(FFI::Pointer) args.first else FFIGeos.GEOSWKTReader_create_r(Geos.current_handle_pointer, *args) end @ptr = FFI::AutoPointer.new( ptr, self.class.method(:release) ) end
Public Instance Methods
read(wkt, options = {})
click to toggle source
# File lib/ffi-geos/wkt_reader.rb, line 25 def read(wkt, options = {}) cast_geometry_ptr(FFIGeos.GEOSWKTReader_read_r(Geos.current_handle_pointer, ptr, wkt), srid: options[:srid]) rescue Geos::GEOSException => e raise ParseError, e end