PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ geography_recv()

Datum geography_recv ( PG_FUNCTION_ARGS  )

Definition at line 554 of file geography_inout.c.

555 {
556  StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
557  int32 geog_typmod = -1;
558  LWGEOM *lwgeom = NULL;
559  GSERIALIZED *g_ser = NULL;
560 
561  if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) {
562  geog_typmod = PG_GETARG_INT32(2);
563  }
564 
565  lwgeom = lwgeom_from_wkb((uint8_t*)buf->data, buf->len, LW_PARSER_CHECK_ALL);
566 
567  /* Error on any SRID != default */
568  srid_check_latlong(lwgeom->srid);
569 
570  g_ser = gserialized_geography_from_lwgeom(lwgeom, geog_typmod);
571 
572  /* Clean up temporary object */
573  lwgeom_free(lwgeom);
574 
575  /* Set cursor to the end of buffer (so the backend is happy) */
576  buf->cursor = buf->len;
577 
578  PG_RETURN_POINTER(g_ser);
579 }
GSERIALIZED * gserialized_geography_from_lwgeom(LWGEOM *lwgeom, int32 geog_typmod)
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2115
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
LWGEOM * lwgeom_from_wkb(const uint8_t *wkb, const size_t wkb_size, const char check)
WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory...
Definition: lwin_wkb.c:834
unsigned int int32
Definition: shpopen.c:54
int32_t srid
Definition: liblwgeom.h:460

References gserialized_geography_from_lwgeom(), LW_PARSER_CHECK_ALL, lwgeom_free(), lwgeom_from_wkb(), and LWGEOM::srid.

Here is the call graph for this function: