def test_mercator_geojson(self): vector_io = VectorFileIO( uri=os.path.join(testfile_path, 'iraq_hospitals_3857.json')) self.assertEquals(vector_io.get_epsg(), 3857) jsonwm = json.loads(vector_io.read(format=geo.formats.JSON)) self.assertEquals(jsonwm['crs']['properties']['name'], 'EPSG:3857') self.assertEquals(jsonwm['features'][0]['geometry']['coordinates'], [4940150.544527022, 3941210.867854486]) json84 = json.loads(vector_io.read(format=geo.formats.JSON, epsg=4326)) self.assertEquals(json84['crs']['properties']['name'], 'EPSG:4326') self.assertEquals(json84['features'][0]['geometry']['coordinates'], [44.378127400000004, 33.34517919999999])
def test_nocrs_wgs84_geojson(self): vector_io = VectorFileIO( uri=os.path.join(testfile_path, 'iraq_hospitals.geojson')) raw_json = json.loads(vector_io.read(format=geo.formats.JSON)) self.assertFalse(hasattr(raw_json, 'crs')) epsg = vector_io.get_epsg() self.assertEquals(epsg, 4326)