PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int lwgeom_wkb_needs_srid ( const LWGEOM geom,
uint8_t  variant 

Definition at line 47 of file lwout_wkb.c.

References LW_FALSE, LW_TRUE, lwgeom_has_srid(), WKB_EXTENDED, and WKB_NO_SRID.

Referenced by empty_to_wkb_buf(), empty_to_wkb_size(), lwcollection_to_wkb_buf(), lwcollection_to_wkb_size(), lwgeom_wkb_type(), lwline_to_wkb_buf(), lwline_to_wkb_size(), lwpoint_to_wkb_buf(), lwpoint_to_wkb_size(), lwpoly_to_wkb_buf(), lwpoly_to_wkb_size(), lwtriangle_to_wkb_buf(), and lwtriangle_to_wkb_size().

48 {
49  /* Sub-components of collections inherit their SRID from the parent.
50  We force that behavior with the WKB_NO_SRID flag */
51  if ( variant & WKB_NO_SRID )
52  return LW_FALSE;
54  /* We can only add an SRID if the geometry has one, and the
55  WKB form is extended */
56  if ( (variant & WKB_EXTENDED) && lwgeom_has_srid(geom) )
57  return LW_TRUE;
59  /* Everything else doesn't get an SRID */
60  return LW_FALSE;
61 }
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
Definition: lwgeom.c:1272
#define LW_FALSE
Definition: liblwgeom.h:52
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
Definition: liblwgeom.h:1769
#define WKB_NO_SRID
Definition: liblwgeom.h:1774

Here is the call graph for this function:

Here is the caller graph for this function: