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

Beyond variable interpolation, fancy SQL generation shortcuts #1

Open
summer4096 opened this issue Jul 14, 2014 · 1 comment
Open

Comments

@summer4096
Copy link

More complex interpolation (closer to templating) would be useful. I can't use !geom_hash! in complex queries, but !geom_hash(hgrid.the_geom)! would work if tilesplash supported it. Concerned that it may be a can of worms, though. Still, more advanced substitutions could be useful in all kinds of situations...

WHERE !intersects! --defaults to the_geom

WHERE !intersects(hgrid.the_geom)! --override for fancy queries

WHERE !intersects(the_geom_webmercator, 3857)! --optional transform

SELECT !geojson!, !id! --sensible defaults

SELECT !geojson(hgrid.the_geom)!, !id(hgrid.centroid)! --override stuff, customize stuff

This would let us abstract away some more complicated (but commonly used) geospatial features without making them opaque. Users could get fancy features like polygon deduplication (something not even OSM has figured out) without having to reinvent the wheel, and hopefully without muddying their existing SQL.

If it's extensible enough, I can see this working for more advanced stuff like

SELECT !hexbins! FROM points WHERE !intersects!
@seamusabshere
Copy link
Member

maybe better to document strategies in the README with SQL examples

let it marinate with real users, see what they correct, ask questions about or ignore

then add the best/most tested ones as shortcuts

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

No branches or pull requests

2 participants