I have successfully installed TileStache in my server. Now I have a geojson file and want to serve it through TileStache. I am new to TileStache and I can't find a clear explanation of how to setup a Geojson in TileStache. Best explanation I can found is here, but it uses a shp file as the datasource.
I tried adding a vector-sf-streets layer to the config file, so my config file looks like this:
{ "cache": { "name": "Test", "path": "/tmp/stache", "umask": "0000" }, "layers": { "osm": { "provider": {"name": "proxy", "provider": "OPENSTREETMAP"}, "png options": {"palette": "http://tilestache.org/example-palette-openstreetmap-mapnik.act }, "example": { "provider": {"name": "mapnik", "mapfile": "examples/style.xml"}, "projection": "spherical mercator" }, "vector-sf-streets": { "provider": {"name": "vector", "driver": "GeoJSON", "parameters": {"file": "/etc/TileStache/kalimantan.json"} } } } When I tried to run using tilestache-server.py -c /etc/TileStache/tilestache.cfg, it gives me error like this:
Error loading Tilestache config: Traceback (most recent call last): File "/usr/local/bin/tilestache-server.py", line 5, in pkg_resources.run_script('TileStache==1.50.1', 'tilestache-server.py') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/TileStache-1.50.1-py2.7.egg/EGG-INFO/scripts/tilestache-server.py", line 55, in app = TileStache.WSGITileServer(config=options.file, autoreload=True) File "/usr/local/lib/python2.7/dist-packages/TileStache-1.50.1-py2.7.egg/TileStache/__init__.py", line 342, in __init__ self.config = parseConfigfile(config) File "/usr/local/lib/python2.7/dist-packages/TileStache-1.50.1-py2.7.egg/TileStache/__init__.py", line 97, in parseConfigfile config_dict = json_load(urlopen(configpath)) File "/usr/lib/python2.7/json/__init__.py", line 278, in load **kw) File "/usr/lib/python2.7/json/__init__.py", line 326, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting object: line 26 column 2 (char 620) I can't figure out what is wrong. I want to know how to set TileStache using a Geojson as the datasource.
أكثر...
I tried adding a vector-sf-streets layer to the config file, so my config file looks like this:
{ "cache": { "name": "Test", "path": "/tmp/stache", "umask": "0000" }, "layers": { "osm": { "provider": {"name": "proxy", "provider": "OPENSTREETMAP"}, "png options": {"palette": "http://tilestache.org/example-palette-openstreetmap-mapnik.act }, "example": { "provider": {"name": "mapnik", "mapfile": "examples/style.xml"}, "projection": "spherical mercator" }, "vector-sf-streets": { "provider": {"name": "vector", "driver": "GeoJSON", "parameters": {"file": "/etc/TileStache/kalimantan.json"} } } } When I tried to run using tilestache-server.py -c /etc/TileStache/tilestache.cfg, it gives me error like this:
Error loading Tilestache config: Traceback (most recent call last): File "/usr/local/bin/tilestache-server.py", line 5, in pkg_resources.run_script('TileStache==1.50.1', 'tilestache-server.py') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/TileStache-1.50.1-py2.7.egg/EGG-INFO/scripts/tilestache-server.py", line 55, in app = TileStache.WSGITileServer(config=options.file, autoreload=True) File "/usr/local/lib/python2.7/dist-packages/TileStache-1.50.1-py2.7.egg/TileStache/__init__.py", line 342, in __init__ self.config = parseConfigfile(config) File "/usr/local/lib/python2.7/dist-packages/TileStache-1.50.1-py2.7.egg/TileStache/__init__.py", line 97, in parseConfigfile config_dict = json_load(urlopen(configpath)) File "/usr/lib/python2.7/json/__init__.py", line 278, in load **kw) File "/usr/lib/python2.7/json/__init__.py", line 326, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting object: line 26 column 2 (char 620) I can't figure out what is wrong. I want to know how to set TileStache using a Geojson as the datasource.
أكثر...