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

◆ lwgeom_wkb_needs_srid()

static int lwgeom_wkb_needs_srid ( const LWGEOM geom,
uint8_t  variant 
)
static

Definition at line 64 of file lwout_wkb.c.

65{
66 /* Sub-components of collections inherit their SRID from the parent.
67 We force that behavior with the WKB_NO_SRID flag */
68 if ( variant & WKB_NO_SRID )
69 return LW_FALSE;
70
71 /* We can only add an SRID if the geometry has one, and the
72 WKB form is extended */
73 if ( (variant & WKB_EXTENDED) && lwgeom_has_srid(geom) )
74 return LW_TRUE;
75
76 /* Everything else doesn't get an SRID */
77 return LW_FALSE;
78}
static uint8_t variant
Definition cu_in_twkb.c:26
#define LW_FALSE
Definition liblwgeom.h:94
#define WKB_NO_SRID
Definition liblwgeom.h:2217
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
Definition lwgeom.c:1495
#define WKB_EXTENDED
Definition liblwgeom.h:2212
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:93

References LW_FALSE, LW_TRUE, lwgeom_has_srid(), variant, 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().

Here is the call graph for this function:
Here is the caller graph for this function: