Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Further elaboration wanted] GeoTIFF with both GCS and PCS defaults to GCS #4

Closed
ImpulseDeer opened this issue Sep 6, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@ImpulseDeer
Copy link

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
@matafokka
Copy link
Owner

Hello, thanks for the report! I'll do an update later today and notify you :)

@matafokka
Copy link
Owner

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:

  1. If it's not your file, report an error to the user.
  2. 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.

@matafokka matafokka changed the title Geotiff with both GCS and PCS defaults to GCS [Further elaboration wanted] GeoTIFF with both GCS and PCS defaults to GCS Sep 6, 2022
@matafokka matafokka added the help wanted Extra attention is needed label Sep 6, 2022
@matafokka matafokka pinned this issue Sep 6, 2022
@ImpulseDeer
Copy link
Author

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!

@matafokka
Copy link
Owner

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

@matafokka
Copy link
Owner

Aaand done! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants