예제 #1
0
 def testGeometryCollection(self):
     gc = {
         "type":
         "GeometryCollection",
         "id":
         "GC",
         "geometries": [
             self.polygon['geometry'], self.linestring['geometry'],
             self.point['geometry'], self.multipolygon['geometry'],
             self.multilinestring['geometry']
         ],
     }
     a = draw.geometry(gc, id='cats')
     assert isinstance(a, six.string_types)
     assert 'id="cats"' in a
예제 #2
0
 def testGeometryCollection(self):
     gc = {
         "type": "GeometryCollection",
         "id": "GC",
         "geometries": [
             self.polygon['geometry'],
             self.linestring['geometry'],
             self.point['geometry'],
             self.multipolygon['geometry'],
             self.multilinestring['geometry']
         ],
     }
     a = draw.geometry(gc, id='cats')
     assert isinstance(a, six.string_types)
     assert 'id="cats"' in a
예제 #3
0
 def testDrawAndConvertToString(self):
     draw.geometry(self.linestring['geometry'])
     draw.geometry(self.multilinestring['geometry'])
     draw.geometry(self.polygon['geometry'])
     draw.geometry(self.multipolygon['geometry'])
예제 #4
0
 def testUnkownGeometry(self):
     with self.assertRaises(errors.SvgisError):
         draw.geometry({"type": "FooBar", "coordinates": []})
예제 #5
0
 def testDrawInvalidGeometry(self):
     with self.assertRaises(errors.SvgisError):
         draw.geometry(self.feature['geometry'])
예제 #6
0
 def testDrawAndConvertToString(self):
     draw.geometry(self.linestring['geometry'])
     draw.geometry(self.multilinestring['geometry'])
     draw.geometry(self.polygon['geometry'])
     draw.geometry(self.multipolygon['geometry'])
예제 #7
0
 def testUnkownGeometry(self):
     with self.assertRaises(errors.SvgisError):
         draw.geometry({"type": "FooBar", "coordinates": []})