Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more empty geometry wkb tests - refs #1305, #1333

  • Loading branch information...
commit b0cb5b04deea949eb7b63e62a6e6bff2f1fad285 1 parent 65b03a3
@springmeyer springmeyer authored
Showing with 26 additions and 9 deletions.
  1. +26 −9 tests/python_tests/geometry_io_test.py
View
35 tests/python_tests/geometry_io_test.py
@@ -29,21 +29,38 @@ def setup():
]
wkbs = [
- [
- 2,"GEOMETRYCOLLECTION(MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10)),LINESTRING EMPTY)",
- '010700000002000000010500000002000000010200000003000000000000000000244000000000000024400000000000003440000000000000344000000000000024400000000000004440010200000004000000000000000000444000000000000044400000000000003e400000000000003e40000000000000444000000000000034400000000000003e400000000000002440010200000000000000'
+ [ 0, "select 'Point EMPTY'::geometry;", '010400000000000000'],
+ [ 0, "select 'MULTIPOINT EMPTY'::geometry;", '010400000000000000'],
+ [ 0, "select 'LINESTRING EMPTY'::geometry;", '010200000000000000'],
+ [ 0, "select 'MULTILINESTRING EMPTY'::geometry;", '010500000000000000'],
+ [ 0, "select 'Polygon EMPTY'::geometry;", '010300000000000000'],
+ [ 0, "select 'MULTIPOLYGON EMPTY'::geometry;", '010600000000000000'],
+ [ 0, "select 'TRIANGLE EMPTY'::geometry;", '011100000000000000'],
+
+ [ 0, "select 'CircularString EMPTY'::geometry;", '010800000000000000'],
+ [ 0, "select 'CurvePolygon EMPTY'::geometry;", '010A00000000000000'],
+ [ 0, "select 'CompoundCurve EMPTY'::geometry;", '010900000000000000'],
+ [ 0, "select 'MultiCurve EMPTY'::geometry;", '010B00000000000000'],
+
+ [ 0, "select 'MultiSurface EMPTY'::geometry;", '010C00000000000000'],
+ [ 0, "select 'PolyhedralSurface EMPTY'::geometry;", '010F00000000000000'],
+ [ 0, "select 'TIM EMPTY'::geometry;", '011000000000000000'],
+ [ 0, "select 'GEOMETRYCOLLECTION EMPTY'::geometry;", '010700000000000000'],
+ [ 2,"GEOMETRYCOLLECTION(MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10)),LINESTRING EMPTY)", '010700000002000000010500000002000000010200000003000000000000000000244000000000000024400000000000003440000000000000344000000000000024400000000000004440010200000004000000000000000000444000000000000044400000000000003e400000000000003e40000000000000444000000000000034400000000000003e400000000000002440010200000000000000'
],
- [ 0,"select 'LINESTRING EMPTY'::geometry;", '010200000000000000' ],
- [ 1,"select 'Point(0 0)'::geometry;", '010100000000000000000000000000000000000000' ],
- [ 0, "select 'Point EMPTY'::geometry;", '010400000000000000']
+ [ 0, "GEOMETRYCOLLECTION(LINESTRING EMPTY,LINESTRING EMPTY)", '010700000000000000'],
+ [ 0, "GEOMETRYCOLLECTION(POINT EMPTY,POINT EMPTY)", '010700000000000000'],
+ [ 1, "GEOMETRYCOLLECTION(POINT EMPTY,POINT(0 0))", '010700000002000000010400000000000000010100000000000000000000000000000000000000'],
+ [ 1, "GEOMETRYCOLLECTION(POINT EMPTY,MULTIPOINT(0 0))", '010700000002000000010400000000000000010400000001000000010100000000000000000000000000000000000000'],
+ [ 0, "select 'LINESTRING EMPTY'::geometry;", '010200000000000000' ],
+ [ 1, "select 'Point(0 0)'::geometry;", '010100000000000000000000000000000000000000' ],
]
-
-def test_wkb_with_empty():
+def test_wkb_parsing():
for wkb in wkbs:
path = mapnik.Path()
path.add_wkb(unhexlify(wkb[2]))
- #eq_(wkb[0],path.add_wkb(unhexlify(wkb[2])))
+ eq_(wkb[0],len(path))
def compare_wkb_from_wkt(wkt,num=None):
Please sign in to comment.
Something went wrong with that request. Please try again.