[OSM-dev-fr] osmfr-cartocss setup incomprehensible

Arnaud Vandecasteele arnaud.sig at gmail.com
Ven 24 Mai 12:22:27 UTC 2013


Par défaut tu n'as pas l'autorisation d'utiliser les tables 
spatial_ref_sys et geometry_columns
Pour remédier à cela, il faut faire:

psql -d osm -c "GRANT ALL ON geometry_columns TO PUBLIC;"
psql -d osm -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;


Ensuite le mieux c'est de te faire un template géographique (une sorte 
de base de données qui servira de modèle).
Puis tu utilises celle-la pour chaque nouvelle base de données 
géographiques :

createdb -E UTF8 template_postgis
createlang -d template_postgis plpgsql
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"

A.



On 13-05-24 09:45 AM, Ista Pouss wrote:
> Le 24 mai 2013 13:59, Arnaud Vandecasteele <arnaud.sig at gmail.com 
> <mailto:arnaud.sig at gmail.com>> a écrit :
>
>     psql -d osm <
>     /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
>
>
> Merci Jeanne d'Arc ! Ceci a marché ! Merci !
>
> Mais...
>
> > osm2pgsql -s -U fr  -d osm datas1.osm
> osm2pgsql SVN version 0.80.0 (32bit id space)
>
> Using projection SRS 900913 (Spherical Mercator)
> Setting up table: planet_osm_point
> NOTICE:  table "planet_osm_point" does not exist, skipping
> NOTICE:  table "planet_osm_point_tmp" does not exist, skipping
> SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 );
>  failed: ERROR:  permission denied for relation spatial_ref_sys
> CONTEXT:  SQL statement "SELECT SRID         FROM spatial_ref_sys 
> WHERE SRID = new_srid"
> PL/pgSQL function "addgeometrycolumn" line 75 at SQL statement
> SQL statement "SELECT AddGeometryColumn('','',$1,$2,$3,$4,$5)"
> PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement
>
> Error occurred, cleaning up
>
> Le "data1.osm" est un fichier que j'ai téléchargé par josm sur une 
> petite région près de chez moi.
>
>
>
>     De plus quelle est ta version de Postgis?
>
>
> Aucune idée. c'est la dernière pour ubuntu par apt-get je supose ? (ça 
> ne serait pas la 1.5 ? puisque "psql -d osm < 
> /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql " comme tu 
> m'as dit ? )
>
>
>     Avec les plus récentes il te suffit de faire en SQL:
>
>     create extension postgis;
>
>
> Cela n'a pas marché en tous cas.
>
>
> _______________________________________________
> dev-fr mailing list
> dev-fr at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev-fr

-- 
--------------------------------------------------------------------
Arnaud Vandecasteele
SIG - WebMapping - Spatial Ontology - GeoCollaboration

Web Site
http://geotribu.net/

-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: <http://lists.openstreetmap.org/pipermail/dev-fr/attachments/20130524/a5e81dd6/attachment.html>


Plus d'informations sur la liste de diffusion dev-fr