[OpenLayers-Users] Google and GML layer

Jacolin Yves yjacolin at free.fr
Thu Dec 6 10:50:43 EST 2007


Le Thursday 06 December 2007 15:37:53 Christopher Schmidt, vous avez ecrit :
> On Thu, Dec 06, 2007 at 03:11:02PM +0100, Jacolin Yves wrote:
> > Le Thursday 06 December 2007 14:58:46 Christopher Schmidt, vous avez ecrit :
> > > On Thu, Dec 06, 2007 at 02:54:46PM +0100, Jacolin Yves wr= ote:
> > > > Hi,
> > > >
> > > > One ofmy friend is trying to create a map with a Goo= gle layer as
> > > > baseLayer and he added a GML layer. I converted his = shapefile from
> > > > WGS84 to
> > > > SphericalMercator with ogr then he converted it in G= ML file.
> > > >
> > > > The map is ok except for the GML layer where there i= s still an
> > > > y-offset. Do you know what we forgot to do?
> > >
> > > My first instinct would be to blame your transformation. = How did you
> > > transform it from 4326 to spherical mercator?
> >
> > Something like this :
> >
> > ogr2ogr -f "ESRI Shapefile" -t_srs "+proj=3Dmer= c +a=3D6378137 +b=3D6378137
> > +lat_ts=3D0.0 +lon_0=3D0.0 +x_0=3D0.0 +y_0=3D0 +k=3D1.0 +units= =3Dm +nadgrids=3D at null
> > +no_defs" -s_srs "EPSG:4326" Mono2006_2.shp Mon= o2006_region.shp
>
> Seems sane. Can you confirm that a single non-zero coordinate match= es
> the output of passing the same lat/lon into
> http://dev.openlayers.org/docs/files/OpenLayers/Layer/SphericalMerc= ator-js.
>html#OpenLayers.Layer.SphericalMercator.forwardMercator ?
>
> Regards,
Hi Christopher,

I don't know if I understood what you mean but I tried in firebug console :
>>> google.forwardMercator(4.812402,45.769954);
lon=3D535714.1400579594,lat=3D5743560.513581038 lon=3D535714.1400579594 = lat=3D5743560.513581038

the GML layer shows no data there. 4.812402,45.769954 come from the GML = file in WGS84 (first vertex from first polygon).

The corresponding vertex in the new GML file in 'spherical Mercartor' is= : 535714.140132531,5712913.07157348 which is incorrect (Y-offset).

Does ogr need to supprot datum shifting for creating my file in spherica= l Mercator? (http://proj.maptools.org/faq.html#datumshifting)

Thanks for your help,

Y.
PS : send again, don't know if you receive it, sorry for inconvenience.
-- 
Yves Jacolin
---
http://softlibre.gloobe.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071206/82710afe/attachment.html


More information about the Users mailing list