-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Why omit +units? #6
Comments
Hello! GeoTIFF's CRS is specified by geokeys, not by proj4. Geokeys are just references to the EPSG database entries, in other words, CRS "parts". EPSG basically allows following cases:
While I'm not sure if point 2 is handled by I'm gonna close this issue, but if you or somebody else have different opinion, feel free to reopen it. I'll also pin it for future references. |
i'm not sure if you are aware, but +vunits and +vto_meter also exists in the proj4 spec. i've also noticed that your +a and +b parameters arent always in meters? you seem to generate them based on the horizontal units. I notice that when i was using these following keys. +a ends up as 6378137/3.28084, instead of just being 6378137
https://proj.org/en/9.3/usage/projections.html#units
|
Those are for Z axis. For some reason, I skipped over whole vertical CS thing, I need to refresh my memory.
They should be in meters, looks like a bug. I'll check these issues at the end of this week, thanks for reporting them! |
Hello again! Spec says that In your case units are US feet which can be converted to meters by multiplying by I'll write back later (today or at the end of the week) about your other question. P.S. I definitely need to add new aliases, I wasn't aware of newer standard. |
Hello! I think I solved Vertical CS thing. GeoTIFF can have following 3D CRS types:
In types 1-3, height (3rd coordinate in proj4) is a band (pixel) value. It's not specified which band to use, but I believe every sane DEM provider will just give you one band. In types 1-2, we just need to multiply pixel value by the units value which is defined by Cartesian CS. Also, I suppose, presence of keys that define vertical CS is invalid here, thus such keys must be ignored. In type 3, we need a reference point for the height that we'll just hardcode. Then, I think, we just need to add height of that point to the ellipsoid's axes. And we'll use pixel value multiplied by the units as a Z coordinate. As for geocentric CRS, I believe, we can just take pixel value as a Z coordinate. I didn't find any examples or other info, so let's think by analogy :) All of this needs to be implemented, I'm not sure when I'll be done. |
Ah, I wouldnt doubt it. I'm not actually using an image, i'm using a Lidar file that just so happens to use the same geotiff key format. Definitely possible that somebody wrote the wrong values |
Hello! I finally added Z coordinates support, new |
Missing +units is also not a bug, you're converting coordinates to meters by using geokeysToProj4.convertCoordinates().
Why did you decide on this format? Probably not the best idea to have a proj4 string that only works with this code
The text was updated successfully, but these errors were encountered: