663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
|
# File 'ext/geos_c_impl/geometry.c', line 663
static VALUE
method_geometry_relate(VALUE self, VALUE rhs, VALUE pattern)
{
VALUE result;
RGeo_GeometryData* self_data;
const GEOSGeometry* self_geom;
const GEOSGeometry* rhs_geom;
char val;
int state = 0;
result = Qnil;
self_data = RGEO_GEOMETRY_DATA_PTR(self);
self_geom = self_data->geom;
if (self_geom) {
rhs_geom =
rgeo_convert_to_geos_geometry(self_data->factory, rhs, Qnil, &state);
if (state) {
rb_jump_tag(state);
}
val = GEOSRelatePattern(self_geom, rhs_geom, StringValuePtr(pattern));
if (val == 0) {
result = Qfalse;
} else if (val == 1) {
result = Qtrue;
}
}
return result;
}
|