Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to draw a rectangle. The coordinates are somewhere in northern Germany. But the rectangle shows up in the Near East? What am I doing wrong?

       var epsg900913 = new OpenLayers.Projection('EPSG:900913');
       var epsg3035   = new OpenLayers.Projection('EPSG:3035');

       var p11 = new OpenLayers.Geometry.Point(4281000, 3502000).transform(epsg3035, epsg900913);
       var p12 = new OpenLayers.Geometry.Point(4595000, 3502000).transform(epsg3035, epsg900913);
       var p13 = new OpenLayers.Geometry.Point(4595000, 4002000).transform(epsg3035, epsg900913);
       var p14 = new OpenLayers.Geometry.Point(4281000, 4002000).transform(epsg3035, epsg900913);
       var p15 = new OpenLayers.Geometry.Point(4281000, 3502000).transform(epsg3035, epsg900913);
share|improve this question

1 Answer 1

up vote 7 down vote accepted

Alright, I found it out myself. The transformation of EPSG:3035 is not defined by Proj4js, which is used by OpenLayers.

But it is possible to implement it by yourself.

  1. Download proj4js.js
  2. Include proj4js-combined.js to the HTML
  3. Get EPSG code for proj4js: can be found at spatial reference
  4. Define it, in my case it looked like that:

    Proj4js.defs["EPSG:3035"] = "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs";

see also

share|improve this answer
    
+1 for the great solution. –  Dan Feb 21 '13 at 10:17
    
+Very helpful and explained well –  Ferenjito Oct 30 at 13:37
    
In the current version the syntax has changed, you now have to write: proj4.defs("EPSG:3035", "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"); –  nathanvda Dec 14 at 21:40

Your Answer

 
discard

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.