120{
123 char *input_srs, *output_srs;
125 int rv;
126
127
128 gser = PG_GETARG_GSERIALIZED_P_COPY(0);
129
130
131 input_srs = text_to_cstring(PG_GETARG_TEXT_P(1));
132 output_srs = text_to_cstring(PG_GETARG_TEXT_P(2));
133 result_srid = PG_GETARG_INT32(3);
134
135
138 pfree(input_srs);
139 pfree(output_srs);
140
142 {
143 elog(ERROR, "coordinate transformation failed");
144 PG_RETURN_NULL();
145 }
146
147
148 geom->
srid = result_srid;
151
152 gser_result = geometry_serialize(geom);
154 PG_FREE_IF_COPY(gser, 0);
155
156 PG_RETURN_POINTER(gser_result);
157}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_refresh_bbox(LWGEOM *lwgeom)
Drop current bbox and calculate a fresh one.
void lwgeom_free(LWGEOM *geom)
int lwgeom_transform_from_str(LWGEOM *geom, const char *instr, const char *outstr)