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

Changed ZoomedLayoutScheme zooming functions #2029

Merged
merged 6 commits into from Feb 28, 2017

Conversation

Projects
None yet
3 participants
@pomadchin
Member

pomadchin commented Feb 23, 2017

Closes #2021

@pomadchin pomadchin force-pushed the pomadchin:feature/pyramid-improvements branch from d2a4c1d to f5821d4 Feb 23, 2017

@@ -116,13 +116,15 @@ class ZoomedLayoutScheme(val crs: CRS, val tileSize: Int, resolutionThreshold: D
def zoomOut(level: LayoutLevel) = {
val layout = level.layout
val newZoom = level.zoom - 1
val newSize = math.pow(2, newZoom).toInt

This comment has been minimized.

@echeipesh

echeipesh Feb 24, 2017

Contributor

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.

This comment has been minimized.

@pomadchin

pomadchin Feb 24, 2017

Member

@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.

This comment has been minimized.

@pomadchin

pomadchin Feb 24, 2017

Member

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 :)

This comment has been minimized.

@echeipesh

echeipesh Feb 24, 2017

Contributor

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 pomadchin:feature/pyramid-improvements branch from f5821d4 to ba21410 Feb 27, 2017

changed zoomOut functions for tiling layout schemes
Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>

@pomadchin pomadchin force-pushed the pomadchin:feature/pyramid-improvements branch from ba21410 to 425aafb Feb 27, 2017

add unit tests
Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>

@pomadchin pomadchin force-pushed the pomadchin:feature/pyramid-improvements branch from 71e84ab to 01b4cd3 Feb 27, 2017

pomadchin added some commits Feb 27, 2017

Merge branch 'master' of github.com:pomadchin/geotrellis into feature…
…/pyramid-improvements

Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>
fix failing test
Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>

@pomadchin pomadchin changed the title from [WIP] Changed zoomOut functions for tiling layout schemes to Changed zoomOut functions for tiling layout schemes Feb 27, 2017

add test to compare floating and zoomed ingest
Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>

@pomadchin pomadchin force-pushed the pomadchin:feature/pyramid-improvements branch from 7063e2a to 193e795 Feb 27, 2017

@pomadchin pomadchin changed the title from Changed zoomOut functions for tiling layout schemes to 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)

This comment has been minimized.

@echeipesh

echeipesh Feb 27, 2017

Contributor

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.

This comment has been minimized.

@pomadchin

pomadchin Feb 27, 2017

Member

🤦‍♂️

@pomadchin pomadchin force-pushed the pomadchin:feature/pyramid-improvements branch from b017176 to 78ee2eb Feb 27, 2017

add pyramid up test
Signed-off-by: Grigory Pomadchin <gr.pomadchin@gmail.com>

@pomadchin pomadchin force-pushed the pomadchin:feature/pyramid-improvements branch from 78ee2eb to ab27b07 Feb 27, 2017

@echeipesh echeipesh removed the in progress label Feb 28, 2017

@echeipesh echeipesh merged commit b8605e6 into locationtech:master Feb 28, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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