2. 如果你需要用arcGIS来转换,需要在文件ArcGIS\Coordinate Systems\Projected Coordinate Systems\world里添加文件 Google Mercator (world).prj. 我自己写的内容为:
PROJCS[”Google_Mercator”,GEOGCS[”GCS_WGS_1984″,
DATUM[”D_WGS_1984″,SPHEROID[”WGS_1984″,6378137,0]],
PRIMEM[”Greenwich”,0],UNIT[”Degree”,0.017453292519943295]],
PROJECTION[”Mercator”],PARAMETER[”False_Easting”,0],PARAMETER[”False_Northing”,0],
PARAMETER[”Central_Meridian”,0],PARAMETER[”Standard_Parallel_1″,0],UNIT[”Meter”,1]]
PS. EPSG: 900913 为横轴墨卡托投影。它和EPSG:3395非常类似,只是没有扁率298. 257223563。也就是说他不是一个椭球。还有一点需要注意,Google 投影用的是Mercator——2SP该投影在acrGIS以及proj4里均没有定义。所以要做一些转换。
如果您对地图投影,墨卡托投影,特别是WebGIS里面的使用情况有疑惑,请参考如下的文献:
http://www.spatialreference.org/ref/user/google-projection/
http://jira.codehaus.org/browse/GEOT-1511
http://spatialreference.org/ref/user/6/
http://www.ibm.com/developerworks/cn/java/j-coordconvert/#resources
http://www.sharpgis.net/2007/05/05/SpatialReferencesCoordinate
SystemsProjectionsDatumsEllipsoidsConfusing.aspx
code:
在html中:
var lon = 4174203.107;
var lat = 3556972.005;
var zoom = 5;
var options = { maxExtent: new OpenLayers.Bounds(7765266.742441,429318.305045,16113672.956358,7543262.315404),
maxResolution: 16543,
projection: "EPSG:900913",
units: "km",
numZoomLevels: 7};
map = new OpenLayers.Map('map', options);
layer = new OpenLayers.Layer.MapServer( "CHGIS MapServer", "/cgi-bin/mapserv.exe?map=/ms4w/apache/htdocs/buddhist/google.map&layers=PII_google",
{layers: 'basic'},
{opacity:0.5, isBaseLayer:false});
map.addLayer(layer);
satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP,
'maxZoomLevel':18, 'sphericalMercator': true} );
map.addLayers([satellite]);
在map文件中:
MAP
IMAGETYPE PNG
# EXTENT 72.9958 17.9958 136.0042 54.0042
EXTENT 7765266.742441 429318.305045 16113672.956358 7543262.315404
SIZE 1200 800
SHAPEPATH "data"
IMAGECOLOR 234 255 255
TRANSPARENT ON
FONTSET "fonts/fonts.list"
SYMBOLSET "symbols/symbols.sym"
PROJECTION
# "+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"
"init=epsg:900913"
END
#定义图层LAYERS
END
from:http://www.geoinformatics.cn/?p=563