587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
|
# File 'ext/geos_c_impl/geometry.c', line 587
static VALUE
method_geometry_contains(VALUE self, VALUE rhs)
{
VALUE result;
RGeo_GeometryData* self_data;
const GEOSGeometry* self_geom;
const GEOSGeometry* rhs_geom;
char val;
int state = 0;
const GEOSPreparedGeometry* prep;
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);
}
prep = rgeo_request_prepared_geometry(self_data);
if (prep)
val = GEOSPreparedContains(prep, rhs_geom);
else
val = GEOSContains(self_geom, rhs_geom);
if (val == 0) {
result = Qfalse;
} else if (val == 1) {
result = Qtrue;
}
}
return result;
}
|