1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
|
# File 'ext/geos_c_impl/geometry.c', line 1107
static VALUE
method_geometry_invalid_reason_location(VALUE self)
{
VALUE result;
RGeo_GeometryData* self_data;
const GEOSGeometry* self_geom;
GEOSGeometry* location = NULL;
result = Qnil;
self_data = RGEO_GEOMETRY_DATA_PTR(self);
self_geom = self_data->geom;
if (self_geom) {
// We use NULL there to tell GEOS that we don't care about the reason.
switch (GEOSisValidDetail(self_geom, 0, NULL, &location)) {
case 0: // invalid
result = rgeo_wrap_geos_geometry(self_data->factory, location, Qnil);
case 1: // valid
break;
case 2: // exception
break;
default:
break;
};
}
return result;
}
|