[OpenLayers-Users] Google and GML layer
Jacolin Yves
yjacolin at free.fr
Thu Dec 6 09:58:40 EST 2007
Le Thursday 06 December 2007 15:37:53 Christopher Schmidt, vous avez écrit :
> 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 ?crit?:
> > > On Thu, Dec 06, 2007 at 02:54:46PM +0100, Jacolin Yves wrote:
> > > > Hi,
> > > >
> > > > One ofmy friend is trying to create a map with a Google layer as
> > > > baseLayer and he added a GML layer. I converted his shapefile from
> > > > WGS84 to
> > > > SphericalMercator with ogr then he converted it in GML file.
> > > >
> > > > The map is ok except for the GML layer where there is 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=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
> > +no_defs" -s_srs "EPSG:4326" Mono2006_2.shp Mono2006_region.shp
>
> Seems sane. Can you confirm that a single non-zero coordinate matches
> the output of passing the same lat/lon into
> http://dev.openlayers.org/docs/files/OpenLayers/Layer/SphericalMercator-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=535714.1400579594,lat=5743560.513581038 lon=535714.1400579594 lat=5743560.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 spherical Mercator? (http://proj.maptools.org/faq.html#datumshifting)
Thanks for your help,
Y.
--
Yves Jacolin
---
http://softlibre.gloobe.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071206/b6da8a0c/attachment.html
More information about the Users
mailing list