fix: classify WKT2-2015 GEODCRS with CS[Cartesian] as geocentric#51
Merged
Merged
Conversation
A WKT2 GEODCRS with a Cartesian coordinate system (geocentric X/Y/Z) in the USAGE-less WKT2-2015 form was parsed as a geographic (longlat) CRS, so transforming into it was a no-op instead of a geographic-to-geocentric conversion. The 2015 builder now reads the CS node and records its subtype (mirroring PROJJSONBuilder2019), so transformPROJJSON classifies it as geocent. Adds a regression fixture. Refs proj4js/proj4js#588.
Member
|
Thanks, @aloktomarr. I went ahead and fixed the underlying issue that caused the problem surfaced in proj4js/proj4js#588. The result is a lot of removed code, and the 2015/2019 split in wkt-parser is gone because it is not relevant for the subset of PROJJSON that Proj4js can handle. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the classification reported in proj4js/proj4js#588.
A WKT2
GEODCRSwith a Cartesian coordinate system (geocentric X/Y/Z) in theUSAGE-less WKT2-2015 form was parsed as a geographic (
longlat) CRS, sotransforming into it was a no-op instead of a geographic→geocentric conversion.
Cause: the base builder hardcodes
coordinate_system.type = 'ellipsoidal'for
GEODCRSand never records the CS subtype.PROJJSONBuilder2019overrides itfrom the
CSnode (so the USAGE form already worked), butPROJJSONBuilder2015did not — and its
delete … subtype === 'Cartesian'guard never fired (the basesets
.type, not.subtype).Fix:
PROJJSONBuilder2015now reads theCSnode and records itssubtype,mirroring the 2019 builder, so
transformPROJJSONclassifies a CartesianGeodeticCRSasgeocent. Added a regression fixture for the USAGE-less WKT2-2015form. Full suite passes (33/33); no other CRS types are affected.