fema-ffrd / rashdf

Read data from HEC-RAS HDF files.
MIT License
9 stars 1 forks source link

reprojection to WGS84 #34

Closed bates-j closed 5 months ago

bates-j commented 5 months ago

using the --to-crs flag to convert structures from the "Muncie.go5.hdf" test file to WGS84 and write to a shapefile: python ./src/cli.py structures ./tests/data/ras/Muncie.g05.hdf C:/temp/structures.shp --to-crs EPSG:4326

gives the following error: RuntimeError: GDAL Error: Coordinates with non-finite values are not allowed. Failed to write record: <fiona.model.Feature object at 0x0000020478593E80>

It seems there is some trouble reprojecting from state plane coordinates directly to WGS84, as this was investigated using other HDF files with different CRS.

bates-j commented 5 months ago

investigated fixes related the following post but this did not solve the problem: https://gis.stackexchange.com/questions/217939/converting-state-plane-coordinates-to-latitude-longitude

thwllms commented 5 months ago

@bates-j does this happen just with structures or with other features, too? The part about "Coordinates with non-finite values" makes me think there's some null geometry happening.

thwllms commented 5 months ago

@bates-j this seems to work just fine for me:

python ./cli.py structures ../tests/data/ras/Muncie.g05.hdf --to-crs EPSG:4326
bates-j commented 5 months ago

@thwllms can you try this line? python ./src/cli.py structures ./tests/data/ras/Muncie.g05.hdf C:/temp/structures.shp --to-crs EPSG:4326

thwllms commented 5 months ago

@bates-j still seems to work for me? Are you on the latest main? image image

bates-j commented 5 months ago

I figured out this was a problem with versioning of pyproj. When I upgraded from version 3.5.0 to 3.6.1, it resolved this.

thwllms commented 5 months ago

For the record, I tried downgrading my pyproj from 3.6.1 to 3.5.0 (conda on Windows) and I still didn't get the error. Glad it seems to be resolved though.