PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwpoint_construct()

LWPOINT* lwpoint_construct ( int  srid,
GBOX bbox,
POINTARRAY point 
)

Definition at line 98 of file lwpoint.c.

References LWPOINT::bbox, POINTARRAY::flags, LWPOINT::flags, FLAGS_GET_M, FLAGS_GET_Z, FLAGS_SET_BBOX, FLAGS_SET_M, FLAGS_SET_Z, lwalloc(), LWPOINT::point, POINTTYPE, LWPOINT::srid, and LWPOINT::type.

Referenced by BOX3D_to_LWGEOM(), GeneratePointGeometry(), GEOS2LWGEOM(), lwcircstring_get_lwpoint(), LWGEOM_line_interpolate_point(), LWGEOM_line_substring(), lwgeom_project_spheroid(), lwline_clip_to_ordinate_range(), lwline_get_lwpoint(), lwline_locate_between_m(), lwline_make_geos_friendly(), lwpoint_force_dims(), lwpoint_from_twkb_state(), lwpoint_from_wkb_state(), lwpoint_grid(), lwpoint_make(), lwpoint_make2d(), lwpoint_make3dm(), lwpoint_make3dz(), lwpoint_make4d(), parse_geojson_multipoint(), parse_geojson_point(), parse_gml_point(), parse_kml_point(), SFCGAL2LWGEOM(), and wkt_parser_point_new().

99 {
100  LWPOINT *result;
101  uint8_t flags = 0;
102 
103  if (point == NULL)
104  return NULL; /* error */
105 
106  result = lwalloc(sizeof(LWPOINT));
107  result->type = POINTTYPE;
108  FLAGS_SET_Z(flags, FLAGS_GET_Z(point->flags));
109  FLAGS_SET_M(flags, FLAGS_GET_M(point->flags));
110  FLAGS_SET_BBOX(flags, bbox?1:0);
111  result->flags = flags;
112  result->srid = srid;
113  result->point = point;
114  result->bbox = bbox;
115 
116  return result;
117 }
uint8_t type
Definition: liblwgeom.h:391
POINTARRAY * point
Definition: liblwgeom.h:395
#define FLAGS_SET_Z(flags, value)
Definition: liblwgeom.h:130
uint8_t flags
Definition: liblwgeom.h:353
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
int32_t srid
Definition: liblwgeom.h:394
uint8_t flags
Definition: liblwgeom.h:392
#define FLAGS_SET_BBOX(flags, value)
Definition: liblwgeom.h:132
GBOX * bbox
Definition: liblwgeom.h:393
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
void * lwalloc(size_t size)
Definition: lwutil.c:199
#define FLAGS_SET_M(flags, value)
Definition: liblwgeom.h:131
Here is the call graph for this function:
Here is the caller graph for this function: