Skip to content

Changed ZoomedLayoutScheme zooming functions - #2029

Merged
echeipesh merged 6 commits into
locationtech:masterfrom
pomadchin:feature/pyramid-improvements
Feb 28, 2017
Merged

echeipesh merged 6 commits into
locationtech:masterfrom
pomadchin:feature/pyramid-improvements

Conversation

@pomadchin

@pomadchin pomadchin commented Feb 23, 2017 •

Copy link
Copy Markdown
Member

Closes #2021

@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from d2a4c1d to f5821d4 Compare February 23, 2017 14:38
def zoomOut(level: LayoutLevel) = {
val layout = level.layout
val newZoom = level.zoom - 1
val newSize = math.pow(2, newZoom).toInt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change allow to correctly pyramid a floating layer into a zoomed layout scheme? I think so, but there should be a small unit test for that.

If all of that works out fine I'm not sure there is any reason to change FloatingLayoutScheme as its primary purpose it to produce a layer with cell width matching the source rasters.

@pomadchin pomadchin Feb 24, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@echeipesh what do you mean by that? as floating layout scheme has no def levelFor(extent: Extent, cellSize: CellSize) function, I am not sure how to identify max zoom level for the floating layout scheme gotcha.

@pomadchin pomadchin Feb 24, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For zoomed layout scheme i think we can create a new, called SquareZoomedLayoutScheme, and the old one would still be called ZoomedLayoutScheme, +that would mean a good unit test for it :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need to keep the /2 *2 functionality, that was just poor implementation I think. The way this scheme is intended to be used is with square, power of two, layouts. The fact that it may work under some conditions for non-power of two is incidental and would not have produce a usably correct result if it completed. We're just fixing and testing an implementation here right now.

@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from f5821d4 to ba21410 Compare February 27, 2017 08:49
@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from ba21410 to 425aafb Compare February 27, 2017 08:50
Signed-off-by: Grigory Pomadchin <[email protected]>
@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from 71e84ab to 01b4cd3 Compare February 27, 2017 11:34
…/pyramid-improvements

Signed-off-by: Grigory Pomadchin <[email protected]>
Signed-off-by: Grigory Pomadchin <[email protected]>
@pomadchin pomadchin changed the title [WIP] Changed zoomOut functions for tiling layout schemes Changed zoomOut functions for tiling layout schemes Feb 27, 2017
@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from 7063e2a to 193e795 Compare February 27, 2017 12:22
@pomadchin pomadchin changed the title Changed zoomOut functions for tiling layout schemes Changed ZoomedLayoutScheme zooming functions Feb 27, 2017
val layoutScheme = ZoomedLayoutScheme(LatLng, 2)

val LayoutLevel(_, layout) = FloatingLayoutScheme(512).levelFor(LatLng.worldExtent, CellSize(0.5, 0.5))
val LayoutLevel(zoom, _) = layoutScheme.levelForZoom(LatLng.worldExtent, 2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the point of this line ? ZoomedLayoutScheme.levelForZoom will always just give you the same zoomed you asked for, its the layout that is the real output of this function.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️

@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from b017176 to 78ee2eb Compare February 27, 2017 22:01
Signed-off-by: Grigory Pomadchin <[email protected]>
@pomadchin
pomadchin force-pushed the feature/pyramid-improvements branch from 78ee2eb to ab27b07 Compare February 27, 2017 22:16
@echeipesh
echeipesh merged commit b8605e6 into locationtech:master Feb 28, 2017
@lossyrob lossyrob modified the milestones: 1.0.1, 1.1 Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants