Commit d4143136 authored by Markus Wanner's avatar Markus Wanner

Imported Upstream version 2.1.8+dfsg

parent 90d36366
File added
File added
File added
2015-07-04 05:48 robe
* doc/reference_sfcgal.xml: #3116: SFCGAL add documentation for
geometry backend switch. Patch from Vincent Mora
2015-06-30 18:02 pramsey
* liblwgeom/lwin_geojson.c, postgis/lwgeom_export.c: Improve
geojson import for srs objects
2015-06-24 20:23 pramsey
* NEWS: Add #3177
2015-06-24 20:21 pramsey
* liblwgeom/cunit/cu_libgeom.c, liblwgeom/g_serialized.c: #3177,
gserialized_is_empty cannot handle nested empty cases
2015-06-24 19:07 pramsey
* liblwgeom/lwgeodetic.h, liblwgeom/lwgeodetic_tree.h: Newlines on
fileends
2015-06-24 19:06 pramsey
* liblwgeom/cunit/cu_algorithm.c: Remove memory leak
2015-06-24 19:05 pramsey
* liblwgeom/cunit/cu_ptarray.c: Remote printf
2015-06-11 20:06 strk
* liblwgeom/lwgeom.c: Fix backport of bbox cache fix
2015-06-11 19:47 strk
* NEWS, liblwgeom/lwgeom.c, liblwgeom/lwline.c,
liblwgeom/lwlinearreferencing.c, postgis/geography_inout.c,
postgis/lwgeom_functions_basic.c, regress/affine.sql,
regress/affine_expected: Only add boxes to geometries that are
input with them (#3159)
Includes testcase
2015-06-10 09:26 strk
* NEWS, liblwgeom/Makefile.in: Remove liblwgeom.h on make uninstall
(#3155)
2015-05-26 08:26 strk
* NEWS, liblwgeom/ptarray.c, regress/regress_lrs.sql,
regress/regress_lrs_expected: Fix crasher found in garden tests
Includes testcase.
This is a backport of r13556 and r13555 from trunk.
2015-05-19 17:38 pramsey
* postgis/lwgeom_accum.c: Build on 9.5
2015-05-18 07:01 strk
* configure.ac: Fix confusing help message for --with-pgconfig
Patch by Volf Tomáš
2015-05-02 23:51 dustymugs
* raster/test/regress/tickets.sql: pg9.0 doesn't have format
function
2015-05-02 20:45 dustymugs
* raster/test/regress/tickets.sql,
raster/test/regress/tickets_expected: unit tests of numeric
overflow. ticket #3100
2015-05-02 07:01 robe
* doc/faq_raster.xml: add other error you might see to the security
raster faq
2015-04-29 20:03 robe
* postgis/postgis.sql.in: #2365: Significantly improve performance
of find_srid when lots of geometry columns
2015-04-29 15:55 pramsey
* postgis/lwgeom_export.c, regress/in_geojson.sql,
regress/in_geojson_expected: C90 madness
2015-04-29 12:48 pramsey
* NEWS, postgis/lwgeom_export.c: #3104, st_asgml introduces random
characters in ID field
2015-04-27 12:22 pramsey
* doc/introduction.xml: Update corporate info
2015-04-26 05:16 robe
* extensions/upgradeable_versions.mk, postgis/postgis.sql.in: #3092
refinement to geometry_columns view. Also add missing 2.0/2.1
extension upgrade targets
2015-04-26 04:33 robe
* loader/shp2pgsql-core.h: #3102 - add include <locale.h> to fix
mingw-64 compile issue
2015-04-23 20:00 pramsey
* liblwgeom/lwgeom_geos.c: #3091, segfault in unit tests in debug
2015-04-23 19:36 pramsey
* NEWS, loader/shp2pgsql-core.c: #3048, shp2pgsql - illegal number
format when specific system locale set
2015-04-23 18:19 pramsey
* NEWS, postgis/geography_btree.c: #3018, GROUP BY geography
sometimes returns duplicate rows
2015-04-15 15:42 pramsey
* NEWS, liblwgeom/lwin_geojson.c: #3094, fixed another one
2015-03-30 12:54 pramsey
* doc/release_notes.xml: Unbalanced <simplesect>
2015-03-30 12:51 pramsey
* NEWS, Version.config: Move versions forward for development
2015-03-30 12:50 pramsey
* ChangeLog, NEWS, README.postgis, Version.config,
doc/release_notes.xml, extensions/upgradeable_versions.mk:
Prepare for 2.1.7
2015-03-27 17:21 pramsey
* liblwgeom/lwin_geojson.c: Formatting
PostGIS 2.1.8
2015/07/07
* Bug Fixes *
- #3159, do not force a bbox cache on ST_Affine
- #3018, GROUP BY geography sometimes returns duplicate rows
- #3048, shp2pgsql - illegal number format when specific system locale set
- #3094, Malformed GeoJSON inputs crash backend
- #3104, st_asgml introduces random characters in ID field
- #3155, Remove liblwgeom.h on make uninstall
- #3177, gserialized_is_empty cannot handle nested empty cases
- Fix crash in ST_LineLocatePoint
PostGIS 2.1.7
2015/03/30
......
PostGIS - Geographic Information Systems Extensions to PostgreSQL
=================================================================
:Version: 2.1.7
:Date: 2015-03-30
:Version: 2.1.8
:Date: 2015-07-07
:Website: http://postgis.net
This distribution contains a module which implements GIS simple features, ties
......
......@@ -5,5 +5,5 @@
POSTGIS_MAJOR_VERSION=2
POSTGIS_MINOR_VERSION=1
POSTGIS_MICRO_VERSION=7
POSTGIS_MICRO_VERSION=8
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2014 Free Software Foundation, Inc.
# Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2014-11-04'
timestamp='2015-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2014 Free Software Foundation, Inc.
Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2014 Free Software Foundation, Inc.
# Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2014-09-26'
timestamp='2015-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -68,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2014 Free Software Foundation, Inc.
Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......@@ -260,7 +260,7 @@ case $basic_machine in
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
......@@ -313,6 +313,7 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
......@@ -440,6 +441,7 @@ case $basic_machine in
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
......
This diff is collapsed.
......@@ -380,7 +380,7 @@ elif test "x$PG_CONFIG" = "x"; then
dnl If we couldn't find pg_config, display an error
if test "x$PG_CONFIG" = "x"; then
AC_MSG_ERROR([could not find pg_config within the current path. You may need to try re-running configure with a --with-pg_config parameter.])
AC_MSG_ERROR([could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter.])
fi
else
dnl PG_CONFIG was specified; display a message to the user
......
......@@ -6,7 +6,8 @@
<qandaentry id="faq_security_change_1">
<question>
<para>I'm getting error <code>ERROR: RASTER_fromGDALRaster: Could not open bytea with GDAL. Check that the bytea is of a GDAL supported format.</code></para>
<para>I'm getting error <code>ERROR: RASTER_fromGDALRaster: Could not open bytea with GDAL. Check that the bytea is of a GDAL supported format.</code> when using ST_FromGDALRaster
or <code>ERROR: rt_raster_to_gdal: Could not load the output GDAL driver</code> when trying to use ST_AsPNG or other raster input functions.</para>
</question>
<answer>
......
......@@ -267,7 +267,7 @@ Stadt Uster,
UC Davis Center for Vectorborne Diseases,
University of Laval,
U.S Department of State (HIU),
Vizzuality,
CartoDB,
Zonar Systems</para>
</listitem>
</varlistentry>
......
......@@ -9,6 +9,13 @@
<para>
Installation instructions of the library can be found on SFCGAL home page <ulink url="http://www.sfcgal.org">http://www.sfcgal.org</ulink>.
To load the functions execute postgis/sfcgal.sql
</para>
<para>
Some SFCGAL functions replace standard ones (ST_Intersects, ST_Intersection, ST_Difference, ST_Union, ST_Area and ST_Distance), to switch between standard functions and SFCGAL function use:
<programlisting>SET postgis.backend = sfcgal;</programlisting>
and
<programlisting>SET postgis.backend = geos;</programlisting>
</para>
</abstract>
</sect1info>
......
......@@ -3,16 +3,33 @@
<title>Appendix</title>
<subtitle>Release Notes</subtitle>
<sect1>
<title>Release 2.1.8</title>
<para>Release date: 2015-07-07</para>
<para>This is a critical bug fix release.</para>
<simplesect>
<title>Bug Fixes</title>
<para>#3159, do not force a bbox cache on ST_Affine</para>
<para>#3018, GROUP BY geography sometimes returns duplicate rows</para>
<para>#3048, shp2pgsql - illegal number format when specific system locale set</para>
<para>#3094, Malformed GeoJSON inputs crash backend</para>
<para>#3104, st_asgml introduces random characters in ID field</para>
<para>#3155, Remove liblwgeom.h on make uninstall</para>
<para>#3177, gserialized_is_empty cannot handle nested empty cases</para>
<para>Fix crash in ST_LineLocatePoint</para>
</simplesect>
</sect1>
<sect1>
<title>Release 2.1.7</title>
<para>Release date: 2015-03-30</para>
<para>This is a critical bug fix release.</para>
<simplesect>
<title>Bug Fixes</title>
<para>#3086, ST_DumpValues() crashes backend on cleanup with invalid band indexes</para>
<para>#3088, Do not (re)define strcasestr in a liblwgeom.h</para>
<para>#3094, Malformed GeoJSON inputs crash backend</para>
</simplesect>
<simplesect>
<title>Bug Fixes</title>
<para>#3086, ST_DumpValues() crashes backend on cleanup with invalid band indexes</para>
<para>#3088, Do not (re)define strcasestr in a liblwgeom.h</para>
<para>#3094, Malformed GeoJSON inputs crash backend</para>
</simplesect>
</sect1>
<sect1>
......@@ -24,21 +41,21 @@
<para>#3000, Ensure edge splitting and healing algorithms use indexes</para>
<para>#3048, Speed up geometry simplification (J.Santana @ CartoDB)</para>
<para>#3050, Speep up geometry type reading (J.Santana @ CartoDB)</para>
</simplesect>
<simplesect>
<title>Bug Fixes</title>
<para>#2941, allow geography columns with SRID other than 4326</para>
<para>#3069, small objects getting inappropriately fluffed up w/ boxes</para>
<para>#3068, Have postgis_typmod_dims return NULL for unconstrained dims</para>
<para>#3061, Allow duplicate points in JSON, GML, GML ST_GeomFrom* functions</para>
<para>#3058, Fix ND-GiST picksplit method to split on the best plane</para>
<para>#3052, Make operators &lt;-&gt; and &lt;#&gt; available for PostgreSQL &lt; 9.1</para>
<para>#3045, Fix dimensionality confusion in &amp;&amp;&amp; operator</para>
<para>#3016, Allow unregistering layers of corrupted topologies</para>
<para>#3015, Avoid exceptions from TopologySummary</para>
<para>#3020, ST_AddBand out-db bug where height using width value</para>
<para>#3031, Allow restore of Geometry(Point) tables dumped with empties in them</para>
</simplesect>
</simplesect>
<simplesect>
<title>Bug Fixes</title>
<para>#2941, allow geography columns with SRID other than 4326</para>
<para>#3069, small objects getting inappropriately fluffed up w/ boxes</para>
<para>#3068, Have postgis_typmod_dims return NULL for unconstrained dims</para>
<para>#3061, Allow duplicate points in JSON, GML, GML ST_GeomFrom* functions</para>
<para>#3058, Fix ND-GiST picksplit method to split on the best plane</para>
<para>#3052, Make operators &lt;-&gt; and &lt;#&gt; available for PostgreSQL &lt; 9.1</para>
<para>#3045, Fix dimensionality confusion in &amp;&amp;&amp; operator</para>
<para>#3016, Allow unregistering layers of corrupted topologies</para>
<para>#3015, Avoid exceptions from TopologySummary</para>
<para>#3020, ST_AddBand out-db bug where height using width value</para>
<para>#3031, Allow restore of Geometry(Point) tables dumped with empties in them</para>
</simplesect>
</sect1>
<sect1>
......
# postgis extension
comment = 'PostGIS geometry, geography, and raster spatial types and functions'
default_version = '2.1.7'
default_version = '2.1.8'
module_pathname = '$libdir/postgis-2.1'
relocatable = true
# postgis tiger geocoder extension
comment = 'PostGIS tiger geocoder and reverse geocoder'
default_version = '2.1.7'
default_version = '2.1.8'
relocatable = false
schema = tiger
requires = 'postgis,fuzzystrmatch'
# postgis topology extension
comment = 'PostGIS topology spatial types and functions'
default_version = '2.1.7'
default_version = '2.1.8'
relocatable = false
schema = topology
requires = postgis
......@@ -15,7 +15,9 @@ UPGRADEABLE_VERSIONS = \
2.1.3 \
2.1.4 \
2.1.5 \
2.1.6
2.1.6 \
2.1.7 \
2.1.8
UPGRADEABLE_VERSIONS_MINOR = \
2.0.0 \
......@@ -24,7 +26,8 @@ UPGRADEABLE_VERSIONS_MINOR = \
2.0.3 \
2.0.4 \
2.0.5 \
2.0.6
2.0.6 \
2.0.7
UPGRADEABLE_VERSIONS_PATCH = \
2.1.0rc1 \
......@@ -36,4 +39,6 @@ UPGRADEABLE_VERSIONS_PATCH = \
2.1.3 \
2.1.4 \
2.1.5 \
2.1.6
2.1.6 \
2.1.7 \
2.1.8
......@@ -119,6 +119,7 @@ install-liblwgeom: liblwgeom.la
uninstall-liblwgeom:
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/liblwgeom.la"
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(includedir)/liblwgeom.h"
# Make all objects depend upon postgis_config.h and postgis_svn_revision.h
$(LT_OBJS): ../postgis_config.h ../postgis_svn_revision.h
......
/**********************************************************************
* $Id: cu_algorithm.c 13247 2015-02-20 15:10:29Z pramsey $
* $Id: cu_algorithm.c 13696 2015-06-24 19:06:01Z pramsey $
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.net
......@@ -898,20 +898,25 @@ static void test_geohash_point_as_int(void)
static void test_lwgeom_simplify(void)
{
LWGEOM *l;
LWGEOM *i;
char *ewkt;
/* Not simplifiable */
l = lwgeom_simplify(lwgeom_from_wkt("LINESTRING(0 0, 50 1.00001, 100 0)", LW_PARSER_CHECK_NONE), 1.0);
i = lwgeom_from_wkt("LINESTRING(0 0, 50 1.00001, 100 0)", LW_PARSER_CHECK_NONE);
l = lwgeom_simplify(i, 1.0);
ewkt = lwgeom_to_ewkt(l);
CU_ASSERT_STRING_EQUAL(ewkt, "LINESTRING(0 0,50 1.00001,100 0)");
lwgeom_free(l);
lwgeom_free(i);
lwfree(ewkt);
/* Simplifiable */
l = lwgeom_simplify(lwgeom_from_wkt("LINESTRING(0 0,50 0.99999,100 0)", LW_PARSER_CHECK_NONE), 1.0);
i = lwgeom_from_wkt("LINESTRING(0 0,50 0.99999,100 0)", LW_PARSER_CHECK_NONE);
l = lwgeom_simplify(i, 1.0);
ewkt = lwgeom_to_ewkt(l);
CU_ASSERT_STRING_EQUAL(ewkt, "LINESTRING(0 0,100 0)");
lwgeom_free(l);
lwgeom_free(i);
lwfree(ewkt);
}
......
/**********************************************************************
* $Id: cu_libgeom.c 13242 2015-02-19 00:22:22Z pramsey $
* $Id: cu_libgeom.c 13698 2015-06-24 20:21:57Z pramsey $
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.net
......@@ -307,6 +307,49 @@ static void test_lwgeom_from_gserialized(void)
}
static void test_gserialized_is_empty(void)
{
int i = 0;
struct gserialized_empty_cases {
const char* wkt;
int isempty;
};
struct gserialized_empty_cases cases[] = {
{ "POINT EMPTY", 1 },
{ "POINT(1 1)", 0 },
{ "LINESTRING EMPTY", 1 },
{ "MULTILINESTRING EMPTY", 1 },
{ "MULTILINESTRING(EMPTY)", 1 },
{ "MULTILINESTRING(EMPTY,EMPTY)", 1 },
{ "MULTILINESTRING(EMPTY,(0 0,1 1))", 0 },
{ "MULTILINESTRING((0 0,1 1),EMPTY)", 0 },
{ "MULTILINESTRING(EMPTY,(0 0,1 1),EMPTY)", 0 },
{ "MULTILINESTRING(EMPTY,EMPTY,EMPTY)", 1 },
{ "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY,EMPTY))", 1 },
{ "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY),POINT(1 1))", 0 },
{ "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY, (0 0)),POINT EMPTY)", 0 },
{ "GEOMETRYCOLLECTION(POLYGON EMPTY,POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
{ "GEOMETRYCOLLECTION(POLYGON EMPTY,GEOMETRYCOLLECTION(POINT EMPTY),MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
{ NULL, 0 }
};
while( cases[i].wkt )
{
// i = 11;
LWGEOM *lw = lwgeom_from_wkt(cases[i].wkt, LW_PARSER_CHECK_NONE);
GSERIALIZED *g = gserialized_from_lwgeom(lw, 0, 0);
int ie = gserialized_is_empty(g);
// printf("%s: we say %d, they say %d\n", cases[i].wkt, cases[i].isempty, ie);
CU_ASSERT_EQUAL(ie, cases[i].isempty);
lwgeom_free(lw);
lwfree(g);
i++;
}
}
static void test_geometry_type_from_string(void)
{
int rv;
......@@ -934,4 +977,5 @@ void libgeom_suite_setup(void)
PG_ADD_TEST(suite, test_lwgeom_is_empty);
PG_ADD_TEST(suite, test_lwgeom_same);
PG_ADD_TEST(suite, test_lwline_from_lwmpoint);
PG_ADD_TEST(suite, test_gserialized_is_empty);
}
......@@ -444,7 +444,7 @@ static void test_ptarray_desegmentize()
out = lwgeom_desegmentize(in);
str = lwgeom_to_wkt(out, WKT_ISO, 8, NULL);
CU_ASSERT_STRING_EQUAL(str, "LINESTRING(0 0,10 0,10 10,0 10)");
printf("%s\n", str);
// printf("%s\n", str);
lwgeom_free(in);
lwgeom_free(out);
lwfree(str);
......
/**********************************************************************
* $Id: g_serialized.c 13367 2015-03-20 13:53:44Z pramsey $
* $Id: g_serialized.c 13698 2015-06-24 20:21:57Z pramsey $
*
* PostGIS - Spatial Types for PostgreSQL
*
......@@ -109,27 +109,46 @@ GSERIALIZED* gserialized_copy(const GSERIALIZED *g)
return g_out;
}
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty);
static size_t gserialized_is_empty_recurse(const uint8_t *p, int *isempty)
{
int i;
int32_t type, num;
memcpy(&type, p, 4);
memcpy(&num, p+4, 4);
if ( lwtype_is_collection(type) )
{
size_t lz = 8;
for ( i = 0; i < num; i++ )
{
lz += gserialized_is_empty_recurse(p+lz, isempty);
if ( ! *isempty )
return lz;
}
*isempty = LW_TRUE;
return lz;
}
else
{
*isempty = (num == 0 ? LW_TRUE : LW_FALSE);
return 8;
}
}
int gserialized_is_empty(const GSERIALIZED *g)
{
uint8_t *p = (uint8_t*)g;
int i;
int isempty = 0;
assert(g);
p += 8; /* Skip varhdr and srid/flags */
if( FLAGS_GET_BBOX(g->flags) )
p += gbox_serialized_size(g->flags); /* Skip the box */
p += 4; /* Skip type number */
/* For point/line/circstring this is npoints */
/* For polygons this is nrings */
/* For collections this is ngeoms */
memcpy(&i, p, sizeof(int));
/* If it is non-zero, it's not empty */
if ( i > 0 )
return LW_FALSE;
else
return LW_TRUE;
gserialized_is_empty_recurse(p, &isempty);
return isempty;
}
char* gserialized_to_string(const GSERIALIZED *g)
......
/**********************************************************************
* $Id: lwgeodetic.h 12343 2014-03-25 08:17:56Z pramsey $
* $Id: lwgeodetic.h 13697 2015-06-24 19:07:17Z pramsey $
*
* PostGIS - Spatial Types for PostgreSQL
* Copyright 2009 Paul Ramsey <pramsey@cleverelephant.ca>
......@@ -143,4 +143,4 @@ int spheroid_project(const GEOGRAPHIC_POINT *r, const SPHEROID *spheroid, double
* Maintain consistent units (radians?) throughout all calculations
* Put an index pointer onto LWGEOM itself, and cache the indexed LWGEOM instead of a bare tree
* only primitive objects should get a tree
*/
\ No newline at end of file
*/
......@@ -30,4 +30,4 @@ double circ_tree_distance_tree(const CIRC_NODE* n1, const CIRC_NODE* n2, const S
CIRC_NODE* lwgeom_calculate_circ_tree(const LWGEOM* lwgeom);
int circ_tree_get_point(const CIRC_NODE* node, POINT2D* pt);
#endif /* _LWGEODETIC_TREE_H */
\ No newline at end of file
#endif /* _LWGEODETIC_TREE_H */
......@@ -1443,8 +1443,11 @@ LWGEOM* lwgeom_flip_coordinates(LWGEOM *in)
return NULL;
}
lwgeom_drop_bbox(in);
lwgeom_add_bbox(in);
/* only refresh bbox if X or Y changed */
if ( in->bbox ) {
lwgeom_drop_bbox(in);
lwgeom_add_bbox(in);
}
return in;
}
......
......@@ -219,14 +219,14 @@ ptarray_to_GEOSCoordSeq(const POINTARRAY *pa)
{
p3d = getPoint3dz_cp(pa, i);
p2d = (const POINT2D *)p3d;
LWDEBUGF(4, "Point: %g,%g,%g", p3d->x, p3d->y, p3d->z);
}
else
{
p2d = getPoint2d_cp(pa, i);
LWDEBUGF(4, "Point: %g,%g", p2d->x, p2d->y);
}
LWDEBUGF(4, "Point: %g,%g,%g", p2d->x, p2d->y, p3d->z);
#if POSTGIS_GEOS_VERSION < 33
/* Make sure we don't pass any infinite values down into GEOS */
/* GEOS 3.3+ is supposed to handle this stuff OK */
......
......@@ -385,48 +385,34 @@ parse_geojson_multipolygon(json_object *geojson, int *hasz, int root_srid)
const int nPolys = json_object_array_length( poObjPolys );
for(i = 0; i < nPolys; ++i)
{
POINTARRAY **ppa;
json_object* poObjPoly = NULL;
poObjPoly = json_object_array_get_idx( poObjPolys, i );
ppa = (POINTARRAY**) lwalloc(sizeof(POINTARRAY*));
{
json_object* poObjPoly = json_object_array_get_idx( poObjPolys, i );
if( json_type_array == json_object_get_type( poObjPoly ) )
{
int nPoints;
json_object* points = NULL;
int ring = json_object_array_length( poObjPoly );
ppa[0] = ptarray_construct_empty(1, 0, 1);
points = json_object_array_get_idx( poObjPoly, 0 );
nPoints = json_object_array_length( points );
for (j=0; j < nPoints; j++ )
LWPOLY *lwpoly = lwpoly_construct_empty(geom->srid, lwgeom_has_z(geom), lwgeom_has_m(geom));
int nRings = json_object_array_length( poObjPoly );
for(j = 0; j < nRings; ++j)
{
json_object* coords = NULL;
coords = json_object_array_get_idx( points, j );
parse_geojson_coord(coords, hasz, ppa[0]);
}
json_object* points = json_object_array_get_idx( poObjPoly, j );
if( json_type_array == json_object_get_type( poObjPoly ) )
{
for(j = 1; j < ring; ++j)
{
int nPoints;
ppa = (POINTARRAY**) lwrealloc((POINTARRAY *) ppa, sizeof(POINTARRAY*) * (j + 1));
ppa[j] = ptarray_construct_empty(1, 0, 1);
points = json_object_array_get_idx( poObjPoly, j );
POINTARRAY *pa = ptarray_construct_empty(1, 0, 1);
nPoints = json_object_array_length( points );
for (k=0; k < nPoints; k++ )
{
json_object* coords = NULL;
coords = json_object_array_get_idx( points, k );
parse_geojson_coord(coords, hasz, ppa[j]);
int nPoints = json_object_array_length( points );
for ( k=0; k < nPoints; k++ )
{
json_object* coords = json_object_array_get_idx( points, k );
parse_geojson_coord(coords, hasz, pa);
}
lwpoly_add_ring(lwpoly, pa);
}
}
geom = (LWGEOM*)lwmpoly_add_lwpoly((LWMPOLY*)geom,
(LWPOLY*)lwpoly_construct(root_srid, NULL, ring, ppa));
geom = (LWGEOM*)lwmpoly_add_lwpoly((LWMPOLY*)geom, lwpoly);
}
}
}
......@@ -559,10 +545,19 @@ lwgeom_from_geojson(const char *geojson, char **srs)
if (poObjSrsType != NULL)
{
json_object* poObjSrsProps = findMemberByName( poObjSrs, "properties" );