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
Enhancing unitconvert to support arbitrary conversion factor #1053
Comments
Or just keep existing parameter names, but accept numeric values instead of the unit names |
|
OK, I actually tried with +proj=cart and they are ignored
Same for +proj=geocent |
ok, inv_prepare() and fwd_finalize() do ignore fr_meter/to_meter/etc. in the PJ_IO_UNITS_CARTESIAN case. That should be fixed right ? |
Actually for cartesian, we should only take into account +to_meter and apply it to the 3 axis (doesn't make sense to use one unit for XY, and another one for Z) |
Not entirely sure it should. Maybe. In what case do you need to change the units of cartesian coordinates?
That would be true, yes. |
You could in theory have geocentric CRS with non-meter unit. The following is perfectly valid
|
I was hoping that you had a real world example and not just theory :-) I find it hard to believe that anyone would define a cartesian system that isn't in meters. Oh well, we might as well support that sort of craziness. In that case I think the correct thing to do is to apply +to_meter in the prepare/finalize functions as you suggest. If people actually do this they should know what they are doing and not pass the cartesian coordinates into |
wasn't that a real world example ? All sort of crazy things can come up with WKT, so if we say we support WKT, we must be ready for them (or error out for cases we don't want to support)
Not sure to understand what you mean. If people specify a SRS with geocentric with unit = km and pass X,Y,Z values in km, then we can properly convert into metre internally , and helmert will be fine |
I was looking for a system defined by a national mapping agency or something to that effect. But sure, if WKT and the standard behind allow it we should support it.
I meant to say that you should pay attention to the units of the parameters used with helmert. It would definitely be possible to define helmert parameters for use with a km-units instead of meters for instance. The maths allow that just fine. And if an authority defines a cartesian system using an odd unit it would probably also publish helmert parameters that fit that odd choice of unit. I am not sure what is the best thing to do here. |
For projections parameters, we alredy require meters and degrees everywhere, so for Helmert, we can also require it (if we wanted to accept other units, we could imaginee to accept units to be appended to parameter values, like +x_0=500km). This is a bit different for input / output coordinates that should be expressed in the units mandated by the CRS definition |
True. The rotation parameters are also required to be a certain type of unit as it is now. Let's go with a requirement of meters as input/output and scale it afterwards in the prepare/finalize functions. |
Actually looking at pj_unitconvert.c source code, it does support numeric factors and this is tested by test/gie/unitconvert.gie
Should that be documented in https://proj4.org/operations/conversions/unitconvert.html ? |
Oh yeah, forgot that I put that in a while ago. It should definitely be in the docs! |
…and document that it supports numeric factors (refs OSGeo#1053)
…and document that it supports numeric factors (refs OSGeo#1053)
…and document that it supports numeric factors (refs OSGeo#1053)
…and document that it supports numeric factors (refs OSGeo#1053)
Make +proj=geocent and +proj=cart take into account +to_meter (relates to #1053)
All aspects raised by this tickets have now been covered. Closing |
Currently, +proj=unitconvert only supports a fixed set of linear units. The EPSG database currently supports 59 length units, whereas pj_unit 21 (and potentially someone could create a WKT with a completely custom unit)
In the old pj_init() interface there was the +to_meter= and +vto_meter= options to be able to specify an arbitrary conversion factor.
Why not reinteroducing this capability in +proj=unitconvert with +xy_in_factor, +xy_out_factor, +z_in_factor and +z_out_factor whose values would be te conversion factor to metre ?
The text was updated successfully, but these errors were encountered: