PostGIS  2.1.10dev-r@@SVN_REVISION@@
lwmpoly.c
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * PostGIS - Spatial Types for PostgreSQL
4  * http://postgis.net
5  *
6  * Copyright (C) 2001-2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU General Public Licence. See the COPYING file.
10  *
11  **********************************************************************/
12 
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include "liblwgeom_internal.h"
17 #include "lwgeom_log.h"
18 
19 
20 void
22 {
24 }
25 
26 LWMPOLY *
27 lwmpoly_construct_empty(int srid, char hasz, char hasm)
28 {
30  return ret;
31 }
32 
33 
35 {
36  return (LWMPOLY*)lwcollection_add_lwgeom((LWCOLLECTION*)mobj, (LWGEOM*)obj);
37 }
38 
39 
40 void lwmpoly_free(LWMPOLY *mpoly)
41 {
42  int i;
43  if ( ! mpoly ) return;
44  if ( mpoly->bbox )
45  lwfree(mpoly->bbox);
46 
47  for ( i = 0; i < mpoly->ngeoms; i++ )
48  if ( mpoly->geoms && mpoly->geoms[i] )
49  lwpoly_free(mpoly->geoms[i]);
50 
51  if ( mpoly->geoms )
52  lwfree(mpoly->geoms);
53 
54  lwfree(mpoly);
55 }
56 
void lwmpoly_release(LWMPOLY *lwmpoly)
Definition: lwmpoly.c:21
void lwmpoly_free(LWMPOLY *mpoly)
Definition: lwmpoly.c:40
void lwfree(void *mem)
Definition: lwutil.c:190
LWMPOLY * lwmpoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwmpoly.c:27
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:79
LWPOLY ** geoms
Definition: liblwgeom.h:452
int ngeoms
Definition: liblwgeom.h:450
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
LWMPOLY * lwmpoly_add_lwpoly(LWMPOLY *mobj, const LWPOLY *obj)
Definition: lwmpoly.c:34
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
Definition: lwgeom.c:328
GBOX * bbox
Definition: liblwgeom.h:448
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:174
LWGEOM * lwmpoly_as_lwgeom(const LWMPOLY *obj)
Definition: lwgeom.c:204