-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Remove interpolate-projection #901
Remove interpolate-projection #901
Conversation
[ | ||
"linear" | ||
], | ||
[ | ||
"zoom" | ||
], | ||
0, | ||
"vertical-perspective", | ||
["literal", ["vertical-perspective", "vertical-perspective", 1]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I made the test work - calling literal on the project array allows converting the array to a Projection
.
I'm not sure if this is great, would love to see what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it also works with regular strings when the interpreter knows which type it should output (projection in this case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regular strings?
I'd like to be able to define
10,
"vertical-perspective"
12,
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
Is that possible?
instead of having it twice
12,
["+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs", 1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, yes, other tests are doing exactly that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's any validation on the strings right now though... But I'm sure it won't be a big issue to add validation...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no validation since I took out the .presets / .projections - it's for later.
What's special about this test, that makes it need the ["mercator", "mercator", 1] when the other tests doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, I just wanted to see that literal
supports projection
casting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I started with that to see that this would work and afterward saw that regular strings also works and left it as is.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## projection-expression-collecting-branch #901 +/- ##
===========================================================================
- Coverage 92.63% 92.56% -0.07%
===========================================================================
Files 107 107
Lines 4749 4761 +12
Branches 1346 1352 +6
===========================================================================
+ Hits 4399 4407 +8
- Misses 350 354 +4 ☔ View full report in Codecov by Sentry. |
Edit: I think it is working as expected now according to the tests. |
I like it a lot! Nice that it's going away the If we in any way can find a way to have just [step, [zoom], number, string, number, string] I think it would be worthwhile. I imagine it's possible right now to do: [step, [zoom], number, Projection, number, Projection] ... and then have a Projection.parse("mercator") ? It's not too bad, considering it's not repeated, but I'm thinking there was to be a way we can make this work [number, string, number, string]. |
I can merge this to the other branch and you could test this. I think it should work, shouldn't it? |
|
Feel free to merge when you think it's OK. |
5d25160
into
projection-expression-collecting-branch
Launch Checklist
@birkskyum I took a stab at using the interpolate for projection instead of introducing a new interpolation expression.
I'm still looking into understanding how color names are being parsed, but in general, I think this looks like a good direction.
Let me know what you think.