1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
|
# File 'ext/geos_c_impl/geometry.c', line 1134
static VALUE
method_geometry_make_valid(VALUE self)
{
RGeo_GeometryData* self_data;
const GEOSGeometry* self_geom;
GEOSGeometry* valid_geom;
self_data = RGEO_GEOMETRY_DATA_PTR(self);
self_geom = self_data->geom;
if (!self_geom)
return Qnil;
// According to GEOS implementation, MakeValid always returns.
valid_geom = GEOSMakeValid(self_geom);
if (!valid_geom) {
rb_raise(rb_eRGeoInvalidGeometry,
"%" PRIsVALUE,
method_geometry_invalid_reason(self));
}
return rgeo_wrap_geos_geometry(self_data->factory, valid_geom, Qnil);
}
|