PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ GBOX2GEOS()

GEOSGeometry * GBOX2GEOS ( const GBOX box)

Definition at line 369 of file liblwgeom/lwgeom_geos.c.

370{
371 GEOSGeometry* envelope;
372 GEOSGeometry* ring;
373 GEOSCoordSequence* seq = GEOSCoordSeq_create(5, 2);
374 if (!seq) return NULL;
375
376 GEOSCoordSeq_setXY(seq, 0, box->xmin, box->ymin);
377 GEOSCoordSeq_setXY(seq, 1, box->xmax, box->ymin);
378 GEOSCoordSeq_setXY(seq, 2, box->xmax, box->ymax);
379 GEOSCoordSeq_setXY(seq, 3, box->xmin, box->ymax);
380 GEOSCoordSeq_setXY(seq, 4, box->xmin, box->ymin);
381
382 ring = GEOSGeom_createLinearRing(seq);
383 if (!ring)
384 {
385 GEOSCoordSeq_destroy(seq);
386 return NULL;
387 }
388
389 envelope = GEOSGeom_createPolygon(ring, NULL, 0);
390 if (!envelope)
391 {
392 GEOSGeom_destroy(ring);
393 return NULL;
394 }
395
396 return envelope;
397}
double ymax
Definition liblwgeom.h:357
double xmax
Definition liblwgeom.h:355
double ymin
Definition liblwgeom.h:356
double xmin
Definition liblwgeom.h:354

References GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

Referenced by lwgeom_voronoi_diagram().

Here is the caller graph for this function: