1128{
1135
1136 gser_input = PG_GETARG_GSERIALIZED_P(0);
1137 npoints = PG_GETARG_INT32(1);
1138
1139 if (npoints < 0)
1140 PG_RETURN_NULL();
1141
1142 if (PG_NARGS() > 2 && ! PG_ARGISNULL(2))
1143 {
1144 seed = PG_GETARG_INT32(2);
1145 if (seed < 1)
1146 {
1147 lwpgerror("ST_GeneratePoints: seed must be greater than zero");
1148 PG_RETURN_NULL();
1149 }
1150 }
1151
1152
1156 PG_FREE_IF_COPY(gser_input, 0);
1157
1158
1159 if (!lwgeom_result)
1160 PG_RETURN_NULL();
1161
1162
1165 PG_RETURN_POINTER(gser_result);
1166}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
LWMPOINT * lwgeom_to_points(const LWGEOM *lwgeom, uint32_t npoints, int32_t seed)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)