PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_free()

void lwgeom_free ( LWGEOM geom)

Definition at line 1050 of file lwgeom.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwcircstring_free(), lwcollection_free(), LWDEBUGF, lwerror(), lwline_free(), lwmline_free(), lwmpoint_free(), lwmpoly_free(), lwpoint_free(), lwpoly_free(), lwpsurface_free(), lwtin_free(), lwtriangle_free(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWCOLLECTION::type.

Referenced by _lwt_AddEdge(), _lwt_AddLineEdge(), _lwt_EdgeMotionArea(), _lwt_EdgeSplit(), _lwt_FindAdjacentEdges(), _lwt_split_by_nodes(), _lwt_toposnap(), boundary(), BOX3D_combine(), buildarea1(), buildarea2(), buildarea3(), buildarea4(), buildarea4b(), buildarea5(), buildarea6(), buildarea7(), check_dimension(), CircTreePIP(), cluster_within_distance_garray(), contains(), convexhull(), coveredby(), covers(), cu_twkb(), cu_twkb_idlist(), cu_twkb_in(), cu_wkb(), cu_wkb_empty_point_check(), cu_wkb_from_hexwkb(), cu_wkb_in(), cu_wkt(), do_encoded_polyline_test(), do_geojson_test(), do_geojson_unsupported(), do_geom_test(), do_gml2_extent_test(), do_gml2_test(), do_gml2_test_prefix(), do_gml2_unsupported(), do_gml3_extent_test(), do_gml3_test(), do_gml3_test_nodims(), do_gml3_test_opts(), do_gml3_test_prefix(), do_kml_test(), do_kml_test_prefix(), do_kml_unsupported(), do_lwgeom_flip_coordinates(), do_svg_test(), do_svg_unsupported(), do_test_mindistance2d_tolerance(), do_type_test(), do_x3d3_test(), do_x3d3_unsupported(), errorIfGeometryCollection(), GenerateLineStringGeometry(), GeneratePointGeometry(), GeneratePolygonGeometry(), geography_area(), geography_as_geojson(), geography_as_gml(), geography_as_kml(), geography_as_svg(), geography_azimuth(), geography_covers(), geography_distance(), geography_distance_cache_tolerance(), geography_distance_knn(), geography_distance_uncached(), geography_dwithin(), geography_dwithin_uncached(), geography_from_binary(), geography_from_geometry(), geography_from_text(), geography_in(), geography_length(), geography_out(), geography_perimeter(), geography_project(), geography_recv(), geography_segmentize(), geography_send(), geography_tree_distance(), geom_from_geojson(), geom_from_gml(), geom_from_kml(), geometry_from_geography(), geometry_to_path(), geometry_to_polygon(), GEOS2POSTGIS(), geos_difference(), geos_geomunion(), geos_intersection(), geos_intersects(), gserialized_datum_get_box2df_p(), gserialized_distance_nd(), gserialized_get_gbox_p(), issimple(), isvalid(), line_from_encoded_polyline(), linemerge(), lw_dist2d_circstring_poly(), lw_dist2d_poly_curvepoly(), lwcollection_free(), lwcollection_segmentize2d(), LWGEOM2GEOS(), LWGEOM_affine(), LWGEOM_area_polygon(), LWGEOM_asBinary(), LWGEOM_asEncodedPolyline(), LWGEOM_asEWKT(), LWGEOM_asGeoJson(), LWGEOM_asGML(), LWGEOM_asHEXEWKB(), LWGEOM_asKML(), LWGEOM_asSVG(), LWGEOM_asText(), LWGEOM_asX3D(), LWGEOM_closestpoint(), LWGEOM_closestpoint3d(), LWGEOM_collect(), LWGEOM_curve_segmentize(), LWGEOM_dimension(), LWGEOM_endpoint_linestring(), LWGEOM_expand(), LWGEOM_exteriorring_polygon(), LWGEOM_force_2d(), LWGEOM_force_3dm(), LWGEOM_force_3dz(), LWGEOM_force_4d(), LWGEOM_force_clockwise_poly(), LWGEOM_force_collection(), lwgeom_force_sfs(), lwgeom_from_geojson(), lwgeom_from_gml(), LWGEOM_from_WKB(), LWGEOM_has_arc(), LWGEOM_in(), LWGEOM_interiorringn_polygon(), LWGEOM_isclosed(), LWGEOM_isempty(), LWGEOM_length2d_ellipsoid(), LWGEOM_length2d_linestring(), LWGEOM_length_ellipsoid_linestring(), LWGEOM_length_linestring(), LWGEOM_line_desegmentize(), LWGEOM_line_substring(), LWGEOM_locate_between_m(), LWGEOM_longestline2d(), LWGEOM_longestline3d(), LWGEOM_longitude_shift(), LWGEOM_makeline(), LWGEOM_mindistance2d(), lwgeom_node(), LWGEOM_noop(), LWGEOM_npoints(), LWGEOM_nrings(), LWGEOM_numgeometries_collection(), LWGEOM_numinteriorrings_polygon(), LWGEOM_numpoints_linestring(), LWGEOM_out(), lwgeom_over_gserialized(), lwgeom_parser_result_free(), LWGEOM_pointn_linestring(), LWGEOM_recv(), LWGEOM_same(), LWGEOM_segmentize2d(), LWGEOM_SetEffectiveArea(), LWGEOM_shortestline2d(), LWGEOM_shortestline3d(), LWGEOM_simplify2d(), LWGEOM_startpoint_linestring(), lwgeom_subdivide_recursive(), LWGEOM_summary(), LWGEOM_to_BOX3D(), LWGEOM_to_text(), LWGEOMFromEWKB(), LWGEOMFromTWKB(), lwt_AddLine(), lwt_AddPoint(), lwt_AddPolygon(), lwt_ChangeEdgeGeom(), lwt_GetFaceEdges(), perform_cluster_intersecting_test(), perform_cluster_within_distance_test(), polyhedralsurface_parse(), POSTGIS2GEOS(), POSTGIS2SFCGALGeometry(), POSTGIS2SFCGALPreparedGeometry(), RASTER_asRaster(), RASTER_clip(), RASTER_convex_hull(), RASTER_dumpAsPolygons(), RASTER_envelope(), RASTER_getPixelPolygons(), RASTER_nearestValue(), RASTER_setPixelValuesGeomval(), rt_raster_compute_skewed_raster(), rt_raster_fully_within_distance(), rt_raster_gdal_polygonize(), rt_raster_gdal_rasterize(), rt_raster_intersects(), rt_raster_surface(), rt_raster_within_distance(), rtpg_setvaluesgv_arg_destroy(), sfcgal_is_solid(), sfcgal_make_solid(), SFCGALGeometry2POSTGIS(), ShpLoaderGenerateShapeRow(), ST_AddMeasure(), ST_BoundingDiagonal(), ST_BuildArea(), ST_ClipByBox2d(), ST_ClosestPointOfApproach(), ST_CollectionExtract(), ST_CollectionHomogenize(), ST_CPAWithin(), ST_DelaunayTriangles(), ST_DistanceCPA(), ST_FlipCoordinates(), ST_IsValidTrajectory(), ST_LocateAlong(), ST_LocateBetween(), ST_LocateBetweenElevations(), ST_Node(), ST_OffsetCurve(), ST_RemoveRepeatedPoints(), ST_Scale(), ST_SharedPaths(), ST_Snap(), ST_Split(), ST_SwapOrdinates(), ST_UnaryUnion(), symdifference(), test_gbox_from_spherical_coordinates(), test_gbox_same_2d(), test_gbox_utils(), test_gdal_polygonize(), test_geos_linemerge(), test_geos_noop(), test_geos_subdivide(), test_grid(), test_gserialized_from_lwgeom(), test_gserialized_from_lwgeom_size(), test_gserialized_get_gbox_geocentric(), test_gserialized_is_empty(), test_isclosed(), test_lwcollection_extract(), test_lwgeom_area_sphere(), test_lwgeom_as_curve(), test_lwgeom_calculate_gbox(), test_lwgeom_check_geodetic(), test_lwgeom_clip_by_rect(), test_lwgeom_clone(), test_lwgeom_count_vertices(), test_lwgeom_delaunay_triangulation(), test_lwgeom_distance_sphere(), test_lwgeom_force_clockwise(), test_lwgeom_free(), test_lwgeom_from_gserialized(), test_lwgeom_is_empty(), test_lwgeom_is_trajectory(), test_lwgeom_locate_along(), test_lwgeom_make_valid(), test_lwgeom_node(), test_lwgeom_same(), test_lwgeom_scale(), test_lwgeom_segmentize2d(), test_lwgeom_segmentize_sphere(), test_lwgeom_simplify(), test_lwgeom_split(), test_lwgeom_tcpa(), test_lwpoly_covers_point2d(), test_misc_area(), test_misc_count_vertices(), test_misc_force_2d(), test_misc_simplify(), test_misc_wkb(), test_on_gser_lwgeom_count_vertices(), test_ptarray_contains_point_sphere(), test_ptarray_contains_point_sphere_iowa(), test_ptarray_unstroke(), test_raster_convex_hull(), test_raster_envelope_geom(), test_raster_perimeter(), test_sfcgal_noop(), test_spheroid_area(), test_tree_circ_distance(), test_tree_circ_distance_threshold(), test_tree_circ_pip2(), tin_parse(), transform(), transform_geom(), triangle_parse(), TWKBFromLWGEOM(), WKBFromLWGEOM(), wkt_parser_collection_finalize(), wkt_parser_compound_add_geom(), wkt_parser_compound_new(), wkt_parser_curvepolygon_add_ring(), wkt_parser_curvepolygon_finalize(), wkt_parser_polygon_add_ring(), wkt_parser_polygon_finalize(), and yydestruct().

1051 {
1052 
1053  /* There's nothing here to free... */
1054  if( ! lwgeom ) return;
1055 
1056  LWDEBUGF(5,"freeing a %s",lwtype_name(lwgeom->type));
1057 
1058  switch (lwgeom->type)
1059  {
1060  case POINTTYPE:
1061  lwpoint_free((LWPOINT *)lwgeom);
1062  break;
1063  case LINETYPE:
1064  lwline_free((LWLINE *)lwgeom);
1065  break;
1066  case POLYGONTYPE:
1067  lwpoly_free((LWPOLY *)lwgeom);
1068  break;
1069  case CIRCSTRINGTYPE:
1070  lwcircstring_free((LWCIRCSTRING *)lwgeom);
1071  break;
1072  case TRIANGLETYPE:
1073  lwtriangle_free((LWTRIANGLE *)lwgeom);
1074  break;
1075  case MULTIPOINTTYPE:
1076  lwmpoint_free((LWMPOINT *)lwgeom);
1077  break;
1078  case MULTILINETYPE:
1079  lwmline_free((LWMLINE *)lwgeom);
1080  break;
1081  case MULTIPOLYGONTYPE:
1082  lwmpoly_free((LWMPOLY *)lwgeom);
1083  break;
1084  case POLYHEDRALSURFACETYPE:
1085  lwpsurface_free((LWPSURFACE *)lwgeom);
1086  break;
1087  case TINTYPE:
1088  lwtin_free((LWTIN *)lwgeom);
1089  break;
1090  case CURVEPOLYTYPE:
1091  case COMPOUNDTYPE:
1092  case MULTICURVETYPE:
1093  case MULTISURFACETYPE:
1094  case COLLECTIONTYPE:
1095  lwcollection_free((LWCOLLECTION *)lwgeom);
1096  break;
1097  default:
1098  lwerror("lwgeom_free called with unknown type (%d) %s", lwgeom->type, lwtype_name(lwgeom->type));
1099  }
1100  return;
1101 }
#define LINETYPE
Definition: liblwgeom.h:71
#define MULTICURVETYPE
Definition: liblwgeom.h:80
void lwmline_free(LWMLINE *mline)
Definition: lwmline.c:98
void lwcircstring_free(LWCIRCSTRING *curve)
Definition: lwcircstring.c:85
#define POLYGONTYPE
Definition: liblwgeom.h:72
void lwtin_free(LWTIN *tin)
Definition: lwtin.c:26
#define CURVEPOLYTYPE
Definition: liblwgeom.h:79
void lwpoint_free(LWPOINT *pt)
Definition: lwpoint.c:182
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
void lwline_free(LWLINE *line)
Definition: lwline.c:63
#define TRIANGLETYPE
Definition: liblwgeom.h:83
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:82
void lwmpoly_free(LWMPOLY *mpoly)
Definition: lwmpoly.c:40
void lwmpoint_free(LWMPOINT *mpt)
Definition: lwmpoint.c:59
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:79
#define TINTYPE
Definition: liblwgeom.h:84
void lwtriangle_free(LWTRIANGLE *triangle)
Definition: lwtriangle.c:56
void lwpsurface_free(LWPSURFACE *psurf)
Definition: lwpsurface.c:26
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define MULTISURFACETYPE
Definition: liblwgeom.h:81
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:326
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
#define MULTILINETYPE
Definition: liblwgeom.h:74
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76
Here is the call graph for this function: