Problems getting vector provider up and running

50 views
Skip to first unread message

Richard Tiley

unread,
Apr 26, 2013, 5:23:37 PM4/26/13
to tiles...@googlegroups.com
Hi folks

I'm trying to set up TileStache to serve up vector tiles for a searchable interactive map that will be connected to a PostGIS database, running on an Ubuntu 12.04 EC2 t1 micro instance at present. I've managed to get TS installed and running using mod_python under an apache2 server. TS installed using pip. Testing the system using uploaded geojson and shapefiles before jumping into the world of PostGIS pain that undoubtably awaits.

I seem to have TS running OK - "TileStache bellows hello" etc. I'm trying to set up a vector provider but am having no luck - every tile I request using a URL like "/tiles/tiles.py/Bacchus/5/16/9.geojson" doesn't return any features eg.
{"type": "FeatureCollection", "features": []}

I've stripped down my dataset to a geojson file that only contains one feature, and have used the Lat/Lon site that was mentioned on another thread (http://teczno.com/squares/#5/57.70/1.05) to find the tile reference that should contain my feature. I think I'm looking in the right place but can't understand why TS isn't finding the polygon for me. The data has been prepared in QGIS and has been saved in the 900913 CRS. I've tried the full layer with all the features in geojson and shapefile formats but still no luck.

I've read through loads of posts on this group (which is massively useful and gets me more excited every time I read) but can't think of what's going wrong. I'd hugely appreciate if anyone has any suggestions as to what might be the problem.

Big thanks in advance, with apologies for newbie ignorance
Richard


test URL:
http://79.125.9.186/tiles/tiles.py/Bacchus/5/16/9.geojson


tilestache.cfg -
{
  "cache": {"name": "Test"},
  "layers": {
    "NS_fields": {
        "provider": {"name": "vector", "driver": "GeoJSON",
                     "parameters": {"file": "/var/www/tiles/Fields_North_Sea.geojson"}},
        "projection": "spherical mercator"
        },
    "Bacchus": {
        "provider": {"name": "vector", "driver": "GeoJSON",
                     "parameters": {"file": "/var/www/tiles/bacchus.geojson"}},
        "projection": "spherical mercator"
        }
  }
}


bacchus.geojson -
http://79.125.9.186/tiles/bacchus.geojson

{
"type": "FeatureCollection",
                                                                                
"features": [
{ "type": "Feature", "id": 13828100, "properties": { "gid": 1240, "country": "UK", "field_name": "BACCHUS", "hc_type": "OIL", "field_status": "PRODUCING", "disc_date": "2005-06-01", "prod_date": "2012-04-01", "abandon_date": null, "facturl": null, "fieldurl": null, "source_id": 393.0, "source_table": "fields_mar_2013", "source_vintage": "2013-03-18", "depth": 30.0 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 115207.857777027849806, 7921197.990455318242311 ], [ 115039.128232413771912, 7921498.97964352928102 ], [ 114926.822417031144141, 7922006.813084589317441 ]

etc etc etc (probably need to simplify geometries but that's for another time...)

Richard Tiley

unread,
Apr 27, 2013, 5:08:23 AM4/27/13
to tiles...@googlegroups.com
Addendum:

I just set up an MBTiles provider in TS which seems to be working fine. The tile where my vector layer should be is here:

...which leads me to wonder if there is a projection problem somewhere. QGIS didn't seem to put any CRS data in my geojson export so I have updated my source geojson file with an EPSG:900913 CRS:

...and updated my tilestache.cfg:

Still no joy.

Thanks in advance if anyone can help!
Richard

Reply all
Reply to author
Forward
0 new messages