var bounds = config.init_center.transform( new OpenLayers.Projection("EPSG:31466"), new OpenLayers.Projection("EPSG:3857"));


I have coordinates from a map that uses projection epsg:31466 and want to show then on a map with coordinates epsg:3857.

I would expect that the output of the two console logs given above would turn out to be different, since a transformation took place. However, they do NOT differ. They are exactly the same.

What is wrong with my assumption?

  • Have you defined EPSG:31466 somewhere? Openlayers only knows a few definitions, and needs proj4js for the rest. Not as comfortable as real proj4...
    – AndreJ
    Commented Oct 28, 2014 at 12:31
  • Ah, thank you. What do I need to do in order to get proj4js?
    – Lokomotywa
    Commented Oct 28, 2014 at 12:33
  • Visit proj4js.org. And you have to define the projection 31466.
    – AndreJ
    Commented Oct 28, 2014 at 12:52
  • Ok, but how do I 'define' the projection 31466? The only thing I have found so far is something like this: Proj4js.defs['EPSG:31466'] = '+proj=tmerc +lat_0=0 +lon_0=6+k=1.000000+x_0=2500000 +y_0=0 +ellps=bessel +units=m +nadgrids=@null +no_defs';
    – Lokomotywa
    Commented Oct 28, 2014 at 13:08
  • without any explaination. And this site: svn.osgeo.org/metacrs/proj4js/trunk/lib/defs does not contain any information to 31466.
    – Lokomotywa
    Commented Oct 28, 2014 at 13:09

1 Answer 1


Can you try this (change GeoJSON to the format you want to load.):

vector_format = new OpenLayers.Format.GeoJSON({
    'internalProjection': new OpenLayers.Projection("EPSG:31466"),
    'externalProjection': new OpenLayers.Projection("EPSG:3857")

result = vector_format.read(newFeatures);

This worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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