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

◆ gserialized1_set_srid()

void gserialized1_set_srid ( GSERIALIZED s,
int32_t  srid 
)

Write the SRID into the serialized form (it is packed into three bytes so this is a handy function).

Definition at line 160 of file gserialized1.c.

161{
162 LWDEBUGF(3, "%s called with srid = %d", __func__, srid);
163
164 srid = clamp_srid(srid);
165
166 /* 0 is our internal unknown value.
167 * We'll map back and forth here for now */
168 if ( srid == SRID_UNKNOWN )
169 srid = 0;
170
171 s->srid[0] = (srid & 0x001F0000) >> 16;
172 s->srid[1] = (srid & 0x0000FF00) >> 8;
173 s->srid[2] = (srid & 0x000000FF);
174}
char * s
Definition cu_in_wkt.c:23
#define SRID_UNKNOWN
Unknown SRID value.
Definition liblwgeom.h:215
int32_t clamp_srid(int32_t srid)
Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from wha...
Definition lwutil.c:339
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106

References clamp_srid(), LWDEBUGF, s, and SRID_UNKNOWN.

Referenced by gserialized1_from_lwgeom(), gserialized_set_srid(), and test_serialized1_srid().

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