Example #1
0
    def test_loads_simple_point(self):
        from geoadmin.esrigeojsonencoder import loads as esri_loads
        from geojson import Point
        point = "650000,220000"

        result = esri_loads(point)
        self.assertTrue(isinstance(result, Point))
Example #2
0
 def test_loads_simple_point (self):
     from geoadmin.esrigeojsonencoder import loads as esri_loads
     from geojson import Point
     point = "650000,220000"
     
     result = esri_loads(point)
     self.assertTrue(isinstance(result, Point)) 
Example #3
0
 def test_loads_bbox(self):
     from geoadmin.esrigeojsonencoder import loads as esri_loads
     from geojson import Polygon
     bbox = """600000,200000,650000,250000"""
     
     result = esri_loads(bbox)
     self.assertTrue(isinstance(result, Polygon)) 
     self.assertEqual(result.crs.properties['name'],  "urn:ogc:def:crs:EPSG:21781")
Example #4
0
 def test_loads_point_with_crs (self):
     from geoadmin.esrigeojsonencoder import loads as esri_loads
     from geojson import Point
     point = """{"x": -122.65,"y": 45.53, "spatialReference": { "wkid": 4326}}"""
     
     result = esri_loads(point)
     self.assertTrue(isinstance(result, Point)) 
     self.assertEqual(result.crs.properties['name'],  "urn:ogc:def:crs:EPSG:4326")
Example #5
0
    def test_loads_bbox(self):
        from geoadmin.esrigeojsonencoder import loads as esri_loads
        from geojson import Polygon
        bbox = """600000,200000,650000,250000"""

        result = esri_loads(bbox)
        self.assertTrue(isinstance(result, Polygon))
        self.assertEqual(result.crs.properties['name'],
                         "urn:ogc:def:crs:EPSG:21781")
Example #6
0
    def test_loads_point_with_crs(self):
        from geoadmin.esrigeojsonencoder import loads as esri_loads
        from geojson import Point
        point = """{"x": -122.65,"y": 45.53, "spatialReference": { "wkid": 4326}}"""

        result = esri_loads(point)
        self.assertTrue(isinstance(result, Point))
        self.assertEqual(result.crs.properties['name'],
                         "urn:ogc:def:crs:EPSG:4326")
Example #7
0
 def test_loads_polygon(self):
     from geoadmin.esrigeojsonencoder import loads as esri_loads
     from geojson import Polygon
     polygon = """{"rings": [[[ 600000,200000], [ 623000,210000], [ 654000,201000], [ 655000, 208000], [ 600000,200000]]],
          "spatialReference": {"wkid": 21781 }}"""
     
     result = esri_loads(polygon)
     self.assertTrue(isinstance(result, Polygon)) 
     self.assertEqual(result.crs.properties['name'],  "urn:ogc:def:crs:EPSG:21781")
Example #8
0
    def test_loads_polygon(self):
        from geoadmin.esrigeojsonencoder import loads as esri_loads
        from geojson import Polygon
        polygon = """{"rings": [[[ 600000,200000], [ 623000,210000], [ 654000,201000], [ 655000, 208000], [ 600000,200000]]],
             "spatialReference": {"wkid": 21781 }}"""

        result = esri_loads(polygon)
        self.assertTrue(isinstance(result, Polygon))
        self.assertEqual(result.crs.properties['name'],
                         "urn:ogc:def:crs:EPSG:21781")
Example #9
0
 def test_loads_linestring(self):
     from geoadmin.esrigeojsonencoder import loads as esri_loads
     from geojson import LineString
     line = """{"paths": [[[ 600000,200000], [ 623000,210000], [ 654000,201000], [ 655000, 208000]]],
          "spatialReference": {"wkid": 21781 }}"""
     
     result = esri_loads(line)
     self.assertEqual(type(result), LineString) 
     self.assertTrue(isinstance(result, LineString)) 
     self.assertEqual(result.crs.properties['name'],  "urn:ogc:def:crs:EPSG:21781")
Example #10
0
    def test_loads_linestring(self):
        from geoadmin.esrigeojsonencoder import loads as esri_loads
        from geojson import LineString
        line = """{"paths": [[[ 600000,200000], [ 623000,210000], [ 654000,201000], [ 655000, 208000]]],
             "spatialReference": {"wkid": 21781 }}"""

        result = esri_loads(line)
        self.assertEqual(type(result), LineString)
        self.assertTrue(isinstance(result, LineString))
        self.assertEqual(result.crs.properties['name'],
                         "urn:ogc:def:crs:EPSG:21781")