371 GEOSGeometry* envelope;
373 GEOSCoordSequence* seq = GEOSCoordSeq_create(5, 2);
374 if (!seq)
return NULL;
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);
382 ring = GEOSGeom_createLinearRing(seq);
385 GEOSCoordSeq_destroy(seq);
389 envelope = GEOSGeom_createPolygon(ring, NULL, 0);
392 GEOSGeom_destroy(ring);