<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Sans">
<p>Le Thursday 06 December 2007 15:37:53 Christopher Schmidt, vous avez écrit :</p>
<p>> On Thu, Dec 06, 2007 at 03:11:02PM +0100, Jacolin Yves wrote:</p>
<p>> > Le Thursday 06 December 2007 14:58:46 Christopher Schmidt, vous avez ?crit?:</p>
<p>> > > On Thu, Dec 06, 2007 at 02:54:46PM +0100, Jacolin Yves wrote:</p>
<p>> > > > Hi,</p>
<p>> > > ></p>
<p>> > > > One ofmy friend is trying to create a map with a Google layer as</p>
<p>> > > > baseLayer and he added a GML layer. I converted his shapefile from</p>
<p>> > > > WGS84 to</p>
<p>> > > > SphericalMercator with ogr then he converted it in GML file.</p>
<p>> > > ></p>
<p>> > > > The map is ok except for the GML layer where there is still an</p>
<p>> > > > y-offset. Do you know what we forgot to do?</p>
<p>> > ></p>
<p>> > > My first instinct would be to blame your transformation. How did you</p>
<p>> > > transform it from 4326 to spherical mercator?</p>
<p>> ></p>
<p>> > Something like this :</p>
<p>> ></p>
<p>> > ogr2ogr -f "ESRI Shapefile" -t_srs "+proj=merc +a=6378137 +b=6378137</p>
<p>> > +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null</p>
<p>> > +no_defs" -s_srs "EPSG:4326" Mono2006_2.shp Mono2006_region.shp</p>
<p>></p>
<p>> Seems sane. Can you confirm that a single non-zero coordinate matches</p>
<p>> the output of passing the same lat/lon into</p>
<p>> http://dev.openlayers.org/docs/files/OpenLayers/Layer/SphericalMercator-js.</p>
<p>>html#OpenLayers.Layer.SphericalMercator.forwardMercator ?</p>
<p>></p>
<p>> Regards,</p>
<p>Hi Christopher,</p>
<p></p>
<p>I don't know if I understood what you mean but I tried <span style="font-weight:400">in firebug console </span>:</p>
<p>>>> google.forwardMercator(4.812402,45.769954);</p>
<p>lon=535714.1400579594,lat=5743560.513581038 lon=535714.1400579594 lat=5743560.513581038</p>
<p></p>
<p>the GML layer shows no data there. 4.812402,45.769954 come from the GML file in WGS84 (first vertex from first polygon).</p>
<p></p>
<p>The corresponding vertex in the new GML file in 'spherical Mercartor' is: 535714.140132531,5712913.07157348 which is incorrect (Y-offset).</p>
<p></p>
<p>Does ogr need to supprot datum shifting for creating my file in spherical Mercator? (http://proj.maptools.org/faq.html#datumshifting)</p>
<p></p>
<p>Thanks for your help,</p>
<p></p>
<p>Y.</p>
<p>-- </p>
<p>Yves Jacolin</p>
<p>---</p>
<p>http://softlibre.gloobe.org</p>
</body></html>