PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_free()

void lwgeom_free ( LWGEOM geom)

Definition at line 1099 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(), assert_empty_diagram(), basic_test(), boundary(), BOX3D_combine(), buildarea1(), buildarea2(), buildarea3(), buildarea4(), buildarea4b(), buildarea5(), buildarea6(), buildarea7(), centroid(), 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_dbscan_test(), do_encoded_polyline_test(), do_fn_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_median_dims_check(), do_median_test(), do_svg_test(), do_svg_unsupported(), do_test_mindistance_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_centroid_from_mline(), geography_centroid_from_mpoly(), 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_distance_nd(), gserialized_get_gbox_p(), issimple(), isvalid(), line_from_encoded_polyline(), linemerge(), lw_dist2d_circstring_poly(), lw_dist2d_poly_curvepoly(), lwcollection_free(), lwcollection_from_wkb_state(), lwcollection_segmentize2d(), lwcollection_wrapx(), lwcurvepoly_from_wkb_state(), 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_parse_wkt(), lwgeom_parser_result_free(), LWGEOM_pointn_linestring(), LWGEOM_recv(), LWGEOM_same(), LWGEOM_segmentize2d(), LWGEOM_SetEffectiveArea(), LWGEOM_shortestline2d(), LWGEOM_shortestline3d(), LWGEOM_simplify2d(), lwgeom_split_wrapx(), LWGEOM_startpoint_linestring(), lwgeom_subdivide_recursive(), LWGEOM_summary(), LWGEOM_to_BOX3D(), lwgeom_to_text(), LWGEOM_to_text(), LWGEOMFromEWKB(), LWGEOMFromTWKB(), lwt_AddLine(), lwt_AddPoint(), lwt_AddPolygon(), lwt_ChangeEdgeGeom(), lwt_GetFaceEdges(), mvt_agg_transfn(), mvt_geom(), perform_cluster_intersecting_test(), perform_cluster_within_distance_test(), pip_short_circuit(), 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_AsMVTGeom(), ST_BoundingDiagonal(), ST_BuildArea(), ST_ClipByBox2d(), ST_ClosestPointOfApproach(), ST_ClusterDBSCAN(), ST_ClusterKMeans(), ST_CollectionExtract(), ST_CollectionHomogenize(), ST_CPAWithin(), ST_CurveToLine(), ST_DelaunayTriangles(), ST_DistanceCPA(), ST_FlipCoordinates(), ST_GeneratePoints(), ST_GeometricMedian(), ST_IsPolygonCCW(), ST_IsPolygonCW(), ST_IsValidTrajectory(), ST_LocateAlong(), ST_LocateBetween(), ST_LocateBetweenElevations(), ST_MinimumBoundingCircle(), ST_MinimumBoundingRadius(), ST_Node(), ST_Normalize(), ST_OffsetCurve(), ST_Points(), ST_RemoveRepeatedPoints(), ST_Scale(), ST_SharedPaths(), ST_Snap(), ST_Split(), ST_SwapOrdinates(), ST_UnaryUnion(), ST_Voronoi(), ST_WrapX(), symdifference(), test_cannot_modify_read_only(), test_clone(), test_empty(), 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_gserialized_peek_gbox_p_fails_for_unsupported_cases(), test_gserialized_peek_gbox_p_gets_correct_box(), test_gserialized_peek_gbox_p_no_box_when_empty(), test_isclosed(), test_kmeans(), test_lwcollection_extract(), test_lwcurve_linearize(), 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_lwgeom_voronoi_diagram(), test_lwgeom_voronoi_diagram_custom_envelope(), test_lwgeom_wrapx(), test_lwpoly_covers_point2d(), test_misc_area(), test_misc_count_vertices(), test_misc_force_2d(), test_misc_simplify(), test_misc_wkb(), test_mixed_rw_access(), test_modification(), test_no_memory_leaked_when_iterator_is_partially_used(), test_on_gser_lwgeom_count_vertices(), test_ordering(), test_point_count(), test_point_density(), 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(), test_wkb_leak(), tin_parse(), transform(), transform_geom(), triangle_parse(), 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().

1100 {
1101 
1102  /* There's nothing here to free... */
1103  if( ! lwgeom ) return;
1104 
1105  LWDEBUGF(5,"freeing a %s",lwtype_name(lwgeom->type));
1106 
1107  switch (lwgeom->type)
1108  {
1109  case POINTTYPE:
1110  lwpoint_free((LWPOINT *)lwgeom);
1111  break;
1112  case LINETYPE:
1113  lwline_free((LWLINE *)lwgeom);
1114  break;
1115  case POLYGONTYPE:
1116  lwpoly_free((LWPOLY *)lwgeom);
1117  break;
1118  case CIRCSTRINGTYPE:
1119  lwcircstring_free((LWCIRCSTRING *)lwgeom);
1120  break;
1121  case TRIANGLETYPE:
1122  lwtriangle_free((LWTRIANGLE *)lwgeom);
1123  break;
1124  case MULTIPOINTTYPE:
1125  lwmpoint_free((LWMPOINT *)lwgeom);
1126  break;
1127  case MULTILINETYPE:
1128  lwmline_free((LWMLINE *)lwgeom);
1129  break;
1130  case MULTIPOLYGONTYPE:
1131  lwmpoly_free((LWMPOLY *)lwgeom);
1132  break;
1133  case POLYHEDRALSURFACETYPE:
1134  lwpsurface_free((LWPSURFACE *)lwgeom);
1135  break;
1136  case TINTYPE:
1137  lwtin_free((LWTIN *)lwgeom);
1138  break;
1139  case CURVEPOLYTYPE:
1140  case COMPOUNDTYPE:
1141  case MULTICURVETYPE:
1142  case MULTISURFACETYPE:
1143  case COLLECTIONTYPE:
1144  lwcollection_free((LWCOLLECTION *)lwgeom);
1145  break;
1146  default:
1147  lwerror("lwgeom_free called with unknown type (%d) %s", lwgeom->type, lwtype_name(lwgeom->type));
1148  }
1149  return;
1150 }
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTICURVETYPE
Definition: liblwgeom.h:95
void lwmline_free(LWMLINE *mline)
Definition: lwmline.c:112
void lwcircstring_free(LWCIRCSTRING *curve)
Definition: lwcircstring.c:98
#define POLYGONTYPE
Definition: liblwgeom.h:87
void lwtin_free(LWTIN *tin)
Definition: lwtin.c:39
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
void lwpoint_free(LWPOINT *pt)
Definition: lwpoint.c:213
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
void lwline_free(LWLINE *line)
Definition: lwline.c:76
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
void lwmpoly_free(LWMPOLY *mpoly)
Definition: lwmpoly.c:53
void lwmpoint_free(LWMPOINT *mpt)
Definition: lwmpoint.c:72
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:174
#define TINTYPE
Definition: liblwgeom.h:99
void lwtriangle_free(LWTRIANGLE *triangle)
Definition: lwtriangle.c:69
void lwpsurface_free(LWPSURFACE *psurf)
Definition: lwpsurface.c:39
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:340
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function: