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

View collection item footprints as MVT layer #203

Merged
merged 19 commits into from
Apr 24, 2020

Conversation

jisantuc
Copy link
Contributor

@jisantuc jisantuc commented Apr 23, 2020

Overview

This PR:

  • upgrades Postgres in the dev container to 12.2 (+ postgis 3)
  • adds a tile info endpoint to collections
  • adds a tiles link to collections
  • renders collection item footprints for collections as an MVT layer

Checklist

  • New tests have been added or existing tests have been modified

Notes

It's difficult to see the mvt layer whole. I'm thinking about whether there's an easy way to adapt Kenny's or Alex's bakeoff projects for it, since they both use mapbox gl js, and as far as I can tell I'd just (:tm:) have to change the source to get a different layer, either here or here.

Testing Instructions

  • remove the database container (the updated postgres image can't use the old PG_DATA)
  • ./scripts/update
  • import the berlin data
  • start the server --with-tiles and --with-transactions
  • add a bunch of items to the berlin collection -- you can use the attached python script to do so

item-maker.zip

  • navigate the http://localhost:9090/collections/berlin
  • follow its tile link
  • fill in its tile link with WebMercatorQuad for the matrix set and 13/4407/2682 (it's a tile matching part of Berlin).
  • http 'http://localhost:9090/tiles/collections/berlin/footprint/WebMercatorQuad/13/4407/2682' > mvt -- it should succeed surprisingly fast
  • install mvtview
  • mvtview mvt -- you should see a bunch of chaotic lines for the footprints of the bogus items you created in a Polygon layer

Closes #196

Copy link

@notthatbreezy notthatbreezy left a comment

Choose a reason for hiding this comment

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

Looks good after CI

import com.azavea.franklin.error.NotFound
import sttp.model.StatusCode.{NotFound => NF}
import sttp.tapir._
import sttp.tapir.codec.refined._
import sttp.tapir.json.circe._

import java.net.URLDecoder

Choose a reason for hiding this comment

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

Oops - thank you 😎

)
SELECT ST_AsMVT(mvtgeom.*) FROM mvtgeom;
"""
println(s"Query is:\n$fragment")

Choose a reason for hiding this comment

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

Suggested change
println(s"Query is:\n$fragment")

@jisantuc jisantuc merged commit 23c4884 into master Apr 24, 2020
@jisantuc jisantuc deleted the feature/js/collection-mvt branch April 24, 2020 16:33
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.

Add tile info link + MVT tile render of footprints to collections
2 participants