Support affine transforms in the proj4 string #986
Merged
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.
The latest version of proj4 supports affine transforms via parameters such as +s11 and +xoff. Proj4js doesn't yet support this, but since it is useful, implement these transforms.
Strictly, in Proj4 6.0.0, you can specify an affine transform like so:
echo 1 2 | cs2cs +proj=affine +to +proj=affine +s11=1.046 +s12=0.0915 +s21=-0.0915 +s22=1.046 +xoff=-1054 +yoff=-1160
, where instead of a projection theaffine
transformation is specified. However, proj4js expects+proj=
to be one of its known projections. Therefore, for know, a layer in image space coordinates could be transformed via something like+proj=longlat +axis=enu +s11=1.046 +s12=-0.0915 +s21=0.0915 +s22=1.046 +xoff=-1054 +yoff=-1160
.Add the ability to easily set the tile layer's gcs. Along with the addition of proj4 affine transforms, this allows multiple tile layers to have different (and adjustable) transforms.
This is a better implementation of the old branch to add a matrix transform the proj4 string (ec462b5). This should eventually be able to transition to official support in proj4js.