[OpenLayers-Users] Conversion to Spherical Mercator - 100m error

Christopher Schmidt crschmidt at metacarta.com
Fri Aug 8 18:34:21 EDT 2008


On Fri, Aug 08, 2008 at 01:02:31PM -0700, George.Muammar wrote:
> The road layer (Teleatlas / Navteq) comes in UTM - WGS84 and I also combine
> it with my cadastral data. I play with these projections every day and are
> very confident with them  - but not so with the so called "spherical
> mercator"

Using Google Maps in EPSG:4326 *must* lead to offsets within OpenLayers.
There is no possible way to avoid this, as Google Maps data is
*projected* data, and EPSG:4326 is a 'flat' projection, using lat/lon as
planar units. The end result is that there is no way that you can
correctly overlay data on top of Google Maps, Virtual Earth, or any
other commercial baselayer.

However, reading the following, I realize you are using spherical
mercator? At least, I Think? In which case, the answer is "yes, I have
used this with 'very accurate maps', and had no problems getting pixel
perfect overlays on top of Google Maps. However, I have also seen
significant offsets, *especially* in VirtualEarth (in the 100M range)
even in areas where I would typicaly expect better results.
(Specifically, New Orleans in VE at some zoom levels is *bad*.)

I don't see anything wrong with your configuration here; Have you tried
laying over Google instead?

Another comment is that it is possible that your proj.4 version may
affect things: I've heard people reporting problems with older proj.4
libraries not respecting the +nadgrids=@null hack.

Just a few thoughts.

> 
> Does anybody have any opinion in the matter ? has anyone tried to overlay
> Google / VE / Yahoo with very accurate maps ?
> 
> For the record I am doing the following: (maybe something wrong)
> 
> projections in Proj.4 epsg file:
> 
> # Spherical Mercator for Google etc. 
> <900913> +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
> #	GAUSS BOAGA EST 
> <3004> +proj=tmerc +lat_0=0 +lon_0=15.0 +k=0.999600 +x_0=2520000 +y_0=0
> +ellps=intl +pm=0 +units=m  no_defs <>
> 
> 
> I define my map thus:
> 	var smproj = new OpenLayers.Projection("EPSG:900913");
> 
> 	mapOptions = {
> 	    projection: smproj,
> 	    units: "m",
> 	    displayProjection: geoproj
> 	};
> 
> 
> my layers thus:
>            var hyblayer = new OpenLayers.Layer.VirtualEarth( ....
> 'sphericalMercator': true});
> 
> 		var pmwms = new OpenLayers.Layer.WMS( .....
>                           {'projection': smproj});
> 
> 
> 
> -- 
> View this message in context: http://www.nabble.com/Conversion-to-Spherical-Mercator---100m-error-tp18898188p18898188.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list