Ticket #1322 (closed defect: wontfix)

Opened 18 months ago

Last modified 18 months ago

lwgeom_from_wkt doesn't initialize LWGEOM.bbox

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: trunk
Keywords: Cc:

Description

While adding tests for GML output I found that an LWGEOM constructed via lwgeom_from_wkt is giving a LWGEOM.bbox with value 0x8. Sounds like an uninitialized box. Is it meant to be filled ? If not it should be NULL, I guess.

Beside, the WKT is a 2 points LINESTRING, shouldn't it have a bounding box ?

Change History

Changed 18 months ago by strk

  • status changed from new to closed
  • resolution set to invalid

I'll take it back, the bbox is really NULL. I'll file another bug when it is more clear where the bug is.

Changed 18 months ago by strk

  • status changed from closed to reopened
  • resolution invalid deleted

Actually, I'll let Paul close this if it is by design that lwgeom_from_wkt does _not_ initialize a bounding box.

Changed 18 months ago by strk

There's no function in liblwgeom.h to get the BOX of an LWGEOM ? Or what am I missing ?

Changed 18 months ago by strk

The only ones I find are:

liblwgeom.h:extern int lwgeom_calculate_gbox_geodetic(const LWGEOM *geom, GBOX *gbox);
liblwgeom.h:extern int lwgeom_calculate_gbox_cartesian(const LWGEOM *lwgeom, GBOX *gbox);
liblwgeom.h:extern int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox);

It seems to me that we should have a single public function taking an LWGEOM and reading it's GBOX into the provided GBOX output parameter. Returning 1 on success and 0 on error (no box == empty geometry).

The function could take the LWGEOM by const pointer by still cache the computation.

Changed 18 months ago by strk

#1323 would be a use case for a method to extract (possibly cached) bounding box from an LWGEOM.

Changed 18 months ago by strk

  • status changed from reopened to closed
  • resolution set to wontfix

Ok, Paul confirmed it's by design, and makes sense. I field #1324 for implementing the lazy BBOX constructor.

Note: See TracTickets for help on using tickets.