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
proj_create_crs_to_crs(): need for area of use ? #559
Comments
I can see the value in such functionality but I am not sure how feasible it is to implement in practice. For instance, transformations from ITRF20xx to ETRS89 are defined differently in Scandinavia than in, say, Germany. As far as I am aware this sort of level of detail is not available in the EPSG-dataset. Of course it might be in the future. This example is maybe a bit esoteric - are there better and more plausible scenarios where an area of interest is needed for the correct transformation? How would you change the function prototype in practice?
perhaps? Of course there's the issue of what the bounding box coordinates refer to, but I guess it is okay as long as they are in roughly the desired area. |
It is. The EPSG database proposes different transformations for the same (source_crs, target_crs) tuple, based on the area of use. Here for Pulkovo 42 to WGS84, you can see different transformation per country (typically different towgs84 parameters, see https://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:coordinateOperation:EPSG::1645 and https://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:coordinateOperation:EPSG::15496 )
Would make sense, but we would need to make the BBOX optional, so perhaps an _ex() version would do for that purpose. Anyway this is probably premature as we don't have the needed infrastructure to make use of it yet |
Interstingly in the above example there are 3 transformations for the Romania area of use :
EPSG:15995 is the one with the best advertized accuracy (coord_op_accuracy (Real) = 3). The current https://trac.osgeo.org/geotiff/browser/trunk/libgeotiff/csv/build_pcs.py script that parses the EPSG database to build the GDAL .csv files and ultimately proj epsg file takes into account the 'deprecated' column too (it currently ignores the coord_op_accuracy, since its logic is to select a transform with the largest area of use (as it must pick one and only one transform for a source,dest tuple), to minimize the average error...) |
Okay, then I think we should definitely add a bounding box option.
Could also be something like
This way it is only one extra argument to the function call. Pass |
A PJ_BBOX* pointer then. I guess that proj_pj_info() would return in its definition the choice that has been made ? To avoid the black box effect... |
Yes, of course. Typing faster than I can think...
Good point. Got a suggestion on how to do it? Could be as simple as storing the EPSG What if the transformation is based on a different source than EPSG? Ideally the infrastructure is generic so other sources can be used in the future (who knows how long the EPSG is around?). |
Was expecting to get the full expanded definition/pipeline in the "PJ_PROJ_INFO.definition" member "+proj=longlat +ellps=... +towgs84=.... +to +proj=longlat +datum=WGS84"
Probably at least as long the last drop of oil would have been extracted from this planet ;-) |
Of course the actual definition will be there, yes. That should happen automatically already. It may however not be apparent to users that a specific option out of several has been used. I thought you were talking about being even more transparent about it. Perhaps the transformation bounding box could be added to the |
Note: we have already (in
It is, however, used only a handful of places, and only in Also, I think the And finally, we should have an idiomatic way of specifying "I don't care", since this is part of the idea of having this function: Letting the user get away with caring as little as possible, by trying to make sure that he/she will shoot her/himself only in the toe, not in the foot. |
Also note that EPSG allows region of validity to be specified with words (as in ROMANIA, SVENDBORG, GREENLAND). We could provide a (small) number of predefined globals (EUROPE, EURASIA, NORTH_AMERICA, SOUTH_AMERICA) somewhat simplifying this, by basically defining bboxes for the major plates. In general, however, aside from making sure we keep our options open, I think we should try to gain some experience from real world usage before fleshing out the details |
I was thinking about that one, but couldn't remember the name of the top of my head. Since this is
Isn't that exactly what you do when you set the
Yeah, I think the named regions can wait for now. But I think adding the bounding box to |
Yeah, perhaps I'm overengineering things... The current complaints (that translate in GDAL / libgeotiff / proj tickets) of users are related to the fact that for projected CRS the current logic in the libgeotiff build_pcs.py script to select the TOWGS84 parameter uses the TOWGS84 parameter of the underlying GEOGCRS (for example Pulkovo 42 that apply to all Eastern europe, so the TOWGS84 selected is the one with the largest area of use) whereas the area of use of the projected CRS might be just for Poland, so they get parameters valid for the wole Eastern Europe, but not the more precise one that apply for Poland. So in practice a TOWGS84 parameter per CRS would do for them and they wouldn't need to explicitly specify an area of use since the one that comes with the CRS is probably good enough (at least while they work with projected CRS) |
Jumping from QGIS discussion qgis/QGIS-Enhancement-Proposals#100 to here, I'm wondering if proj_create_crs_to_crs() shouldn't have a parameter to express the area of use, so that we can select a better transform from the EPSG database when we will consult it. Or perhaps this will be a extented proj_create_crs_to_crs_ex() version that will do that ?
The text was updated successfully, but these errors were encountered: