[Further elaboration wanted] GeoTIFF with both GCS and PCS defaults to GCS
Closed this issue · 5 comments
I have a Geotiff which have geokeys for both GCS and PCS defined.
It seems like geotiff-geokeys-to-proj4 defaults to GCS without any error message or possbility to explicitly pick the correct one (from what I can tell so far). I need the PCS projection which doesn't seem to be possible to get atm.
I solved it temporarly by overwriting the GCS key with an empty string {""}.
Here is my problematic GeoKey as taken from geotiff.js
GTModelTypeGeoKey: 1
GTRasterTypeGeoKey: 1
GeographicTypeGeoKey: 4326
ProjectedCSTypeGeoKey: 32634
Hello, thanks for the report! I'll do an update later today and notify you :)
Hey, thanks again for reporting the issue! I've added an errors.bothGCSAndPCSAreSet
property which is true
when both GCS and PCS are present. An actual behavior is the same as before: GCS will be used.
To fix an issue, I suggest:
- If it's not your file, report an error to the user.
- Otherwise, either delete the wrong key (just like you did) or check fix file in GIS.
I didn't want to add an option to choose because it'll complicate the API. This applies to all errors that the user might encounter.
Anyway, how did you get this file?
Because the whole thing seems wrong to me. Maybe we'll need help from someone more experienced with GeoTIFF than me. I'll pin this issue in case someone will be able to clarify this.
Its generatered by a ground penetration radar processing software, a bit of a nish product. Will report it as a bug to them as I agree it really doesn't make sense to define both and define them differently!
Sounds fair to treat it only as an error and not complicate the API. Hopefully the error message will help someone in the future with a similar problem!
Thank you very much for help! Please, let me know what they answer.
Also, I forgot to release an update on npm, give me a couple of minutes :D
Aaand done! :)