I have a map with OSM and Google Base layers and EPSG:4326 overlays. Now I am also trying to add overlays with other EPSG's to my map. Overlays which had an EPSG:2333 displayed just fine with no problems. Then I tried to add a layer with EPSG:4008 and nothing showed up. I posted on the openLayers forum and was told to look into the proj4js project (many thanks for that btw!). I have tried using it and it seems promising, but it is just not working for me :(
In my body tag I have the scripts
<script src="./OpenLayers-2.10/OpenLayers.js"></script>
<script src="./proj4js/lib/proj4js-combined.js"></script> //I did also try proj4js.js, but the docs said use this one?
Then I have these before my map and layer declaration, also in the body tag
Ext.onReady(function() {
Proj4js.defs["EPSG:4008"] = "+proj=longlat +ellps=clrk66 +no_defs";
Proj4js.defs["SR-ORG:6627"] = "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs";
Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
...
...
//Map properties
var options = {
controls: [new OpenLayers.Control.Navigation()], //Needed to use GeoExt controls such as the zoomslider
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
units: 'm',
allOverlays: false //Do not display all layers on load
}
var map = new OpenLayers.Map(options);
var borders = new OpenLayers.Layer.WMS(
"Borders", "http://localhost:8080/geoserver/wms", {id: 'borders', layers: 'cite:sedac', transparent: true, projection: new OpenLayers.Projection("EPSG:4008")}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: true}
);
and have also tried this layer config...after reading this post http://getsatisfaction.com/opengeo/topics/reprojecting_in_openlayers
var borders = new OpenLayers.Layer.WMS(
"Borders", "http://localhost:8080/geoserver/wms", {id: 'borders', layers: 'cite:sedac', transparent: true, srsName: 'EPSG:4326'}, {isBaseLayer: false, displayInLayerSwitcher: true, visibility: true}
);
Still nothing shows up :(. Am I doing something wrong? I'm not seeing the error...
Is it even possible to use layers with various projections??? I can't change my map's projection to be 'EPSG:4008' because it will break my other layers, the advice on the docs was to specify the layer's projection, but as my code shows I have tried this with no luck.
I appreciate your time in looking into this matter for me,
elshae
EDIT I have also tried converting the shapefiles with ogr2ogr:
ogr2ogr -s_srs ./SEDAC/tibet.prj -t_srs EPSG:4326 ./SEDAC/new_tibet.shp ./SEDAC/tibet.shp
And get the following error:
ERROR 6: No translation for Lambert_Conformal_Conic to PROJ.4 format is known.
Failed to create coordinate transformation between the
following coordinate systems. This may be because they
are not transformable, or because projection services
(PROJ.4 DLL/.so) could not be loaded.
Source:
PROJCS["Lambert_Conformal_Conic",
GEOGCS["Unknown datum based upon the Clarke 1866 ellipsoid",
DATUM["D_Clarke_1866",
SPHEROID["Clarke_1866",6378206.4,294.9786982139109]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["standard_parallel_1",25],
PARAMETER["standard_parallel_2",47],
PARAMETER["latitude_of_origin",10],
PARAMETER["central_meridian",110],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["METERS",1]]
Target:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.01745329251994328,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]