PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_wkb_needs_srid()

static int lwgeom_wkb_needs_srid ( const LWGEOM geom,
uint8_t  variant 

Definition at line 49 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().

50 {
51  /* Sub-components of collections inherit their SRID from the parent.
52  We force that behavior with the WKB_NO_SRID flag */
53  if ( variant & WKB_NO_SRID )
54  return LW_FALSE;
56  /* We can only add an SRID if the geometry has one, and the
57  WKB form is extended */
58  if ( (variant & WKB_EXTENDED) && lwgeom_has_srid(geom) )
59  return LW_TRUE;
61  /* Everything else doesn't get an SRID */
62  return LW_FALSE;
63 }
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
Definition: lwgeom.c:1340
uint8_t variant
Definition: cu_in_twkb.c:26
#define LW_FALSE
Definition: liblwgeom.h:62
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:61
Definition: liblwgeom.h:1932
#define WKB_NO_SRID
Definition: liblwgeom.h:1937
Here is the call graph for this function:
Here is the caller graph for this function: