Method: RGeo::Geos::CAPIGeometryMethods#sym_difference

Defined in:
ext/geos_c_impl/geometry.c

#sym_difference(rhs) ⇒ Object



947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
# File 'ext/geos_c_impl/geometry.c', line 947

static VALUE
method_geometry_sym_difference(VALUE self, VALUE rhs)
{
  VALUE result;
  RGeo_GeometryData* self_data;
  const GEOSGeometry* self_geom;
  VALUE factory;
  const GEOSGeometry* rhs_geom;
  int state = 0;

  result = Qnil;
  self_data = RGEO_GEOMETRY_DATA_PTR(self);
  self_geom = self_data->geom;
  if (self_geom) {
    factory = self_data->factory;
    rhs_geom = rgeo_convert_to_geos_geometry(factory, rhs, Qnil, &state);
    if (state) {
      rb_jump_tag(state);
    }

    result = rgeo_wrap_geos_geometry(
      factory, GEOSSymDifference(self_geom, rhs_geom), Qnil);
  }
  return result;
}