Open shakyaanice opened 2 years ago
AttributeError Traceback (most recent call last)
9 frames /usr/local/lib/python3.7/dist-packages/RiskChangesDesktop/Exposure.py in ComputeExposure(ear, hazard, ear_key, outputdir, outputformat) 175 df.drop('geometry',axis=1).to_csv(outputname+".csv") 176 def ComputeExposure(ear,hazard,ear_key,outputdir,outputformat="csv"): --> 177 exposure=Exposure(ear, hazard,ear_key) 178 #import geopandas as gpd 179 ear=gpd.read_file(ear)
/usr/local/lib/python3.7/dist-packages/RiskChangesDesktop/Exposure.py in Exposure(input_zone, input_value_raster, Ear_Table_PK, agg_col) 27 28 elif(geometrytype=='LINESTRING' or geometrytype=='MULTILINESTRING'): ---> 29 return zonalPoint(lyr,input_value_raster,Ear_Table_PK,agg_col=agg_col) 30 def zonalPoly(input_zone_data,input_value_raster,Ear_Table_PK,agg_col): 31 raster=rasterio.open(input_value_raster)
/usr/local/lib/python3.7/dist-packages/RiskChangesDesktop/Exposure.py in zonalPoint(lyr, input_value_raster, Ear_Table_PK, agg_col) 150 return df 151 def zonalPoint(lyr,input_value_raster,Ear_Table_PK,agg_col): --> 152 df=gpd.read_file(lyr) 153 src=rasterio.open(input_value_raster) 154 print("Calculating via centroid")
/usr/local/lib/python3.7/dist-packages/geopandas/io/file.py in _read_file(filename, bbox, mask, rows, kwargs) 199 200 with fiona_env(): --> 201 with reader(path_or_bytes, kwargs) as features: 202 203 # In a future Fiona release the crs attribute of features will
/usr/local/lib/python3.7/dist-packages/fiona/env.py in wrapper(*args, kwargs) 406 def wrapper(*args, *kwargs): 407 if local._env: --> 408 return f(args, kwargs) 409 else: 410 if isinstance(args[0], str):
/usr/local/lib/python3.7/dist-packages/fiona/init.py in open(fp, mode, driver, schema, crs, encoding, layer, vfs, enabled_drivers, crs_wkt, **kwargs) 259 path = ParsedPath(path, archive, scheme) 260 else: --> 261 path = parse_path(fp) 262 263 if mode in ('a', 'r'):
/usr/local/lib/python3.7/dist-packages/fiona/path.py in parse_path(path) 130 return UnparsedPath(path) 131 --> 132 elif path.startswith('/vsi'): 133 return UnparsedPath(path) 134
/usr/local/lib/python3.7/dist-packages/osgeo/ogr.py in
/usr/local/lib/python3.7/dist-packages/osgeo/ogr.py in _swig_getattr(self, class_type, name) 72 73 def _swig_getattr(self, class_type, name): ---> 74 return _swig_getattr_nondynamic(self, class_type, name, 0) 75 76
/usr/local/lib/python3.7/dist-packages/osgeo/ogr.py in _swig_getattr_nondynamic(self, class_type, name, static) 67 return method(self) 68 if (not static): ---> 69 return object.getattr(self, name) 70 else: 71 raise AttributeError(name)
AttributeError: type object 'object' has no attribute 'getattr'