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

Definition at line 2073 of file lwgeom_functions_basic.c.

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

2074 {
2075  double x,y,z,m;
2076  LWPOINT *point;
2077  GSERIALIZED *result;
2078 
2079  POSTGIS_DEBUG(2, "LWGEOM_makepoint called");
2080 
2081  x = PG_GETARG_FLOAT8(0);
2082  y = PG_GETARG_FLOAT8(1);
2083 
2084  if ( PG_NARGS() == 2 ) point = lwpoint_make2d(SRID_UNKNOWN, x, y);
2085  else if ( PG_NARGS() == 3 )
2086  {
2087  z = PG_GETARG_FLOAT8(2);
2088  point = lwpoint_make3dz(SRID_UNKNOWN, x, y, z);
2089  }
2090  else if ( PG_NARGS() == 4 )
2091  {
2092  z = PG_GETARG_FLOAT8(2);
2093  m = PG_GETARG_FLOAT8(3);
2094  point = lwpoint_make4d(SRID_UNKNOWN, x, y, z, m);
2095  }
2096  else
2097  {
2098  elog(ERROR, "LWGEOM_makepoint: unsupported number of args: %d",
2099  PG_NARGS());
2100  PG_RETURN_NULL();
2101  }
2102 
2103  result = geometry_serialize((LWGEOM *)point);
2104 
2105  PG_RETURN_POINTER(result);
2106 }
LWPOINT * lwpoint_make2d(int srid, double x, double y)
Definition: lwpoint.c:132
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:172
LWPOINT * lwpoint_make3dz(int srid, double x, double y, double z)
Definition: lwpoint.c:142
tuple x
Definition: pixval.py:53
LWPOINT * lwpoint_make4d(int srid, double x, double y, double z, double m)
Definition: lwpoint.c:164
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
tuple y
Definition: pixval.py:54

Here is the call graph for this function: