139 char *str = PG_GETARG_CSTRING(0);
141 int32 geog_typmod = -1;
146 if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) {
147 geog_typmod = PG_GETARG_INT32(2);
153 if ( str[0] ==
'\0' )
154 ereport(ERROR,(errmsg(
"parse error - invalid geometry")));
163 ereport(ERROR,(errmsg(
"parse error - invalid geometry")));
169 PG_PARSER_ERROR(lwg_parser_result);
171 lwgeom = lwg_parser_result.
geom;
175 srid_is_latlong(fcinfo, lwgeom->
srid);
184 PG_RETURN_POINTER(g_ser);
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
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...
LWGEOM * lwgeom_from_hexwkb(const char *hexwkb, const char check)
void lwgeom_parser_result_init(LWGEOM_PARSER_RESULT *parser_result)
GSERIALIZED * gserialized_geography_from_lwgeom(LWGEOM *lwgeom, int32 geog_typmod)
#define LW_PARSER_CHECK_ALL