PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
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
33void
38
39LWMPOLY *
40lwmpoly_construct_empty(int32_t 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
54{
55 uint32_t 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
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
void lwfree(void *mem)
Definition lwutil.c:248
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
void lwpoly_free(LWPOLY *poly)
Definition lwpoly.c:175
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
Definition lwgeom.c:496
LWGEOM * lwmpoly_as_lwgeom(const LWMPOLY *obj)
Definition lwgeom.c:322
void lwmpoly_release(LWMPOLY *lwmpoly)
Definition lwmpoly.c:34
LWMPOLY * lwmpoly_construct_empty(int32_t srid, char hasz, char hasm)
Definition lwmpoly.c:40
void lwmpoly_free(LWMPOLY *mpoly)
Definition lwmpoly.c:53
LWMPOLY * lwmpoly_add_lwpoly(LWMPOLY *mobj, const LWPOLY *obj)
Definition lwmpoly.c:47
GBOX * bbox
Definition liblwgeom.h:560
uint32_t ngeoms
Definition liblwgeom.h:566
LWPOLY ** geoms
Definition liblwgeom.h:561