PostGIS  2.1.10dev-r@@SVN_REVISION@@
void lwgeom_free ( LWGEOM geom)

Definition at line 1006 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, and LWGEOM::type.

Referenced by boundary(), BOX3D_combine(), buildarea1(), buildarea2(), buildarea3(), buildarea4(), buildarea4b(), buildarea5(), buildarea6(), buildarea7(), check_dimension(), CircTreePIP(), contains(), convexhull(), coveredby(), covers(), cu_wkb(), cu_wkb_from_hexwkb(), cu_wkb_in(), cu_wkt(), difference(), 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_gml3_unsupported(), 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_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(), geomunion(), GEOS2POSTGIS(), geos_intersection(), geos_intersects(), gserialized_datum_get_box2df_p(), gserialized_get_gbox_p(), isvalid(), lw_dist2d_circstring_poly(), lw_dist2d_poly_curvepoly(), lwcollection_free(), LWGEOM_affine(), LWGEOM_area_polygon(), LWGEOM_asBinary(), 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_set_srid(), LWGEOM_shortestline2d(), LWGEOM_shortestline3d(), LWGEOM_simplify2d(), LWGEOM_startpoint_linestring(), LWGEOM_summary(), LWGEOM_to_BOX3D(), LWGEOM_to_text(), LWGEOMFromWKB(), polyhedralsurface_parse(), POSTGIS2GEOS(), POSTGIS2SFCGALGeometry(), POSTGIS2SFCGALPreparedGeometry(), RASTER_asRaster(), RASTER_clip(), RASTER_convex_hull(), RASTER_dumpAsPolygons(), 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(), SFCGALGeometry2POSTGIS(), ShpLoaderGenerateShapeRow(), ST_AddMeasure(), ST_BuildArea(), ST_CollectionExtract(), ST_CollectionHomogenize(), ST_DelaunayTriangles(), ST_FlipCoordinates(), ST_LocateAlong(), ST_LocateBetween(), ST_LocateBetweenElevations(), ST_Node(), ST_OffsetCurve(), ST_RemoveRepeatedPoints(), ST_SharedPaths(), ST_Snap(), ST_Split(), symdifference(), test_gbox_from_spherical_coordinates(), test_gbox_utils(), test_gdal_polygonize(), test_geos_noop(), 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_calculate_gbox(), test_lwgeom_check_geodetic(), 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_locate_along(), test_lwgeom_make_valid(), test_lwgeom_node(), test_lwgeom_same(), test_lwgeom_segmentize2d(), test_lwgeom_segmentize_sphere(), test_lwgeom_simplify(), test_lwgeom_split(), 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_desegmentize(), test_raster_convex_hull(), test_raster_perimeter(), test_sfcgal_noop(), test_spheroid_area(), test_tree_circ_distance(), test_tree_circ_pip2(), tin_parse(), transform(), transform_geom(), triangle_parse(), WKBFromLWGEOM(), wkt_parser_collection_add_geom(), wkt_parser_collection_finalize(), wkt_parser_compound_add_geom(), wkt_parser_curvepolygon_add_ring(), wkt_parser_curvepolygon_finalize(), wkt_parser_polygon_add_ring(), wkt_parser_polygon_finalize(), and yydestruct().

1007 {
1008 
1009  /* There's nothing here to free... */
1010  if( ! lwgeom ) return;
1011 
1012  LWDEBUGF(5,"freeing a %s",lwtype_name(lwgeom->type));
1013 
1014  switch (lwgeom->type)
1015  {
1016  case POINTTYPE:
1017  lwpoint_free((LWPOINT *)lwgeom);
1018  break;
1019  case LINETYPE:
1020  lwline_free((LWLINE *)lwgeom);
1021  break;
1022  case POLYGONTYPE:
1023  lwpoly_free((LWPOLY *)lwgeom);
1024  break;
1025  case CIRCSTRINGTYPE:
1026  lwcircstring_free((LWCIRCSTRING *)lwgeom);
1027  break;
1028  case TRIANGLETYPE:
1029  lwtriangle_free((LWTRIANGLE *)lwgeom);
1030  break;
1031  case MULTIPOINTTYPE:
1032  lwmpoint_free((LWMPOINT *)lwgeom);
1033  break;
1034  case MULTILINETYPE:
1035  lwmline_free((LWMLINE *)lwgeom);
1036  break;
1037  case MULTIPOLYGONTYPE:
1038  lwmpoly_free((LWMPOLY *)lwgeom);
1039  break;
1040  case POLYHEDRALSURFACETYPE:
1041  lwpsurface_free((LWPSURFACE *)lwgeom);
1042  break;
1043  case TINTYPE:
1044  lwtin_free((LWTIN *)lwgeom);
1045  break;
1046  case CURVEPOLYTYPE:
1047  case COMPOUNDTYPE:
1048  case MULTICURVETYPE:
1049  case MULTISURFACETYPE:
1050  case COLLECTIONTYPE:
1051  lwcollection_free((LWCOLLECTION *)lwgeom);
1052  break;
1053  default:
1054  lwerror("lwgeom_free called with unknown type (%d) %s", lwgeom->type, lwtype_name(lwgeom->type));
1055  }
1056  return;
1057 }
#define LINETYPE
Definition: liblwgeom.h:61
#define MULTICURVETYPE
Definition: liblwgeom.h:70
void lwmline_free(LWMLINE *mline)
Definition: lwmline.c:99
void lwcircstring_free(LWCIRCSTRING *curve)
Definition: lwcircstring.c:85
#define POLYGONTYPE
Definition: liblwgeom.h:62
void lwtin_free(LWTIN *tin)
Definition: lwtin.c:26
#define CURVEPOLYTYPE
Definition: liblwgeom.h:69
void lwpoint_free(LWPOINT *pt)
Definition: lwpoint.c:180
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
void lwline_free(LWLINE *line)
Definition: lwline.c:63
#define TRIANGLETYPE
Definition: liblwgeom.h:73
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
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:164
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:79
#define TINTYPE
Definition: liblwgeom.h:74
void lwtriangle_free(LWTRIANGLE *triangle)
Definition: lwtriangle.c:56
void lwpsurface_free(LWPSURFACE *psurf)
Definition: lwpsurface.c:26
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define MULTISURFACETYPE
Definition: liblwgeom.h:71
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:316
#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: