def save(self, *args, **kwargs): self.the_geom = force2d(self.the_geom) self.simplified_geom = simplify_geom(self.the_geom,force_buffer=self.buffer_aoi) super(Job, self).save(*args, **kwargs)
def test_force_2d(self): geojson3d = '{"type":"Polygon","coordinates":[[[-17.279434,14.732386,0],[-17.229996,14.732386,0],[-17.229996,14.779531,0],[-17.279434,14.779531,0],[-17.279434,14.732386,0]]]}}' aoi_geom = GEOSGeometry(geojson3d) aoi_geom = force2d(aoi_geom) self.assertEqual(len(aoi_geom.coords[0][0]), 2)