PostGIS  2.1.10dev-r@@SVN_REVISION@@
int lwgeom_is_empty ( const LWGEOM geom)

Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)

Definition at line 1229 of file lwgeom.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, LW_FALSE, lwcircstring_is_empty(), lwcollection_is_empty(), LWDEBUGF, lwerror(), lwline_is_empty(), lwpoint_is_empty(), lwpoly_is_empty(), lwtriangle_is_empty(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, result, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by geography_area(), geography_azimuth(), geography_covers(), geography_distance_uncached(), geography_dwithin_uncached(), geography_length(), geography_perimeter(), geography_project(), geometry_to_path(), geometry_to_point(), geometry_to_polygon(), gserialized_from_lwgeom(), lw_dist2d_recursive(), lw_dist3d_recursive(), lwcollection_build_buffer(), lwcollection_extract(), lwcollection_is_empty(), lwcompound_add_lwgeom(), lwcompound_length_2d(), lwcurvepoly_area(), LWGEOM2GEOS(), LWGEOM2SFCGAL(), lwgeom_add_bbox(), lwgeom_add_bbox_deep(), lwgeom_area_sphere(), lwgeom_area_spheroid(), lwgeom_as_multi(), lwgeom_buildarea(), lwgeom_calculate_circ_tree(), lwgeom_check_geodetic(), lwgeom_clip_to_ordinate_range(), LWGEOM_closestpoint(), LWGEOM_closestpoint3d(), lwgeom_count_rings(), lwgeom_count_vertices(), lwgeom_difference(), lwgeom_distance_spheroid(), LWGEOM_dump(), LWGEOM_dumppoints(), LWGEOM_envelope(), LWGEOM_expand(), LWGEOM_exteriorring_polygon(), lwgeom_flip_coordinates(), lwgeom_homogenize(), LWGEOM_inside_circle_point(), LWGEOM_interiorringn_polygon(), lwgeom_interpolate_point(), lwgeom_intersection(), lwgeom_is_closed(), LWGEOM_isempty(), LWGEOM_length_ellipsoid_linestring(), lwgeom_length_spheroid(), LWGEOM_line_substring(), LWGEOM_longestline2d(), LWGEOM_longestline3d(), LWGEOM_m_point(), lwgeom_nudge_geodetic(), LWGEOM_numgeometries_collection(), lwgeom_remove_repeated_points(), LWGEOM_segmentize2d(), lwgeom_segmentize_sphere(), LWGEOM_setpoint_linestring(), LWGEOM_shortestline2d(), LWGEOM_shortestline3d(), lwgeom_symdifference(), LWGEOM_to_BOX2D(), lwgeom_to_gml2(), lwgeom_to_gml3(), lwgeom_to_kml2(), lwgeom_to_svg(), lwgeom_to_wkb_buf(), lwgeom_to_wkb_size(), lwgeom_transform(), lwgeom_union(), LWGEOM_x_point(), LWGEOM_y_point(), LWGEOM_z_point(), lwline_from_lwgeom_array(), lwline_from_lwmpoint(), lwmline_locate_along(), lwmline_measured_from_lwmline(), lwpoint_to_latlon(), lwpoly_covers_point2d(), RASTER_asRaster(), RASTER_clip(), RASTER_nearestValue(), RASTER_setPixelValuesGeomval(), ST_CleanGeometry(), ST_CollectionExtract(), ST_OffsetCurve(), test_lwgeom_is_empty(), and wkt_parser_set_dims().

1230 {
1231  int result = LW_FALSE;
1232  LWDEBUGF(4, "lwgeom_is_empty: got type %s",
1233  lwtype_name(geom->type));
1234 
1235  switch (geom->type)
1236  {
1237  case POINTTYPE:
1238  return lwpoint_is_empty((LWPOINT*)geom);
1239  break;
1240  case LINETYPE:
1241  return lwline_is_empty((LWLINE*)geom);
1242  break;
1243  case CIRCSTRINGTYPE:
1244  return lwcircstring_is_empty((LWCIRCSTRING*)geom);
1245  break;
1246  case POLYGONTYPE:
1247  return lwpoly_is_empty((LWPOLY*)geom);
1248  break;
1249  case TRIANGLETYPE:
1250  return lwtriangle_is_empty((LWTRIANGLE*)geom);
1251  break;
1252  case MULTIPOINTTYPE:
1253  case MULTILINETYPE:
1254  case MULTIPOLYGONTYPE:
1255  case COMPOUNDTYPE:
1256  case CURVEPOLYTYPE:
1257  case MULTICURVETYPE:
1258  case MULTISURFACETYPE:
1259  case POLYHEDRALSURFACETYPE:
1260  case TINTYPE:
1261  case COLLECTIONTYPE:
1262  return lwcollection_is_empty((LWCOLLECTION *)geom);
1263  break;
1264  default:
1265  lwerror("lwgeom_is_empty: unsupported input geometry type: %s",
1266  lwtype_name(geom->type));
1267  break;
1268  }
1269  return result;
1270 }
#define LINETYPE
Definition: liblwgeom.h:61
#define MULTICURVETYPE
Definition: liblwgeom.h:70
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define CURVEPOLYTYPE
Definition: liblwgeom.h:69
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
#define TRIANGLETYPE
Definition: liblwgeom.h:73
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
char ** result
Definition: liblwgeom.h:218
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
int lwtriangle_is_empty(const LWTRIANGLE *triangle)
Definition: lwtriangle.c:162
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
int lwcollection_is_empty(const LWCOLLECTION *col)
Definition: lwcollection.c:471
#define LW_FALSE
Definition: liblwgeom.h:52
#define TINTYPE
Definition: liblwgeom.h:74
int lwpoly_is_empty(const LWPOLY *poly)
Definition: lwpoly.c:327
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
Definition: lwcircstring.c:263
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:464
#define MULTISURFACETYPE
Definition: liblwgeom.h:71
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:258
uint8_t type
Definition: liblwgeom.h:352
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function: