[PROJ] More confusion regarding proj 6
Nyall Dawson
nyall.dawson at gmail.com
Tue Apr 30 00:47:30 PDT 2019
Hi list,
It's time for another set of questions from a mere projection mortal
trying to make way with this:
Q1:
I have the WKT string:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
UNIT["DMSH",0.0174532925199433,AUTHORITY["EPSG","9108"]],
AXIS["Lat",NORTH],
AXIS["Long",EAST],
AUTHORITY["EPSG","4326"]]
I call proj_create_from_wkt using this string, and get an object back.
But calling methods like proj_get_id_auth_name or proj_get_id_code
gives no result here. I'd expect EPSG/4326. What am I missing?
Q2:
If I call proj_create using "+proj=longlat +ellps=WGS84
+towgs84=0,0,0,0,0,0,0 +no_defs +type=crs", I get something back. What
is this something? Trying to call proj_crs_get_coordinate_system on
the returned value throws the error "Object is not a SingleCRS". How
can I get a coordinate system from this result?
Q3:
Sometimes the objects returned by database creation are CompoundCRS. I
gather I should be using proj_crs_get_sub_crs to get the horizontal
crs from these, but the docs state: "Index of the CRS component
(typically 0 = horizontal, 1 = vertical)". Can I just blindly call use
an index of 0 and hope for the best? I can't see any other methods to
work with CompoundCRS objects, so I can't iterate through the indexes
as I don't know how many there are. Or are there always 2?
That's it for now... there's sure to be more to follow ;)
Nyall
More information about the PROJ
mailing list