Quantcast
Channel: Question and Answer » tilestache
Viewing all articles
Browse latest Browse all 13

TileStache Vector Tiles Overlay problem

$
0
0

I am using TileStache to serve my own vector tiles using a postgis datasource. First I re-projected the shapefiles I had using ArcMap ( reprojected to Web Mercator (Auxilary Sphere)) and loaded them in Postgres using shp2pgsql (SRID:900913).

I am able to generate the Tiles using this config file:

{
  "cache":
  {
    "name": "test",
    "path":"/tmp/stache",
    "umask": "0000"

  },
  "layers": 
  {     
    "tpl":
    {       
        "allowed origin":"*",
        "projection": "spherical mercator",
        "provider":
        {
            "class": "TileStache.Goodies.VecTiles:Provider",                        
            "kwargs":{
                "dbinfo":
                {
                    "host":"localhost",
                    "user":"postgres",
                    "password":"postgres",
                    "database":"tpl"
                },
                "queries":
                {
                    "7":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4) -- zoom 7+",
                    "8":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4)",
                    "9":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4)",
                    "10":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4)",
                    "11":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4,3,2)",
                    "12":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4,3,2)",
                    "13":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm WHERE priority IN (5,4,3,2)",
                    "14":"SELECT geom AS __geometry__,name, priority FROM isl_roads_sm  -- zoom 14+"
                }
            }
        },
        "preview":{"ext":"json"}
    }
  }
}

I am rendering the tiles generated using Leaflets TileLayer.GeoJSON. The problem I have is that the tiles dont overlay with the basemap, there is pretty large gap between my tiles and the features on the basemap.Incorrect Overlay

When I use WGS84 as the projection in the config file (using data in WGS84) I get empty tiles, no other errors.

How can I get the tiles to overlay correctly? Why does WGS84 not work?


Viewing all articles
Browse latest Browse all 13

Trending Articles