Skip to content

Instantly share code, notes, and snippets.

@lossyrob
Created July 16, 2015 18:33
Show Gist options
  • Save lossyrob/01cd762e7f26f92d300f to your computer and use it in GitHub Desktop.
Save lossyrob/01cd762e7f26f92d300f to your computer and use it in GitHub Desktop.
OAM server update July 16

OAM Server update

Current work: Local tiler

  • Wrote a local tiler in node js using swfr. Ran against a sample set of LandSat and PlanetLabs imagery. For zoom level 13 over 1.4 G of imagery, takes about 19 minutes.
  • Wrote a GeoTrellis/Scala version of the tiler to compare, generates in about 9 minutes.
  • Ran gdal2tilesp, ran in 8 minutes.
  • Generates 471M of pngs.

Issues

  • Image prioritization:
    • On the local disk, I will build a VRT using an alphabetical stragetgy so that the user can organize priority. Tiling off of OIN, how can this happen?
    • Relying on image order in the VRT to dictate image Z order in composite is (not recommended)[http://www.gdal.org/gdalbuildvrt.html]. I don't have other ideas on how to do image z order though.
  • How do we handle imagery at very different resolutions?
    • We don't want to zoom down too far for imagery that isn't low resolution. Can use "overzooming".
    • This would require doing some dynamic construction of the tiles. For instance, build a VRT for each tile, use tilelive-mapnik to render tiles on the fly.

Up next

  • Implement new strategy (not yet implemented):

    • for each image:
      • determine the base zoom level for that imagery
      • run gdal2tilesp on that imagery, upload to s3 (or local tmp directory)
      • build VRT for each TMS tile in the desired set, with the desired prioritization.
        • For high zoom levels that include imagery that hasn't been tiled to that zoom level, use the last highest zoom level in the VRT set. This way the image will be "overzoomed" on subsiquent steps.
      • We can pre-process into PNGs and save off to s3 at this point, or we can dynamically render them through mapnick.
        • Since the result set of PNGs is smaller then the source set, statically rendering them might be our best option for saving space.
  • Write a nice nodejs wrapper around this functionality so it can be run on the command line easily by offline users. This includes serving up a local TMS service.

  • Dockerize this so it can be run by someone that doesn't have GDAL, node or python installed (but they will have to have docker and possibly docker-machine/virtualbox installed...how useful is this?)

  • After dockerization, architect server use case, figure out deployment strategy.

Feedback requests

  • Any suggestions at nodejs projects to look at for well designed command line utilities?
  • Any thoughts on how to handle image prioritization (z order) when we are tiling against OIN data?

Pixel Size = (3.000000000000000,-3.000000000000000) Pixel Size = (19.109257071294063,-19.109257071294063)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment