Method: RGeo::Geos::CAPILineStringImpl.create

Defined in:
ext/geos_c_impl/line_string.c

.create(factory, array) ⇒ Object

Class methods for CAPILineStringImpl



480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'ext/geos_c_impl/line_string.c', line 480

static VALUE
cmethod_create_line_string(VALUE module, VALUE factory, VALUE array)
{
  VALUE result;
  GEOSCoordSequence* coord_seq;
  GEOSGeometry* geom;

  result = Qnil;
  coord_seq = coord_seq_from_array(factory, array, 0);
  if (coord_seq) {
    geom = GEOSGeom_createLineString(coord_seq);
    if (geom) {
      result =
        rgeo_wrap_geos_geometry(factory, geom, rgeo_geos_line_string_class);
    }
  }
  return result;
}