[OSM-talk-fr] Erreurs hexagone osm

murphy2712.nospam murphy2712.nospam at gmail.com
Lun 14 Avr 12:54:04 UTC 2008


Idem pour :
SELECT transform(way, 4002) FROM planet_osm_line LIMIT 5;
SELECT transform(way, 27582) FROM planet_osm_line LIMIT 5;
SELECT transform(way, 3395) FROM planet_osm_line LIMIT 5;

=> ERREUR: AddToPROJ4SRSCache: Cannot find SRID (900913) in spatial_ref_sys

Apparement 900913 est la projection GOOGLE : Spherical Mercator
(epsg:900913).
Il doit y avoir besoin de cette projection.
J'ai cherché sur Google (lol) et l'ai ajouté :

$query = "INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext,
proj4text) VALUES"
        ." (900913, 'spatialreference.org', 900913,
'PROJCS[\"unnamed\",GEOGCS[\"unnamed
ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6378137,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Mercator_2SP\"],PARAMETER[\"standard_parallel_1\",0],PARAMETER[\"central_meridian\",0],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1],EXTENSION[\"PROJ4\",\"+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 +wktext  +no_defs\"]]', '+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
+wktext  +no_defs');";

Maintenant ça marche :)

Mais tout de même bizarre : tu dois l'avoir dans spatial_ref_sys et pas moi
!
(j'avais pourtant bien éxecuté "psql -d gis
/usr/share/postgresql-8.2-postgis/spatial_ref_sys.sql" => effectivement
après vérif, 900913 n'y est pas...)

PS : "900913" c'est "GOOGLE" en écriture hacker !

On Mon, Apr 14, 2008 at 2:17 PM, Pierre Mauduit <pierre.mauduit at gmail.com>
wrote:

>
> Le lundi 14 avril 2008 à 14:07 +0200, murphy2712.nospam a écrit :
> >         Hmm, c'est quoi exactement la requete sql qui ne passe pas ?
> >
> > Celle qui se trouve dans ton script php :
> >
> > $rs = pg_query($connection,"SELECT box2d(TRANSFORM(way, 4002)),
> > highway from planet_osm_line where highway NOT IN (".$notin.") ORDER
> > BY highway");
> >
>
> Bizarre, dans ton message d'erreur, il indique un srid qui effectivement
> ne semble pas etre valide (Cannot find SRID (900913) in
> spatial_ref_sys). J'avoues que je ne comprends pas bien ... Essaie peut
> etre en faisant des requetes simples de projection :
>
> SELECT transform(way, 4002) FROM planet_osm_line LIMIT 5;
>
> (et en faisant varier le SRID : 4002 étant des lat/long, 27582 étant du
> Lambert II étendu, et 3395 étant du WGS84 ; normalement les autres
> srids, on ne devrait pas en avoir besoin)
>
>
> --
> Pierre
>
>
> _______________________________________________
> Talk-fr mailing list
> Talk-fr at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk-fr
>
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: <http://lists.openstreetmap.org/pipermail/talk-fr/attachments/20080414/527cedd4/attachment.htm>


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