Method: RGeo::Geos::CAPIPolygonMethods#area

Defined in:
ext/geos_c_impl/polygon.c

#areaObject



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'ext/geos_c_impl/polygon.c', line 65

static VALUE
method_polygon_area(VALUE self)
{
  VALUE result;
  RGeo_GeometryData* self_data;
  const GEOSGeometry* self_geom;
  double area;

  result = Qnil;
  self_data = RGEO_GEOMETRY_DATA_PTR(self);
  self_geom = self_data->geom;
  if (self_geom) {
    if (GEOSArea(self_geom, &area)) {
      result = rb_float_new(area);
    }
  }
  return result;
}