138 char *
str = PG_GETARG_CSTRING(0);
140 int32 geog_typmod = -1;
145 if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) {
146 geog_typmod = PG_GETARG_INT32(2);
152 if (
str[0] ==
'\0' )
153 ereport(ERROR,(errmsg(
"parse error - invalid geometry")));
162 ereport(ERROR,(errmsg(
"parse error - invalid geometry")));
168 PG_PARSER_ERROR(lwg_parser_result);
170 lwgeom = lwg_parser_result.
geom;
174 srid_check_latlong(fcinfo, lwgeom->
srid);
183 PG_RETURN_POINTER(g_ser);
GSERIALIZED * gserialized_geography_from_lwgeom(LWGEOM *lwgeom, int32 geog_typmod)
#define LW_PARSER_CHECK_ALL
LWGEOM * lwgeom_from_hexwkb(const char *hexwkb, const char check)
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
void lwgeom_parser_result_init(LWGEOM_PARSER_RESULT *parser_result)
int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags)
Parse a WKT geometry string into an LWGEOM structure.
Parser result structure: returns the result of attempting to convert (E)WKT/(E)WKB to LWGEOM.