-
Notifications
You must be signed in to change notification settings - Fork 301
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
deprecate exportToProj4 #1187
Comments
By deprecate do you mean to ignore the proj4string by not creating it at all? Or, maintain the creation but start concealing it for a future hard-removal? |
For sp in rgdal, I'm looking at keeping the existing |
Cool thanks |
@rsbivand did you btw try to add a slot, rather than a comment, to CRS objects in sp? Does this break any dependencies? |
@mdsumner not sure yet - |
Wrt. S4 slots, my understanding is that the main specific danger is that serialised objects with class definitions that differ from the available package version will be invalid. Since we do not know that users' workflows do not involve saving and loading serialised objects, we should avoid breaking changes involving S4 objects. Since S3 objects need to test for NULL components and attributes anyway, S3 class changes are only breaking if badly written (that is fail to check for NULL returns on access). The The serialisation issue is real:
with:
|
Another point: rgdal now can work with old CRS (for GDAL < 3 & PROJ < 6), and with piggy-backed WKT2 CRS (sp version unchanged, GDAL >=3 & PROJ >= 6). If we change the CRS definition in sp, we'll need to set NA on a new WKT2 slot for GDAL < 3 & PROJ < 6, and make rgdal depend on the sp with the new CRS definition. |
This is the WIP-vignette from R-Forge/rgdal 1.5-1 rev 888. Comments welcome! RFC now on http://rgdal.r-forge.r-project.org/articles/PROJ6_GDAL3.html, no need to unzip. |
Note that |
Video of talk on this problem on: https://www.youtube.com/playlist?list=PLXUoTpMa_9s10NVk4dBQljNOaOXAOhcE0, third in playlist; presentation at https://rsbivand.github.io/ECS530_h19/ECS530_III.html. |
See also here: https://lists.osgeo.org/pipermail/gdal-dev/2019-December/051344.html From reading that, my feeling is that we're going to have to not even create proj4strings when they were not used to initialize the CRS (e.g. read data from file, from EPSG, or from WKT). |
I'll shift from GDAL 3.0.2 to current master to see. Looks as though Frank Warmerdam's fix via the raster |
The master make failed for me, I'll continue to try to get it built. Update, I forgot to |
I guess for the |
@edzer Practical question: when I declare an OGRSpatialReference directly:
compiles without trouble. But when declared as a pointer, what I thought was equivalent |
You can't |
The problem was on read; I'd forgotten to check whether import... returned NULL, so the object pointer became NULL when a shapefile had no *.prj file. On testing more carefully, now OK. Committed as rev. 902 with lots of exposed |
See here.
I guess this means that when specifying a CRS with an EPSG code, we then pick up the WKT and show (parts of) that on print, and ignore the proj4string that
exportToProj4
would give altogether, unless this is explicitly asked for e.g. in thest_as_text.crs
method.#1146
r-spatial/discuss#28
Pretty drastic; discussion welcome.
The text was updated successfully, but these errors were encountered: