Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to discuss a scenario here to all.

  1. I have developed a Web mapping application in OpenLayers and GeoServer. The customer give us shapefiles with native projection SWREFF99_1330 (EPSG:3008). i published this shapefile on Geoserver after changing its native projection from EPSG:3008 to EPSG:4326 by using ogr2ogr tool. The layer displayed perfectly over Google map layer in my OpenLayers Web Page.

  2. Again, I publish this shapefile on GeoServer with its native projection (this time, without changing projection using ogr2ogr tool) and then i go to my page and figure out that the layer was not visible over Google map layer.

Now, my question to all members:

Is there any way to change the native projection from EPSG:3008 to EPSG:4326 at client side (in my OpenLayers web page code) ? so that the layer should display correctly over google base layer as in case 1.

share|improve this question
The projection can also be done by GeoServer. – Sean Aug 11 '11 at 14:40

You can project in Openlayers like this:

    var map = new OpenLayers.Map("map", {
  projection: new OpenLayers.Projection("EPSG:3008"),
  displayProjection: new OpenLayers.Projection("EPSG:4326")

Proj4js is required to do this on the client side.

share|improve this answer
doesn't OL come bundled with proj4js? – ilia choly Aug 11 '11 at 14:36
OpenLayers integrates with Proj4js if the library is available > – Mapperz Aug 11 '11 at 15:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.