Example #1
0
 def decode(self, filename, **kwargs):
     content = self.read_file(filename)
     geojson = GeoJSON(**kwargs)
     return geojson.decode(content)
Example #2
0
 def test_bbox(self):
     content = self.read_file('collection.json')
     geojson = GeoJSON()
     features = geojson.decode(content)
     data = GeoJSON.encode(geojson, features, to_string=False, bbox=True)
     self.assertEqual(data['bbox'], [100.0, 0.0, 105.0, 1.0])
Example #3
0
 def test_encode(self):
     content = self.read_file('collection.json')
     geojson = GeoJSON()
     features = geojson.decode(content)
     data = GeoJSON.encode(geojson, features, to_string=False, bbox=True)
     self.assertEqual(data['type'], 'FeatureCollection')
Example #4
0
 def decode(self, filename, **kwargs):
     content = self.read_file(filename)
     geojson = GeoJSON(**kwargs)
     return geojson.decode(content)
Example #5
0
 def test_bbox(self):
     content = self.read_file('collection.json')
     geojson = GeoJSON()
     features = geojson.decode(content)
     data = GeoJSON.encode(geojson, features, to_string=False, bbox=True)
     self.assertEqual(data['bbox'], [100.0, 0.0, 105.0, 1.0])
Example #6
0
 def test_encode(self):
     content = self.read_file('collection.json')
     geojson = GeoJSON()
     features = geojson.decode(content)
     data = GeoJSON.encode(geojson, features, to_string=False, bbox=True)
     self.assertEqual(data['type'], 'FeatureCollection')