Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove data/epsg, IGNF and esri.* files / support legacy +init=epsg:XXXX syntax #1182
This is an attempt at resolving the issues raised in #1178
This PR seems important enough that I (and others) should give a proper review. This is just to say that I haven't done so and please don't merge before I (and others) have had a change to look it over. I am travelling the next couple of days so there's a good chance I'll have a few hours of uninterrupted quality review time in an airport some where :-)
referenced this pull request
Nov 26, 2018
Overall, I think you have done a good job finding a nice solution to a very difficult problem and I have only minor details to discuss.
I don't have that many specific comments to the code, only a few in
proj_create_crs_to_crs() accepts proj-strings, EPSG-like codes and WKT(2) strings the documentation should be adjusted accordingly. I also would suggest renaming the arguments
to to make it clear that more than just an EPSG-code can be supplied.
Concerning the input to
cs2cs, I think that using
+to looks weird when used with EPSG-codes and WKT strings. How about dropping the
+to, so that calls to
cs2cs are on the form
cs2cs <FROM> <TO>? The
+to will still have to be used when using proj-strings as input, unless they are in quotes:
cs2cs "+proj=latlong +ellps=GRS80" "+proj=utm +zone=32". This also opens the door for a removal of the
+to syntax in the future.
In case there are several transformations available between two crs'es, is it possible with
cs2cs to select which one to use? Or would that require a combination of
Before this is merged the
cs2cs docs should be updated.
Hum, I initially had the same idea, but I discovered while refactoring it that cs2cs could accept input files :
No, only the one that is sorted first by create_operations() will be used.
If you don't mind, I'll rather create a ticket about that. I'd like to advance on the coding side of GDAL, and then libgeotiff, to check that the PROJ side of things has no holes.
referenced this pull request
Nov 28, 2018
Sure, it can wait, as long as you are confident you can remember the detail in a couple of months when you get around to doing it. Also, I am a bit unsure, how does the workings of
The intro text of this PR onto which I've pointed #1186 captures well the changes
Wasn't specific to cs2cs, but more a general remark on being sure PROJ is ready for GDAL and libgeotiff needs. I feel I'm behind the schedule I anticipated and want to be sure that the PROJ 6 release will be OK for their needs. PROJ received all love until now, so time to give some to the other projects :-)
I've just pushed the changes regarding function renaming and moving them at bottom ofin proj.h
Actually, to me a PJ is just a bag of bits with a few embedded function pointers defining how to interpret the bits (actually a kind of limited RTTI implemented in C). At this level of (lack of) abstraction, it can represent anything.
The "one API entry per operation type" helps enforcing correct initialization, even though a sufficiently clever user can ram garbage into any parameter anyway if not understanding it properly.
But at least the individual API entries provide a reference frame for providing the relevant documentation, so as I said: You may very well convince me that this is the better choice.
On the other hand it was also you, a few years ago, who convinced me that the first versions of proj.h/proj_4D_api.c included too much material into the "proj_..." API namespace, so I learned this API surface skepticism from a highly experienced and competent schoolmaster :-)
Which is of course A-OK in an evolutionary world. And having taken the step and accepting C++11 code into the PROJ code base really opens up for some major code reductions and improvements in the historical department of the code base.
Yes, that would probably be a superior design, but would require a re-implementation of most of the library.
Entirely dropping the PROJ syntax on the other hand, would probably not be good either: Despite all its quirkiness, to me it really relates to WKT as JSON or YAML relates to XML: The less strict, but typing friendly, and human-readable version of the formal uncle. Instantiating in any syntax, and letting the object serialize itself in whatever syntax preferred is a nice feature.
"Do what I say, not what I do" :-) That said, the API, even if large, is still an abstraction. For example, it does not expose that the database implementation is SQLite (and even in the C++ code, the interaction with SQLite has been carefully isolated in the DatabaseContext class). The C++ API itself tries to limit what is visible as public exported symbols.
Wasn't suggesting that either. There are a number of data formats using PROJ string to express the CRS of the data. It has the benefit of being compact (with the associated drawback of lacking some usefu metadata). My view is that PROJ strings are good to express coordinate transformation, especially since the pipeline introduction, but inappropriate to express a CRS object.
I still have a few things that I am not completely happy with. Most of them because I still don't fully understand the complexity of all the various aspects of the new code. I also think they go deeper than just this PR so I can create individual tickets for those. So disregarding those, I would say that this PR is ready for merging. You have found a nice way to solve the problem in #1178. I hope this is the last big PR in relation to GDALbarn so reviews will be simpler from now on :-)