[OpenLayers-Users] wrong displayed projection

Bán Miklós banm at vocs.unideb.hu
Fri Jan 27 01:27:40 EST 2012


Dear all,

I have a problem with projections in wms layers,
I have two wms layers from mapserv and i have two data sources
an shp and a postgis. I produced the postgis table from the shp.
When I load these two layers in qgis, they are overlapping as I
expected, but if you check it here
(http://biomaps.unideb.hu/openlayers/mapserv_test.html) the postgis
layer center is 0,0 while the shp data layer is right.



Where is the error?

Thank you very much, Miklos

The related openlayers js (I willing to use google base layers...)

var options = {
     projection: new OpenLayers.Projection("EPSG:900913"),
     displayProjection: new OpenLayers.Projection("EPSG:4326"),
     units: "m",
     numZoomLevels: 20,
     maxResolution: 156543.0339,
     maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                 20037508, 20037508.34),
};

map = new OpenLayers.Map( 'map',options);
            
layer2 = new OpenLayers.Layer.WMS( "shp", 
                    "http://biomaps.unideb.hu/cgi-bin/mapserv",{
                    map:'/home/banm/maps/minimal.map',layers:'0605',
                    isBaseLayer: false,
                    visibility:true,
                    opacity:1.0,
                    format:'image/png',
                    //transparent:true, 
            });
layer2p = new OpenLayers.Layer.MapServer( "postgis", 
                    "http://biomaps.unideb.hu/cgi-bin/mapserv", {
                    map: '/home/banm/maps/minimalp.map',
                    layers:'cuckoo_feszkek',
                    isBaseLayer: false,
                    visibility:true,
                    opacity:1.0,
                    format:'image/png',
                    transparent:true,
            });



the shp mapfile:
MAP
  NAME "QGIS-MAP"
  SIZE 200 200
  SYMBOLSET ./points.sym
  DEBUG 0
  SHAPEPATH "../SHP/"
  PROJECTION
    "init=epsg:4326"
  END
  WEB
    IMAGEPATH '/tmp/'
    IMAGEURL '/tmp/'
  END
  IMAGEQUALITY 95
  IMAGETYPE agg
  OUTPUTFORMAT
    NAME agg
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END
  LAYER
    name "0605"
    STATUS DEFAULT
    DATA "feszkek.shp"
    TYPE point
    CLASS
        SYMBOL "circle_filled"
        color 123 70 23
        SIZE 6
    END #class
  END
END


The postgis layer:
  layer
    name 'feszkek'
    status default
    type point

    connectiontype postgis
    connection "host=localhost dbname=** password=**
    user=gisadmin" data "the_geom from feszkek"

    class
      SYMBOL "circle_filled"
      color 12 70 23
      SIZE 6
    end
  end




-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Miklós Bán
Behavioural Ecology Research Group
Department of Evolutionary Zoology 
http://vocs.unideb.hu/banm
University of Debrecen
H-4010 Debrecen, Egyetem tér 1.
Phone:  +36 52 512-900 ext. 62356
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Users mailing list