PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum LWGEOM_makepoint ( PG_FUNCTION_ARGS  )

Definition at line 2106 of file lwgeom_functions_basic.c.

References geometry_serialize(), lwpoint_make2d(), lwpoint_make3dz(), lwpoint_make4d(), SRID_UNKNOWN, pixval::x, and pixval::y.

2107 {
2108  double x,y,z,m;
2109  LWPOINT *point;
2110  GSERIALIZED *result;
2111 
2112  POSTGIS_DEBUG(2, "LWGEOM_makepoint called");
2113 
2114  x = PG_GETARG_FLOAT8(0);
2115  y = PG_GETARG_FLOAT8(1);
2116 
2117  if ( PG_NARGS() == 2 ) point = lwpoint_make2d(SRID_UNKNOWN, x, y);
2118  else if ( PG_NARGS() == 3 )
2119  {
2120  z = PG_GETARG_FLOAT8(2);
2121  point = lwpoint_make3dz(SRID_UNKNOWN, x, y, z);
2122  }
2123  else if ( PG_NARGS() == 4 )
2124  {
2125  z = PG_GETARG_FLOAT8(2);
2126  m = PG_GETARG_FLOAT8(3);
2127  point = lwpoint_make4d(SRID_UNKNOWN, x, y, z, m);
2128  }
2129  else
2130  {
2131  elog(ERROR, "LWGEOM_makepoint: unsupported number of args: %d",
2132  PG_NARGS());
2133  PG_RETURN_NULL();
2134  }
2135 
2136  result = geometry_serialize((LWGEOM *)point);
2137 
2138  PG_RETURN_POINTER(result);
2139 }
LWPOINT * lwpoint_make2d(int srid, double x, double y)
Definition: lwpoint.c:163
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:187
LWPOINT * lwpoint_make3dz(int srid, double x, double y, double z)
Definition: lwpoint.c:173
tuple x
Definition: pixval.py:53
LWPOINT * lwpoint_make4d(int srid, double x, double y, double z, double m)
Definition: lwpoint.c:195
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
tuple y
Definition: pixval.py:54

Here is the call graph for this function: