PostGIS  2.3.7dev-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  * PostGIS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * PostGIS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  **********************************************************************
20  *
21  * Copyright (C) 2001-2006 Refractions Research Inc.
22  *
23  **********************************************************************/
24 
25 
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include "liblwgeom_internal.h"
30 #include "lwgeom_log.h"
31 
32 
33 void
35 {
37 }
38 
39 LWMPOLY *
40 lwmpoly_construct_empty(int srid, char hasz, char hasm)
41 {
43  return ret;
44 }
45 
46 
48 {
49  return (LWMPOLY*)lwcollection_add_lwgeom((LWCOLLECTION*)mobj, (LWGEOM*)obj);
50 }
51 
52 
53 void lwmpoly_free(LWMPOLY *mpoly)
54 {
55  int i;
56  if ( ! mpoly ) return;
57  if ( mpoly->bbox )
58  lwfree(mpoly->bbox);
59 
60  for ( i = 0; i < mpoly->ngeoms; i++ )
61  if ( mpoly->geoms && mpoly->geoms[i] )
62  lwpoly_free(mpoly->geoms[i]);
63 
64  if ( mpoly->geoms )
65  lwfree(mpoly->geoms);
66 
67  lwfree(mpoly);
68 }
69 
void lwmpoly_release(LWMPOLY *lwmpoly)
Definition: lwmpoly.c:34
void lwmpoly_free(LWMPOLY *mpoly)
Definition: lwmpoly.c:53
void lwfree(void *mem)
Definition: lwutil.c:242
LWMPOLY * lwmpoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwmpoly.c:40
void lwpoly_free(LWPOLY *poly)
Definition: lwpoly.c:150
LWPOLY ** geoms
Definition: liblwgeom.h:495
int ngeoms
Definition: liblwgeom.h:493
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
LWMPOLY * lwmpoly_add_lwpoly(LWMPOLY *mobj, const LWPOLY *obj)
Definition: lwmpoly.c:47
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
Definition: lwgeom.c:385
GBOX * bbox
Definition: liblwgeom.h:491
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187
LWGEOM * lwmpoly_as_lwgeom(const LWMPOLY *obj)
Definition: lwgeom.c:217