Skip to content
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

Add GeneratingTileLayer #34

Closed
jericks opened this issue Apr 8, 2016 · 0 comments
Closed

Add GeneratingTileLayer #34

jericks opened this issue Apr 8, 2016 · 0 comments

Comments

@jericks
Copy link
Member

jericks commented Apr 8, 2016

A TileLayer that can generate Tiles on demand as a client tries to get them. It would be wrap a TileLayer (like MBTiles) and a TileRenderer (like ImageTileRenderer) and if the client tries to get a tile that isn't present (doesn't have any data) it would use the TileRenderer to generate the data.

MBTiles mbtiles = new MBTiles(new File("world.mbtiles"),"The World","The World Tiles")

Workspace workspace = new geoscript.workspace.GeoPackage(new File("naturalearth.gpkg"))
Layer countries = workspace.get("countries")
countries.style = new SLDReader().read(new File("countries.sld"))
Layer ocean = workspace.get("ocean")
ocean.style = new SLDReader().read(new File("ocean.sld"))

ImageTileRenderer renderer = new ImageTileRenderer(mbtiles, [ocean, countries])

GeneratingTileLayer generatingTiles = new GeneratingTileLayer(mbtiles, renderer)
generatingTiles.get(0,0,0)
generatingTiles.get(1,0,0)
generatingTiles.get(1,0,1)
generatingTiles.get(1,1,0)
generatingTiles.get(1,1,1)

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

No branches or pull requests

1 participant