Example #1
0
 def test_dumps_to_esrijson_polyline1(self):
     """Tests Converting GeoJSON LineString to Esri JSON Polyline"""
     self.assertEqual(
         esri.dumps(gj_lintstring), {
             'paths': [[[100.0, 100.0], [5.0, 5.0]]],
             'spatialReference': {
                 'wkid': 4326
             },
         })
Example #2
0
 def test_dumps_to_esrijson_point(self):
     """Tests Converting GeoJSON Point to Esri JSON"""
     self.assertEqual(esri.dumps(gj_pt), {
         'spatialReference': {
             'wkid': 4326
         },
         'x': 25282,
         'y': 43770
     })
Example #3
0
 def test_dumps_to_esrijson_polygon1(self):
     """Tests Converting GeoJSON Polygon to Esri JSON Polygon"""
     vcheck = {
         'rings': [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0],
                    [100.0, 0.0]]],
         'spatialReference': {
             'wkid': 4326
         }
     }
     self.assertEqual(esri.dumps(gj_polygon), vcheck)
Example #4
0
    def test_dumps_to_esrijson_polyline2(self):
        """Tests Converting GeoJSON MultiLineString to Esri JSON Polyline"""

        vcheck = {
            'paths': [[(-97.06138, 32.837), (-97.06133, 32.836),
                       (-97.06124, 32.834), (-97.06127, 32.832)],
                      [(-97.06326, 32.759), (-97.06298, 32.755)]],
            'spatialReference': {
                'wkid': 4326
            }
        }
        self.assertEqual(esri.dumps(gj_multi_linestring), vcheck)
Example #5
0
 def test_dumps_to_esrijson_polygon2(self):
     """Tests Converting GeoJSON MultiPolygon to Esri JSON Polygon"""
     vcheck = {
         'rings': [[(-97.06138, 32.837), (-97.06133, 32.836),
                    (-97.06124, 32.834), (-97.06127, 32.832),
                    (-97.06138, 32.837)],
                   [(-97.06326, 32.759), (-97.06298, 32.755),
                    (-97.06153, 32.749), (-97.06326, 32.759)]],
         'spatialReference': {
             'wkid': 4326
         }
     }
     self.assertEqual(esri.dumps(gj_multi_polygon), vcheck)
Example #6
0
 def test_dumps_to_esrijson_multipoint(self):
     """Tests Converting GeoJSON MultiPoint to Esri JSON MultiPoint"""
     self.assertEqual(esri.dumps(gj_multi_pt), esri_json_mpt)