]> granicus.if.org Git - postgis/commitdiff
Fix for ticket #234
authorMark Leslie <mark.leslie@lisasoft.com>
Fri, 7 Aug 2009 03:38:24 +0000 (03:38 +0000)
committerMark Leslie <mark.leslie@lisasoft.com>
Fri, 7 Aug 2009 03:38:24 +0000 (03:38 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4366 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgparse.c
regress/Makefile.in
regress/sql-mm-compoundcurve.sql
regress/sql-mm-compoundcurve_expected

index cb131457488d82cd28b9c570565bdeca4f32df68..3cd18555f1b13ff40a70bc8a6243b35f7f73fc87 100644 (file)
@@ -841,7 +841,7 @@ check_compoundcurve_minpoints()
        int i, j; /* Loop counters */
        int num, mum; /* sub-geom / point count */
        int count = 0; /* Running count of points */
-       int minpoints = 3;
+       int minpoints = 2;
 
        LWDEBUG(3, "check_compoundcurve_minpoints");
        num = tp->uu.nn.num;
index 70648d26f1a82b4dd4086b764c0af5dc6a85ea72..36a194e7366d0de8342144faaa2d831dcec9e374 100644 (file)
@@ -85,7 +85,7 @@ endif
 all: test 
 
 test check: ../postgis/postgis.sql ../loader/pgsql2shp ../loader/shp2pgsql 
-       sed 's,$$libdir/postgis,$(srcdir)/../postgis/libpostgis,g' ../postgis/postgis.sql > postgis.sql
+       sed 's,$$libdir/postgis,$(srcdir)/../postgis/postgis,g' ../postgis/postgis.sql > postgis.sql
        @USE_VERSION=$(POSTGIS_PGSQL_VERSION) ./run_test $(TESTS)
 
 
index 4dfed88eda98f2ff4d48bbbd5c3fca74136ae792..b8f420bdb6c53424f0cff2fffb4a9811a07e3ad6 100644 (file)
@@ -316,3 +316,8 @@ SELECT 'valid wkb compound curve 3', ST_asEWKT(ST_GeomFromEWKB(decode('010900000
 SELECT 'valid wkb compound curve 4', ST_asEWKT(ST_GeomFromEWKB(decode('0109000000020000000102000000030000009FE5797057376340E09398B1B2373BC05AAE0A165F0963409F6760A2493D3DC0DB6286DFB057634082D8A1B32F843EC0010800000005000000DB6286DFB057634082D8A1B32F843EC0DB6286DFB057634082D8A1B32F843EC075B4E4D0C60C634031FA5D1A371540C0D7197CED9B636340A3CB59A7630A41C050F4A72AC0FB6240974769FCE3CF41C0', 'hex')));\r
 SELECT 'valid wkb compound curve 5', ST_asEWKT(ST_GeomFromEWKB(decode('010900000003000000010800000003000000468280E724BC6340BF4B46210B973BC0F890AEA18D8063402D9664151D483CC0EED64BB6EE726340903CA5BDA0863AC0010200000004000000EED64BB6EE726340903CA5BDA0863AC09FE5797057376340E09398B1B2373BC05AAE0A165F0963409F6760A2493D3DC0DB6286DFB057634082D8A1B32F843EC0010800000005000000DB6286DFB057634082D8A1B32F843EC0DB6286DFB057634082D8A1B32F843EC075B4E4D0C60C634031FA5D1A371540C0D7197CED9B636340A3CB59A7630A41C050F4A72AC0FB6240974769FCE3CF41C0', 'hex')));\r
 SELECT 'null response', ST_NumPoints(ST_GeomFromEWKT('COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 4 5, 1 4, 0 0))'));\r
+SELECT 'minpoints issues - pass', GeomFromText('COMPOUNDCURVE((0 0,1 1))');\r
+SELECT 'minpoints issues - pass', GeomFromText('COMPOUNDCURVE(CIRCULARSTRING(0 0,0 1,1 1))');\r
+SELECT 'minpoints issues - fail', GeomFromText('COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1))');\r
+SELECT 'minpoints issues - fail', GeomFromText('COMPOUNDCURVE(CIRCULARSTRING(0 0))');\r
+SELECT 'minpoints issues - fail', GeomFromText('COMPOUNDCURVE((0 0),(0 0,1 1))');\r
index b6c4c30e82d793c7064d75c7948281f1e7eaf919..da5b6b24d055bca1fb16f4d90c26eb6e0d7e49bb 100644 (file)
@@ -107,3 +107,11 @@ valid wkb compound curve 3|COMPOUNDCURVE((151.60117699 -27.32398274,151.22873381
 valid wkb compound curve 4|COMPOUNDCURVE((153.72942375 -27.2175704,152.29285719 -29.23940482,154.74034096 -30.51635287),CIRCULARSTRING(154.74034096 -30.51635287,154.74034096 -30.51635287,152.39926953 -32.16574411,155.11278414 -34.08116619,151.86720784 -35.62414508))
 valid wkb compound curve 5|COMPOUNDCURVE(CIRCULARSTRING(157.87950492 -27.59001358,156.01728901 -28.28169378,155.59163966 -26.52589021),(155.59163966 -26.52589021,153.72942375 -27.2175704,152.29285719 -29.23940482,154.74034096 -30.51635287),CIRCULARSTRING(154.74034096 -30.51635287,154.74034096 -30.51635287,152.39926953 -32.16574411,155.11278414 -34.08116619,151.86720784 -35.62414508))
 null response|
+minpoints issues - pass|01090000000100000001020000000200000000000000000000000000000000000000000000000000F03F000000000000F03F
+minpoints issues - pass|010900000001000000010800000003000000000000000000000000000000000000000000000000000000000000000000F03F000000000000F03F000000000000F03F
+ERROR:  geometry must have an odd number of points
+HINT:  "COMPOUNDCURVE(CIRCULARSTRING(0 0,1 1)" <-- parse error at position 37 within geometry
+ERROR:  geometry requires more points
+HINT:  "COMPOUNDCURVE(CIRCULARSTRING(0 0)" <-- parse error at position 33 within geometry
+ERROR:  geometry requires more points
+HINT:  "COMPOUNDCURVE((0 0)" <-- parse error at position 19 within geometry