Newbie questions

802 views
Skip to first unread message

Thanos D.

unread,
Sep 6, 2012, 3:21:13 AM9/6/12
to tiles...@googlegroups.com
Hi everyone.

Kinda new in tilestache and i could use some help. 
I am trying to set up a tile server, with geojson tiles with a connection to a postgis DB. 
I have imported data from OSM (not the whole planet osm, just a country, from cloudmade.com). The server is an ec2 micro instance where i have installed python and pip following the readme instruction, postgres 9.1 with postgis 1.5.3. I have also installed the geos and gdal ( gdal installed from source with python support). I am curently using the basic set of modules meaning it runs on werkzeug wsgi. 
I imported the data using osm2psql tool, and the db seems to be ok. 
The basic configuration file that is provided with Tilestache works fine, so ec2 configuration is ok, but when i use mine i dont even get a blanc page. On the other hand the error i get is: 

 * Running on http://0.0.0.0:8080/
195.251.96.100 - - [06/Sep/2012 07:13:18] "GET /osm/preview.html HTTP/1.1" 404 -
195.251.96.100 - - [06/Sep/2012 07:13:18] "GET /favicon.ico HTTP/1.1" 400 -

Which seems very generic and cant make anything out of it. I tried to find and/or create a detailed log file, but i couldn't find a way to do it. Verbose option on cache won't work either.

I readed the post on https://groups.google.com/d/msg/tilestache/1XUlLzNxwcs/6uGbzuVeIg4J and i installed gdal with python support, but still dont know whats going on. Is there a way to create a more detailed log file in order to find out whats missing? Or is there a newbie/dummy guide for tilestache connection with postgis. 
This is my cfg file: 

{
  "cache": {
    "name": "Disk",
    "path": "/tmp/tiles/",
    "umask": "0222",
    "dirs": "safe",
    "gzip": [ ],
    "logging": "debug"
  },
  "layers": {
    "vector-postgis-points":
    {
      "provider": {"name": "vector", "driver": "postgis",
                   "parameters": {"dbname": "gis", "user": "postgres", "password": "12345",
                                  "table": "planet_osm_point"}},
      "preview":
      {
        "lat": 37.984,
        "lon": 23.728,
        "zoom": 11,
        "ext": "geojson"
      }

    }
  }
}

Any help would be greatly appreciated. Thanks in advance.
Thanos

Edward Sargisson

unread,
Sep 6, 2012, 10:29:00 PM9/6/12
to tiles...@googlegroups.com
What URL are you attempting to use to get to the server?
You mention WSGI. Do you have Apache running in front or have you turned it off?

