Calculating tiles intersecting a geometry

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Calculating tiles intersecting a geometry

Paul Norman
I want to calculate GMaps tile numbers that intersect a geometry in a
range of zooms, and was looking for any prior work along these lines.
What I need is a function which takes geom, minimum zoom, and maximum
zoom and returns a set of z,x,y which intersect the geometry.

My initial naive idea is to write a recursive query which starts at
minzoom, finds intersecting tiles, then for each intersecting tile finds
intersecting tiles at zoom z+1 until maxzoom is reached.

Implementations of this idea outside of postgis are
https://github.com/openstreetmap/osm2pgsql/blob/master/expire-tiles.cpp 
and
https://github.com/openstreetmap/chef/blob/master/cookbooks/tile/files/default/ruby/expire.rb

Has anyone done this before?
_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: Calculating tiles intersecting a geometry

Imre Samu
>I want to calculate GMaps tile numbers that intersect a geometry in a range of zooms,
>and was looking for any prior work along these lines. 
>What I need is a function which takes geom, minimum zoom, and maximum zoom and returns a set of z,x,y which intersect the geometry
>Has anyone done this before?

AS I know osm2vectortiles project[1]  using a traversing quadtree[2] based solution for detecting changed tiles: 

[1]  on http://osm2vectortiles.org/docs/     Academic Material  ->  Bachelor thesis PDF 
 and search for   : "5.4 calculate changed tiles"  ->    PostgreSQL Implementation
 github:  -> "CREATE OR REPLACE FUNCTION overlapping_tiles("


The Mapbox Tile-Cover [ "generate the minimum number of tiles to cover a geojson geometry" ] 
is implemented is JavaScript [ https://github.com/mapbox/tile-cover ]  
so maybe it can be call via  PostgreSQL PL/v8







2016-09-10 2:35 GMT+02:00 Paul Norman <[hidden email]>:
I want to calculate GMaps tile numbers that intersect a geometry in a range of zooms, and was looking for any prior work along these lines. What I need is a function which takes geom, minimum zoom, and maximum zoom and returns a set of z,x,y which intersect the geometry.

My initial naive idea is to write a recursive query which starts at minzoom, finds intersecting tiles, then for each intersecting tile finds intersecting tiles at zoom z+1 until maxzoom is reached.

Implementations of this idea outside of postgis are https://github.com/openstreetmap/osm2pgsql/blob/master/expire-tiles.cpp and https://github.com/openstreetmap/chef/blob/master/cookbooks/tile/files/default/ruby/expire.rb

Has anyone done this before?
_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users