[OSM-talk-fr] problèmes avec lwpostgis.sql
pascal.ferrand@aliceadsl.fr
pascal.ferrand at aliceadsl.fr
Jeu 15 Jan 16:04:42 UTC 2009
Peut-être, je suis pas programmeur, j'ai fait des essais avec la connexion la plus simple qui soit.
ce mycursor est pour moi une véritable énigme et, pour INTERNET, mes compétences en anglais sont quelquefois insuffisantes ...
# Map file created from QGIS project file /home/user/003_OSM.qgs
# Edit this file to customize for your map interface
MAP
NAME
# Map image size
SIZE
UNITS dd
EXTENT -926595.883036 5069961.000000 1458645.820536 6637725.500000
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
END
# Background color for the map canvas -- change as desired
IMAGECOLOR 192 192 192
IMAGEQUALITY 95
IMAGETYPE gif
OUTPUTFORMAT
NAME gif
DRIVER 'GD/GIF'
MIMETYPE 'image/gif'
#IMAGEMODE PC256
EXTENSION 'gif'
END
# Legend
LEGEND
IMAGECOLOR 255 255 255
STATUS ON
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
END
# Web interface definition. Only the template parameter
# is required to display a map. See MapServer documentation
WEB
# Set IMAGEPATH to the path where MapServer should
# write its output.
IMAGEPATH '/tmp/'
# Set IMAGEURL to the url that points to IMAGEPATH
# as defined in your web server configuration
IMAGEURL '/tmp/'
# WMS server settings
METADATA
'wms_title' ''
'wms_onlineresource' 'http://my.host.com/cgi-bin/mapserv?map=wms.map&'
'wms_srs' 'EPSG:4326'
END
#Scale range at which web interface will operate
# Template and header/footer settings
# Only the template parameter is required to display a map. See MapServer documentation
END
LAYER
NAME 'planet_osm_roads'
TYPE LINE
CONNECTIONTYPE postgis
CONNECTION 'host=192.168.2.2 user=appcarto password=appcarto dbname=gis'
DATA 'way FROM public.planet_osm_roads'
FILTER ''
METADATA
'wms_title' 'planet_osm_roads'
END
STATUS DEFAULT
TRANSPARENCY 100
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
END
CLASS
NAME 'planet_osm_roads'
STYLE
SYMBOL 0
SIZE 6
OUTLINECOLOR 239 175 98
COLOR 0 0 0
END
END
END
---------- Initial Header -----------
From : talk-fr-bounces at openstreetmap.org
To : Discussions sur OSM en français<talk-fr at openstreetmap.org>
Cc :
Date : Thu, 15 Jan 2009 16:47:10 +0100
Subject : Re: [OSM-talk-fr] problèmes avec lwpostgis.sql
c'est un problème de mapfile ça. tu peux me le montrer ?
pascal.ferrand at aliceadsl.fr a écrit :
>
>
> coté console POSTGRESQL/POSTGIS
>
>
> INSTRUCTION : DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(way)),'NDR'),OID::text from public.planet_osm_roads WHERE () and (way && setSRID( 'BOX3D(-926595.883036 4661222.398214,1458645.820536 7046464.101786)'::BOX3D,find_srid('','public.planet_osm_roads','way') ))
> ERREUR: le curseur « mycursor » n'existe pas
> INSTRUCTION : CLOSE mycursor
>
>
> coté MAPSERVER
>
> [Thu Jan 15 16:02:34 2009] [error] [client 192.168.2.2] PHP Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named 'planet_osm_roads'.\n in /var/appcarto/democarto-Loire/phpmapscript_05.php on line 7
> [Thu Jan 15 16:02:34 2009] [error] [client 192.168.2.2] PHP Warning: [MapServer Error]: prepare_database(): Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(way)),'NDR'),OID::text from public.planet_osm_roads WHERE () and (way && setSRID( 'BOX3D(-926595.883036 4661222.398214,1458645.820536 7046464.101786)'::BOX3D,find_srid('','public.planet_osm_roads','way') ))' \n\nPostgresql reports the error as 'ERREUR: erreur de syntaxe sur ou pr\xc3\xa8s de \xc2\xab ) \xc2\xbb\nLINE 1: ...R'),OID::text from public.planet_osm_roads WHERE () and (way...\n ^\n'\n\nMore Help:\n\nError with POSTGIS data variable. You specified 'check your .map file'.\nStandard ways of specifiying are : \n(1) 'geometry_column from geometry_table' \n(2) 'geometry_column from (sub query) as foo using unique column name using SRID=srid#' \n\nMake sure you put i
n the 'using unique column name' and 'using SRID=#' clauses in.\n\nFor more help, please see http://postgis.refractions.net/documentation/ in /var/appcarto/democarto-Loire/phpmapscript_05.php on line 7
> [Thu Jan 15 16:02:34 2009] [error] [client 192.168.2.2] PHP Fatal error: Call to a member function saveWebImage() on a non-object in /var/appcarto/democarto-Loire/phpmapscript_05.php on line 8
>
>
>
>
>
>
>
>
>
>
>
>
>
> ---------- Initial Header -----------
>
>>From : talk-fr-bounces at openstreetmap.org
> To : Discussions sur OSM en français<talk-fr at openstreetmap.org>
> Cc :
> Date : Thu, 15 Jan 2009 15:31:22 +0100
> Subject : Re: [OSM-talk-fr] problèmes avec lwpostgis.sql
>
> Il se peut que le template par défaut utilisé par postgresql intègre
> déjà les fonctions spatiales de postgis, auquel cas l'étape
> lwpostgis.sql est inutile.
>
> Sinon quel est le problème ? Quelles sont les erreurs liées à mycursor
> dans les logs ?
>
> Guillaume
>
> pascal.ferrand at aliceadsl.fr a écrit :
>> Bonjour,
>>
>> voilà ce que je fais.
>>
>> createdb gis
>> createlang plpgsql gis
>> psql -d gis -f /home/appcarto/lwpostgis.sql
>> psql -d gis -f /home/appcarto/osm2pgsql/900913.sql
>> osm2pgsql -m -d gis /mnt/USB_CLE/france.osm.bz2
>>
>> tout semblait "bien" se passer, les connexions via QGIS m'ont demandé une clé primaire ce qui n'est pas difficile à faire après avoir été conseillé...
>>
>> j'ai découvert des problèmes relatifs à "mycursor" dans les "log" de postgresql/postgis lors de la réalisation de layers osm pour mapserver.
>>
>> Et en regardant sur internet, il semblait que cela pouvait venir de lwpostgis.sql. C'est vrai qu'il ne fonctionne pas correctement mais cela était passé totalement inaperçu avant.
>>
>> que pourrais-je faire ?
>>
>> Cordialement
>>
>> Pascal
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------- Initial Header -----------
>>
>> >From : talk-fr-bounces at openstreetmap.org
>> To : Discussions sur OSM en français<talk-fr at openstreetmap.org>
>> Cc :
>> Date : Thu, 15 Jan 2009 15:04:18 +0100
>> Subject : Re: [OSM-talk-fr] problèmes avec lwpostgis.sql
>>
>> Postgis est déjà probablement chargé dans la base, donc pas la peine de
>> relance le lwpostgis.sql
>>
>> Guillaume
>>
>> pascal.ferrand at aliceadsl.fr a écrit :
>>> Bonjour tout le monde,
>>>
>>> En prévision d'essais sur mapnik, j'ai essayé osm2pgsql
>>>
>>> et me suis rendu compte que postgresql/postgis que je supposais bien fonctionner me crée des problèmes lorsque je lance :
>>>
>>> psql -d gis-osm -f lwpostgis.sql
>>>
>>> Visiblement lwpostgis.sql bloque sur les CREATE TYPE ... , CREATE OPERATEUR ... en retournant " xxxx already exists"
>>>
>>> j'ai essayé de faire sauter ces CREATE mais il y en a vraiment beaucoup.
>>>
>>> pour info, le même problème se produit sur mes deux micros l'un en mandriva et l'autre avec postgresql/postgis compilé.
>>>
>>> A l'aide
>>>
>>> Cordialement
>>>
>>> Pascal
>>>
>>>
>>>
>>> ---------------------- ALICE N°1 de la RELATION CLIENT 2008*--------------------
>>> Découvrez vite l'offre exclusive ALICE BOX! En cliquant ici http://abonnement.aliceadsl.fr Offre soumise à conditions.*Source : TNS SOFRES / BEARING POINT. Secteur Fournisseur d.Accès Internet
>>>
>>>
>>>
>>> _______________________________________________
>>> Talk-fr mailing list
>>> Talk-fr at openstreetmap.org
>>> http://lists.openstreetmap.org/listinfo/talk-fr
>>>
>>>
>> _______________________________________________
>> Talk-fr mailing list
>> Talk-fr at openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/talk-fr
>>
>>
>>
>> ---------------------- ALICE N°1 de la RELATION CLIENT 2008*--------------------
>> Découvrez vite l'offre exclusive ALICE BOX! En cliquant ici http://abonnement.aliceadsl.fr Offre soumise à conditions.*Source : TNS SOFRES / BEARING POINT. Secteur Fournisseur d.Accès Internet
>>
>>
>>
>> _______________________________________________
>> Talk-fr mailing list
>> Talk-fr at openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/talk-fr
>>
>>
>
> _______________________________________________
> Talk-fr mailing list
> Talk-fr at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk-fr
>
>
>
> ---------------------- ALICE N°1 de la RELATION CLIENT 2008*--------------------
> Découvrez vite l'offre exclusive ALICE BOX! En cliquant ici http://abonnement.aliceadsl.fr Offre soumise à conditions.*Source : TNS SOFRES / BEARING POINT. Secteur Fournisseur d.Accès Internet
>
>
>
> _______________________________________________
> Talk-fr mailing list
> Talk-fr at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk-fr
>
>
_______________________________________________
Talk-fr mailing list
Talk-fr at openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-fr
---------------------- ALICE N°1 de la RELATION CLIENT 2008*--------------------
Découvrez vite l'offre exclusive ALICE BOX! En cliquant ici http://abonnement.aliceadsl.fr Offre soumise à conditions.*Source : TNS SOFRES / BEARING POINT. Secteur Fournisseur d.Accès Internet
Plus d'informations sur la liste de diffusion Talk-fr