I would try going to localhost:8080/vector-postgis-points/preview.html and seeing what happens.
(I'm sorry I forget the URL structure but you get the idea)

Thanos D.

unread,
Sep 7, 2012, 2:04:54 AM9/7/12
to tiles...@googlegroups.com


On Friday, September 7, 2012 5:29:00 AM UTC+3, Edward Sargisson wrote:
What URL are you attempting to use to get to the server?
You mention WSGI. Do you have Apache running in front or have you turned it off?
 
I would try going to localhost:8080/vector-postgis-points/preview.html and seeing what happens.
(I'm sorry I forget the URL structure but you get the idea)


Thanks for the reply.
I haven't installed apache, i am running the werkzeug wsgi on 8080. Its just a simple wsgi. When i set up things correctly i will set up an apache server, but i wanted to make things work on the basic stuff first. 
After your post, I noticed that I hadn't put vector-postgis-points instead of osm in the link so i changed it to the cfg file to osm, and now i get a blank page with a bunch of errors, which is promising. I will try to sort things out and find out whats going on, and i will get back to you. 
Thanks again

Thanos D.

unread,
Sep 7, 2012, 6:05:50 AM9/7/12
to tiles...@googlegroups.com


On Friday, September 7, 2012 9:04:55 AM UTC+3, Thanos D. wrote:


On Friday, September 7, 2012 5:29:00 AM UTC+3, Edward Sargisson wrote:
What URL are you attempting to use to get to the server?
You mention WSGI. Do you have Apache running in front or have you turned it off?
 
I would try going to localhost:8080/vector-postgis-points/preview.html and seeing what happens.
(I'm sorry I forget the URL structure but you get the idea)


Thanks for the reply.
I haven't installed apache, i am running the werkzeug wsgi on 8080. Its just a simple wsgi. When i set up things correctly i will set up an apache server, but i wanted to make things work on the basic stuff first. 
After your post, I noticed that I hadn't put vector-postgis-points instead of osm in the link so i changed it to the cfg file to osm, and now i get a blank page with a bunch of errors, which is promising. I will try to sort things out and find out whats going on, and i will get back to you. 
Thanks again
 
these are the errors i get from werkzeug:

 * Running on http://0.0.0.0:8080/
195.251.96.100 - - [07/Sep/2012 09:18:31] "GET /osm/preview.html HTTP/1.1" 200 -
195.251.96.100 - - [07/Sep/2012 09:18:31] "GET /osm/11/1158/790.geojson HTTP/1.1" 200 -
INFO:werkzeug:195.251.96.100 - - [07/Sep/2012 09:18:31] "GET /osm/11/1158/790.geojson HTTP/1.1" 200 -
195.251.96.100 - - [07/Sep/2012 09:18:34] "GET /osm/11/1158/789.geojson HTTP/1.1" 200 -
INFO:werkzeug:195.251.96.100 - - [07/Sep/2012 09:18:34] "GET /osm/11/1158/789.geojson HTTP/1.1" 200 -
195.251.96.100 - - [07/Sep/2012 09:18:36] "GET /osm/11/1159/790.geojson HTTP/1.1" 200 -
INFO:werkzeug:195.251.96.100 - - [07/Sep/2012 09:18:36] "GET /osm/11/1159/790.geojson HTTP/1.1" 200 -
ERROR 6: No translation for Mercator_1SP_Google to PROJ.4 format is known.
ERROR 6: No translation for Mercator_1SP_Google to PROJ.4 format is known.
.
.
.
More than 1000 errors or warnings have been reported. No more will be reported from now.
195.251.96.100 - - [07/Sep/2012 09:18:42] "GET /osm/11/1159/789.geojson HTTP/1.1" 200 -
INFO:werkzeug:195.251.96.100 - - [07/Sep/2012 09:18:42] "GET /osm/11/1159/789.geojson HTTP/1.1" 200 -
195.251.96.100 - - [07/Sep/2012 09:18:57] "GET /favicon.ico HTTP/1.1" 400 -
.
.
.

I assume that the second group of errors means that no files can be found, cause no files were created by the first group of errors. Some info about my db: i have imported a small subset of osm data from cloudmade (just my country) using osm2psql with these flags:
--keep-coastlines --slim --merc 

Db setup: postgres 9.1 with postgis 1.5.3. I have also ran the  900913.sql.

Any ideas? Did I installed the data with the wrong projection or something like that? Or am i missing a package/driver etc?
Should i also install Apache for better error logs?
Thanks in advance again.

Edward Sargisson

unread,
Sep 7, 2012, 10:48:17 AM9/7/12
to tiles...@googlegroups.com

I'm now spitting out some ideas to give you something to try. Hopefully Mike will come along and help out.


> ERROR 6: No translation for Mercator_1SP_Google to PROJ.4 format is known.
This concerns me. My guess is that the problem is with projections. I would be looking at what SRID your postgis data is in, what SRID your tilestache layers think they need and whether the proj4 library is installed and can be found - and has the right projections in it.

If you have a look at the Stamen Terrain layer you'll see what they have done. I followed along with that to get my projections to work - I remember it being a bit of a pain.

Cheers,
Edward


On Thursday, September 6, 2012 12:21:13 AM UTC-7, Thanos D. wrote:

Michal Migurski

unread,
Sep 8, 2012, 10:44:11 PM9/8/12
to tiles...@googlegroups.com
Arriving late, I'm with Edward. It looks like you're seeing projection errors, perhaps due to a projection undefined in your data source?

Make sure you have something like this, someplace:

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

(from http://docs.openlayers.org/library/spherical_mercator.html)

-mike.
----------------------------------------------------------------
michal migurski- mi...@stamen.com
415.558.1610



Thanos D.

unread,
Sep 9, 2012, 1:01:36 PM9/9/12
to tiles...@googlegroups.com
Thank you both Edward and Mike for your responses. 

As for the proj driver/package: the proj package was installed but the pyproj package wasn't. I installed it but still no change on the errors.
I then checked the db to find the srid of the data. it turns out that osm2psql imports the data in a way that the geometry colum is renamed to "way" instead of "the_geom". I thought that might be the problem, but after altering the column name to the_geom, i got errors that said that couldn't find the way column, so i changed it back to the way it was. 
To find the srid i ran: 
SELECT ST_SRID(way) FROM planet_osm_point LIMIT 1;
 st_srid
---------
  900913
(1 row)
I also checked if tilestache can connect to the db by changing the password, and i got a new db error, so i assume that the initial connection was fine.
So here is what i got so far:
Tilestache is connecting to the db and queries the right columns, proj and pyproj are installed, SRID is 900913 in my data. I dont know how to check if Tilestashe can find the proj libraries.

I also checked your link Mike, and added the line that said 
<900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs
in the end of my /usr/share/proj/epsg file, although i think it says thats for raster images. Anyway i added it, restarted the tilestache script but still no luck and i get the same errors.

Finally i tried to see what the stamen terrain has done from here: https://github.com/Citytracking/Terrain/blob/master/tilestache.cfg but i didn't see any vector/geojson layers. 
I don't get what i am missing... It must be something to the projection as you guys say it is, but i don't know how to test if tilestache has the right drivers or the right paths to use them.

Thanks again for your time, 
Thanos D.

Michal Migurski

unread,
Sep 9, 2012, 2:28:50 PM9/9/12
to tiles...@googlegroups.com
Thanks for sticking with this. I'm seeing so much interest in Tilestache vector support lately, along with all the pitfalls that come along with PostGIS and GDAL bindings that I may add a test script of some sort, just to make it easier to surface configuration or data problems in a structured way. Stay tuned for that.

On Sep 9, 2012, at 10:01 AM, Thanos D. wrote:

> As for the proj driver/package: the proj package was installed but the pyproj package wasn't. I installed it but still no change on the errors.
> I then checked the db to find the srid of the data. it turns out that osm2psql imports the data in a way that the geometry colum is renamed to "way" instead of "the_geom". I thought that might be the problem, but after altering the column name to the_geom, i got errors that said that couldn't find the way column, so i changed it back to the way it was.
> To find the srid i ran:
> SELECT ST_SRID(way) FROM planet_osm_point LIMIT 1;
> st_srid
> ---------
> 900913
> (1 row)

This looks right to me. Osm2pgsql does indeed use "way" as the geometry column name, in contrast to shp2pgsql which uses "the_geom". The selection is fairly arbitrary, and you should check the contents of your geometry_columns table to see what Postgis will report when asked. Also, can you send us the row in your spatial_ref_sys table that has srid=900913? I'm curious what your copy of PostGIS internally understands 900913 to mean.


> I also checked if tilestache can connect to the db by changing the password, and i got a new db error, so i assume that the initial connection was fine.
> So here is what i got so far:
> Tilestache is connecting to the db and queries the right columns, proj and pyproj are installed, SRID is 900913 in my data. I dont know how to check if Tilestashe can find the proj libraries.

Tilestache Vector hands off all responsibility to the osgeo.ogr library, which talks to datasources like shapefiles and PostGIS. If osgeo is installed correctly, which it sounds like it might be, then that's where the projection business will happen.


> Finally i tried to see what the stamen terrain has done from here: https://github.com/Citytracking/Terrain/blob/master/tilestache.cfg but i didn't see any vector/geojson layers.
> I don't get what i am missing... It must be something to the projection as you guys say it is, but i don't know how to test if tilestache has the right drivers or the right paths to use them.

We don't use vector layers for Terrain, I'm not sure how that came up in this thread.

-mike.

Thanos D.

unread,
Sep 10, 2012, 1:51:06 AM9/10/12
to tiles...@googlegroups.com


On Sunday, September 9, 2012 9:28:52 PM UTC+3, Michal Migurski wrote:
Thanks for sticking with this. I'm seeing so much interest in Tilestache vector support lately, along with all the pitfalls that come along with PostGIS and GDAL bindings that I may add a test script of some sort, just to make it easier to surface configuration or data problems in a structured way. Stay tuned for that.

That would be a great help, thank you. 
On Sep 9, 2012, at 10:01 AM, Thanos D. wrote:

> As for the proj driver/package: the proj package was installed but the pyproj package wasn't. I installed it but still no change on the errors.
> I then checked the db to find the srid of the data. it turns out that osm2psql imports the data in a way that the geometry colum is renamed to "way" instead of "the_geom". I thought that might be the problem, but after altering the column name to the_geom, i got errors that said that couldn't find the way column, so i changed it back to the way it was.
> To find the srid i ran:
> SELECT ST_SRID(way) FROM planet_osm_point LIMIT 1;
>  st_srid
> ---------
>   900913
> (1 row)

This looks right to me. Osm2pgsql does indeed use "way" as the geometry column name, in contrast to shp2pgsql which uses "the_geom". The selection is fairly arbitrary, and you should check the contents of your geometry_columns table to see what Postgis will report when asked. Also, can you send us the row in your spatial_ref_sys table that has srid=900913? I'm curious what your copy of PostGIS internally understands 900913 to mean.

here it is:
  srid  | auth_name | auth_srid
--------+-----------+-----------
 900913 | EPSG      |    900913
                                                    proj4text
------------------------------------------------------------------------------------------------------------------
 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

                                                     srtext                                                                                                                                                                                                                                                     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ PROJCS["WGS84 / Simple Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS_1984", 6378137.0, 298.257223563]],PRIMEM["Greenwich", 0.0],UNIT["degree", 0.017453292519943295],AXIS["Longitude", EAST],AXIS["Latitude", NORTH]],PROJECTION["Mercator_1SP_Google"],PARAMETER["latitude_of_origin", 0.0],PARAMETER["central_meridian", 0.0],PARAMETER["scale_factor", 1.0],PARAMETER["false_easting", 0.0],PARAMETER["false_northing", 0.0],UNIT["m", 1.0],AXIS["x", EAST],AXIS["y", NORTH],AUTHORITY["EPSG","900913"]]
 

> I also checked if tilestache can connect to the db by changing the password, and i got a new db error, so i assume that the initial connection was fine.
> So here is what i got so far:
> Tilestache is connecting to the db and queries the right columns, proj and pyproj are installed, SRID is 900913 in my data. I dont know how to check if Tilestashe can find the proj libraries.

Tilestache Vector hands off all responsibility to the osgeo.ogr library, which talks to datasources like shapefiles and PostGIS. If osgeo is installed correctly, which it sounds like it might be, then that's where the projection business will happen.


> Finally i tried to see what the stamen terrain has done from here: https://github.com/Citytracking/Terrain/blob/master/tilestache.cfg but i didn't see any vector/geojson layers.
> I don't get what i am missing... It must be something to the projection as you guys say it is, but i don't know how to test if tilestache has the right drivers or the right paths to use them.

We don't use vector layers for Terrain, I'm not sure how that came up in this thread.

-mike.

----------------------------------------------------------------
michal migurski- mi...@stamen.com
                 415.558.1610

Thanks again for your help
Thanos

Michal Migurski

unread,
Sep 10, 2012, 10:31:03 AM9/10/12
to tiles...@googlegroups.com
> On Sunday, September 9, 2012 9:28:52 PM UTC+3, Michal Migurski wrote:
>
>> Thanks for sticking with this. I'm seeing so much interest in Tilestache vector support lately, along with all the pitfalls that come along with PostGIS and GDAL bindings that I may add a test script of some sort, just to make it easier to surface configuration or data problems in a structured way. Stay tuned for that.
>>
>
> That would be a great help, thank you.

Github is hosed at the moment, but try this script on the test-vector branch:
https://github.com/migurski/TileStache/blob/test-vector/TileStache/Vector/Test.py

Your 900913 projection looks fine.

Thanos D.

unread,
Sep 10, 2012, 12:23:08 PM9/10/12
to tiles...@googlegroups.com
here is what i get from running the script:

root@server:/home/ubuntu/Downloads/TileStache-1.39.0/TileStache/Vector# python -m Test.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 151, in _run_module_as_main
    mod_name, loader, code, fname = _get_module_details(mod_name)
  File "/usr/lib/python2.7/runpy.py", line 101, in _get_module_details
    loader = get_loader(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader
    for importer in iter_importers(fullname):
  File "/usr/lib/python2.7/pkgutil.py", line 430, in iter_importers
    __import__(pkg)
  File "Test.py", line 4
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax
root@server:/home/ubuntu/Downloads/TileStache-1.39.0/TileStache/Vector# python -m Test
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 151, in _run_module_as_main
    mod_name, loader, code, fname = _get_module_details(mod_name)
  File "/usr/lib/python2.7/runpy.py", line 113, in _get_module_details
    code = loader.get_code(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 283, in get_code
    self.code = compile(source, self.filename, 'exec')
  File "/home/ubuntu/Downloads/TileStache-1.39.0/TileStache/Vector/Test.py", line 4
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax
 
Python version 2.7.3
i tried also with 3.2, same errors.

Michal Migurski

unread,
Sep 10, 2012, 1:09:00 PM9/10/12
to tiles...@googlegroups.com
Hi, you need to download the actual python script, not an HTML file.

It would also be better if you pulled an entire copy of TileStache from Github used the script according to the docs:

python -m TileStache.Vector.Test

-mike.

Thanos D.

unread,
Sep 10, 2012, 2:27:00 PM9/10/12
to tiles...@googlegroups.com


On Monday, September 10, 2012 8:09:02 PM UTC+3, Michal Migurski wrote:
Hi, you need to download the actual python script, not an HTML file.

It would also be better if you pulled an entire copy of TileStache from Github used the script according to the docs:

        python -m TileStache.Vector.Test

-mike.
Terrible sorry for this, i downloaded the script with wget.
Anyway i downloaded tilestache 1.4.1, the test script, and reinstalled TileStache after running the script i get:

Password for user postgres:
    INFO - Building TileStache configuration
    INFO - Checking PostgreSQL layer from postgres@localhost/postgres
ERROR 1: PQconnectdb failed.
fe_sendauth: no password supplied

    INFO - Cleaning up /tmp/tilestache-vector-test-KphcMx/*
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/ubuntu/Downloads/TileStache-1.40.1/TileStache/Vector/Test.py", line 148, in <module>
    mimetype, body = getTile(layer, coord, 'geojson')
  File "TileStache/__init__.py", line 96, in getTile
    tile = layer.render(coord, format)
  File "TileStache/Core.py", line 384, in render
    tile = provider.renderTile(width, height, srs, coord)
  File "TileStache/Vector/__init__.py", line 583, in renderTile
    layer, ds = _open_layer(self.driver, self.parameters, self.layer.config.dirpath)
  File "TileStache/Vector/__init__.py", line 435, in _open_layer
    raise KnownUnknown('Couldn\'t open datasource %s' % source_name)
TileStache.Core.KnownUnknown: Couldn't open datasource PG:dbname='postgres' user='postgres' host='localhost' password=''

It seems that although i type my db password, the script doesn't get it.
I have md5 authentication on postgres and a temporary password 12345. I tried to run from user postgres, in case it was unix user authentication issue, but no luck. 
I altered then the postgres user pw to '<void>' restarted the service, but still it was unable to connect.
I changed the login type to trust, restarted the server, and tried to login again but still nothing, same errors

Thanks again for your time

Thanos D.

unread,
Sep 10, 2012, 6:34:06 PM9/10/12
to tiles...@googlegroups.com
OK my bad kinda new with python and forgot the -h flag. I entered the right flags so the script can use the password and here is what i get when i run it:
ubuntu@server:~$ python -m TileStache.Vector.Test --database gis --password 12345

    INFO - Building TileStache configuration
    INFO - Checking PostgreSQL layer from postgres@localhost/gis
ERROR 6: No translation for Mercator_1SP_Google to PROJ.4 format is known.
.
.(many same errors here)
.
.
ERROR 6: No translation for Mercator_1SP_Google to PROJ.4 format is known.
    INFO - TileStache.getTile() postgresql/15/5254/12662.geojson via layer.render() in 0.202
    INFO - Cleaning up /tmp/tilestache-vector-test-H4Pwik/*
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/TileStache/Vector/Test.py", line 160, in <module>
    assert minlon >= ll.lon, 'Minimum longitude should be greater than %.6f' % ll.lon
AssertionError: Minimum longitude should be greater than -122.277832

Sorry for the previous message.
Thanos D.

Thanos D.

unread,
Sep 12, 2012, 9:55:51 AM9/12/12
to tiles...@googlegroups.com
Hi again. 
I couldn't make this work so i started fresh, clean with a new ec2 isntance, 32bit this time. I encountered several problems when i tried to set up the environment. Anyway i am probably doing something wrong with gdal/geos installation.
So I started clean again and decided to try the packages just in case. 
this is what i get:


    INFO - Building TileStache configuration
    INFO - Checking PostgreSQL layer from postgres@localhost/TestGis
    INFO - TileStache.getTile() postgresql/15/5254/12662.geojson via layer.render() in 0.173
    INFO - Cleaning up /tmp/tilestache-vector-test-BXpM6s/*
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/TileStache/Vector/Test.py", line 152, in <module>
    assert len(features), 'There should be at least some features in the tile'
AssertionError: There should be at least some features in the tile

Does this setup helps you better to find what is missing?
 here is what i have installed with sudo apt-get:
 libgeos-3.2.2 swig proj python-proj libgeos-dev
 libgdal1-1.7.3  python-gdal libgdal1-dev python-pyproj
 osm2pgsql postgresql 9.1 postgis 1.5.3
Tilestache ModestMaps PIL mapnik werkzeug SimpleJson

Michal Migurski

unread,
Sep 12, 2012, 12:16:54 PM9/12/12
to tiles...@googlegroups.com
Sorry, I remain baffled. The apparent projection error is a big clue, but at this point it's difficult to help more without seeing your database.

You mentioned it was an EC2 machine, which sounds disposable - could you make it into a public AMI or provide us with a temporary login?

-mike.

Thanos D.

unread,
Sep 14, 2012, 1:57:20 PM9/14/12
to tiles...@googlegroups.com
Sure thing, Sorry for the delay, i destroyed 3-4 instances with full installation before doing it right, and it took some time.

Ok quick review of the setup
geos 3.3.5 GDAL 1.9.1 installed by source
postgres 9.1 postgis 1.5.3
Subset of OpenStreetMap Data from CloudMade imported with: osm2pgsql -U postgres -s -S ./default.style greece.osm
TileStache: Vector-Test Branch and Setup as described by README.am

DSA key password and unix password : test1234

user Account Tester (with sudo privilages just type sudo su on logon cause i haven't fix the .bashrc )
Connect with:

postgres password:12345

Tester key:

DEK-Info: AES-128-CBC,472E5457A180F6B975493B6CD422C3B0

XElSQ3LfQumXsN4Sal9m/j0qWiaZ14yKzRizyodEENQ9PJZOp/bwtZIDEPuSYD2T
SjR3wUr12W6TRPu5pxY4rvgOcKBr49xS06C8pGtxDuSBkvl1G4qYNBrUTsqieH1d
SDRneVYYzrVLykNl48y0bW1U4E8HaaEw73rrzccMLjO/3FHsem81sIbO1ZP8AkAh
pUfAXz8WQWCm459+23e2DaiUBAZNotolGb0yOYo21ouffi2jwT955eJlIosp0gEK
F5xFJsplEbR1wu/68yFry4SbRls0VkWBmK6aFkUMuccw3TTJbsPQSV5u1+hmPznI
ByWz+uaZYG1t8L57xD09ez2UWngneNA/kfewARtO34xgoRVlPo3n5cQNaqQa4Gcz
DcgDvPYThEMA7K5FHsG8m2wP5rPPV8x5KlPmNH5ELjJ+t6pOrX+RAqwaB3CNCqwL
k1xkuZvY3Yhpk8QHcRsGscKku+JbzpBbYf2o53B7QNYjCFtTL68e2+/0YDoCYWDk
xF429wEa3asbcpUrewPierSgh34CC8Umj8jLOoUuYnMzIVwNYRG5+8EzNaZLYI8G
RsCk4Cm1upAvmPR+FaxWXw==
-----END DSA PRIVATE KEY-----

During the data import i got this message:

*** WARNING: intarray contrib module not installed
*** The resulting database will not be usable for applying diffs.

I dont know if its rellevant but i thought to report it, just in case...


Now when i run the TileStache.Vector.Test i get this error again

ubuntu@server:~$ python -m TileStache.Vector.Test --database=testgis --password=12345
    INFO - Building TileStache configuration
    INFO - Checking PostgreSQL layer from postgres@localhost/testgis
    INFO - TileStache.getTile() postgresql/15/5254/12662.geojson via layer.render() in 0.078
    INFO - Cleaning up /tmp/tilestache-vector-test-yuAR89/*
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/TileStache/Vector/Test.py", line 152, in <module>
    assert len(features), 'There should be at least some features in the tile'
AssertionError: There should be at least some features in the tile


Thanks again for the help.

Thanos D.

unread,
Sep 15, 2012, 4:48:48 AM9/15/12
to tiles...@googlegroups.com
Hi again. I couldn't make the TileStache.Vector.Test run successfully , but i tested this new instance with my cfg and saw that it produces non-empty tiles in /tmp/tiles directory, although the preview is showing blanc tiles, which confused me yesterday and thought that it didn't work. Actually it gets empty responses from what i see in firebug. Anyway i 'll read the Tilestach.vector PostGIS/GeoJSON topic to find a solution. 

I still don't know why the test script didn't work.
Thanks again for your time and your help.
Thanos D.

T. D.

unread,
Nov 9, 2012, 8:27:21 PM11/9/12
to tiles...@googlegroups.com
Hi all,
Things are going great and i am trying many things with my setup. I would like to thank you all for your help. 
I have a postgis db with data from cloudmade, imported with osm2pgsql with google projection.
I have managed to create a geojson tiles layer and a png layer via mapnik and xml file from the same data. The thing is that when i view the map to polymaps and center the map at the same point i see different map areas in each map. I include my xml style file for mapnik and my cfg file. Could it be a projection error or something like that? Cause i had to declare this <!ENTITY srs900913 "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over"> in order to make it work.
Another thing i noticed is that in the geojson layer, the tiles on the y axis dont connect with each other and have a small space between them. I believe that this has something to do with the visualization of the image but i am not sure. Its not  a problem but i wanted to know if its ok. Is there a chance the 2 problems are connected in any way? Also its noticable only on hight zooms levels. I have attached an image with a screenshot of the problem.

Thanks again for your help, I would be gratefull for any ideas and suggestions

{
  "cache": {
    "name": "Disk",
    "path": "/tmp/tiles/",
    "dirs": "portable",
    "gzip": [],
    "logging": "debug"
  },
  "layers": {
    "osm_roads_simple":
    {
      "provider": {"name": "vector", "driver": "postgis",
                   "parameters": {"dbname": "gis", "user": "postgres", "password": "****",
                                  "table": "planet_osm_roads"}},

      "allowed origin": "*",
      "bounds": { "low":9 }

    },

    "osm_ori":
    {
        "provider": {"name": "mapnik", "mapfile": "/home/ubuntu/mapnik.xml"}
    }

  }
}

mapnik.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map [
<!ENTITY % entities SYSTEM "/home/ubuntu/mapnik/inc/entities.xml.inc">
%entities;
]>
<Map background-color="#b5d0d0" srs="&srs900913;" minimum-version="2.0.0">
  <Style name="MyStyle">
    <Rule>
      <LineSymbolizer stroke="rgb(10%,10%,10%)" stroke-width="0.2" />
    </Rule>
  </Style>
<Layer name="osm_ori" status="on" srs="&srs900913;">
    <StyleName>MyStyle</StyleName>
    <Datasource>
        <Parameter name="type">postgis</Parameter>
        <Parameter name="host">localhost</Parameter>
        <Parameter name="dbname">gis</Parameter>
        <Parameter name="user">postgres</Parameter>
        <Parameter name="password">12345</Parameter>

      <Parameter name="table">
      (select way
       from planet_osm_roads

      ) as MyStyle
      </Parameter>
      &datasource-settings;
    </Datasource>
</Layer>
</Map>

/entities.xml.inc


<!ENTITY srs900913 "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
<!ENTITY srsmercator "+proj=merc +datum=WGS84 +over">
<!ENTITY srs4326 "+init=epsg:4326">
<!ENTITY maxscale_zoom0 "<MaxScaleDenominator>250000000000</MaxScaleDenominator>">
<!ENTITY maxscale_zoom1 "<MaxScaleDenominator>500000000</MaxScaleDenominator>">
....
<!ENTITY maxscale_zoom18 "<MaxScaleDenominator>2500</MaxScaleDenominator>">
<!ENTITY minscale_zoom18 ""

gapbetweentiles.png

T. D.

unread,
Nov 19, 2012, 10:48:15 AM11/19/12
to tiles...@googlegroups.com
Hi guys 
Sorry for bringing this up again, but does any1 has any ideas why this missmatch happens? I talk about the difference in the same point i mentioned in my previous post. For some reason when i center the map on the same point, the centers are different in each map, which is a problem because i cant make 2 different layers one on top of the other. The data are from the same db, tiles are both 256x256 and they have the same projection (google). I am i missing something? Is there a way to see what projection rule is used by tilestache to create the tiles? Is there a way to "move" the axis of the projection so i can manually set it on the same point? 
Thanks again for your time guys.
Reply all
Reply to author
Forward
0 new messages