I have a query based vector layer in my TileStache configuration, and it's hitting this block of code

if layer.GetSpatialRef() is None and driver_name != 'SQLite': 
    raise KnownUnknown('Couldn\'t get a layer from data source %s' % source_name)```

and failing, because the GetSpatialRef() is returning None. Is there a parameter that I am missing in my configuration? I've tried giving it projected=True and projected=False, with no change in results.

TileStache 1.49.10 on Ubuntu 14.04 with Mapnik 2.3 (not that Mapnik is even used for the vector provider) and PostGIS 2.1 (upgrading from postGIS 1.5.x).

  • Could you post your TileStache config file? It is most likely a configuration issue. May 27, 2014 at 23:09
  • sure, although i dynamically generate my configs (100s of layers) so this is patched together from print obj.__dict__ calls: pastebin.com/22ywgW7W
    – probabble
    May 27, 2014 at 23:53

1 Answer 1


The problem was not in my configuration or even with TileStache, but in my geometry_columns view in my DB. The geometry requested by my query had a SRID of 0 in that view (?!) and manually fixing that fixed TileStache's complaint.

tl:dr; TileStache was right. I should have listened.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.