ras2fim icon indicating copy to clipboard operation
ras2fim copied to clipboard

Transformation problem with CRS

Open mohamedmorsy opened this issue 11 months ago • 0 comments

I am trying to use the ras2fim with provided dataset but I get an error during run the script of USGS train from shapefile

Current behavior

+=================================================================+

+++++++ Processing for code STEP 3 +++++++

+=================================================================+ | USGS TERRAIN FROM SHAPEFILE | +-----------------------------------------------------------------+ ---(i) INPUT PATH: c:\ras2fim_data\output_ras2fim\12090301_2277_230823\02_shapes_from_conflation\12090301_huc_12_ar.shp ---(o) OUTPUT PATH: c:\ras2fim_data\output_ras2fim\12090301_2277_230823\03_terrain ---[r] Optional: RESOLUTION: 3 meters ---[b] Optional: BUFFER: 300 meters ---[t] Optional: TILE SIZE: 1500 meters ---[f] Optional: FIELD NAME: HUC_12 --- The Ras Models unit (extracted from given shapefile): feet

Polygon 1 of 5 |████████████████████████████████████| 100% Complete Traceback (most recent call last): File "ras2fim.py", line 605, in init_and_run_ras2fim(**args) File "ras2fim.py", line 148, in init_and_run_ras2fim fn_run_ras2fim(str_huc8_arg, File "ras2fim.py", line 263, in fn_run_ras2fim fn_get_usgs_dem_from_shape(str_input_path, File "C:\Users\Morsy\Desktop\InProgress\UL\ras2fim\ras2fim\ras2fim\src\get_usgs_dem_from_shape.py", line 431, in fn_get_usgs_dem_from_shape usgs_wcs_local_proj = usgs_wcs_dem.rio.reproject(str_crs_model) File "C:\ProgramData\Anaconda3\envs\ras2fim\lib\site-packages\rioxarray\raster_array.py", line 392, in reproject raise MissingCRS( rioxarray.exceptions.MissingCRS: CRS not found. Please set the CRS with 'rio.write_crs()'.

(ras2fim) C:\Users\Morsy\Desktop\InProgress\UL\ras2fim\ras2fim\ras2fim\src>python ras2fim.py -w 12090301 -p EPSG:2277

If I try to use a downloaded and project terrain I get the following:

+=================================================================+

+++++++ Processing for code STEP 3 +++++++

+=================================================================+ | USGS TERRAIN FROM SHAPEFILE | +-----------------------------------------------------------------+ ---(i) INPUT PATH: c:\ras2fim_data\output_ras2fim\12090301_2277_230823\02_shapes_from_conflation\12090301_huc_12_ar.shp ---(o) OUTPUT PATH: c:\ras2fim_data\output_ras2fim\12090301_2277_230823\03_terrain ---[r] Optional: RESOLUTION: 3 meters ---[b] Optional: BUFFER: 300 meters ---[t] Optional: TILE SIZE: 1500 meters ---[f] Optional: FIELD NAME: HUC_12 --- The Ras Models unit (extracted from given shapefile): feet

Polygon 1 of 5 |████████████████████████████████████| 100% Complete Traceback (most recent call last): File "ras2fim.py", line 605, in init_and_run_ras2fim(**args) File "ras2fim.py", line 148, in init_and_run_ras2fim fn_run_ras2fim(str_huc8_arg, File "ras2fim.py", line 263, in fn_run_ras2fim fn_get_usgs_dem_from_shape(str_input_path, File "C:\Users\Morsy\Desktop\InProgress\UL\ras2fim\ras2fim\ras2fim\src\get_usgs_dem_from_shape.py", line 431, in fn_get_usgs_dem_from_shape usgs_wcs_local_proj = usgs_wcs_dem.rio.reproject(str_crs_model) File "C:\ProgramData\Anaconda3\envs\ras2fim\lib\site-packages\rioxarray\raster_array.py", line 392, in reproject raise MissingCRS( rioxarray.exceptions.MissingCRS: CRS not found. Please set the CRS with 'rio.write_crs()'.

(ras2fim) C:\Users\Morsy\Desktop\InProgress\UL\ras2fim\ras2fim\ras2fim\src>python ras2fim.py -w 12090301 -p EPSG:2277

mohamedmorsy avatar Aug 23 '23 11:08 mohamedmorsy