[OSM-dev] Mapnik/Postgres: Permissions Issue with contour layer

Dane Springmeyer dane at dbsgeo.com
Tue Nov 9 23:22:28 GMT 2010

On Nov 9, 2010, at 5:47 PM, Nick Whitelegg wrote:

> Hi,
> I'm having difficulty rendering a Mapnik contour layer on a custom Mapnik tile server setup that I'm wanting to use for Freemap (this is on the SUCS website - thanks to Chris Jones!)
> I've asked Chris, but in case it's a tricky issue I thought I'd ask here as well.
> Basically OSM for the UK has been loaded into a database called 'gis'. I've also imported SRTM contour data, using the standard approach documented in the wiki, into a database called 'nickw' which I have full rights over (unlike the 'gis' database). I've granted SELECT privileges to the 'gis' user into this 'nickw' database but am getting the following error :
> Nov  9 22:03:04 tilesrv renderd[13669]: An error occurred while loading the map layer 'openfootmap': PSQL error:#012ERROR:  permission denied for relation geometry_columns#012Full sql was: 'SELECT f_geometry_column, srid FROM geometry_columns WHERE f_table_name='contours''#012 (encountered during parsing of layer 'srtm_10')

The obvious question is did you grant select on the geometry_columns and spatial_ref_sys tables?

Mapnik needs to be able to query these tables to get metadata about your spatial data tables, unless you supply it yourself.

So, for example you can bypass this by supplying:

<Parameter name="srid">900913</Parameter>
<Parameter name="geometry_field">way</Parameter>

> It seems that the 'gis' user cannot access the 'nickw' database for some reason.

perhaps, or perhaps just those postgis tables?

> Is it maybe something as simple as having to restart the pgsql daemon?

I doubt it.

> Incidentally I can render the contours successfully if I import into my own database on my own machine.
> Any pointers on this? The relevant section of the XML is as follows:
> <Layer name="srtm_10" status="on" srs="+proj=latlong +datum=WGS84">
>        <StyleName>contours10</StyleName>
>        <StyleName>contours-text10</StyleName>
>        <Datasource>
>                <Parameter name="type">postgis</Parameter>
>                <Parameter name="host">localhost</Parameter>
>                <Parameter name="port">5432</Parameter>
>                <Parameter name="user">gis</Parameter>
>                <Parameter name="password">[gis's password]</Parameter>
>                <Parameter name="dbname">nickw</Parameter>
>                <Parameter name="estimate_extent">false</Parameter>
>                <Parameter name="table">(select way,height from contours WHERE height::integer % 10 = 0 AND height::integer % 50 != 0 AND height::integer % 100 != 0) as "contours-10"</Parameter>
>                <Parameter name="extent">-180,-89.99,180,89.99</Parameter>
>        </Datasource>
> </Layer>
> Thanks,
> Nick
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev

More information about the dev mailing list