<div dir="ltr">I am not sure this will help or not.... <br><br>I found two epsg files in my /usr/local/share/proj directory: <br><br>epsg <br>EPSG (in caps)<br><br>I modify the values in both the files for my use. You can also try the same <br>
<br>Regards,<br>Ritesh Ambastha<br><br>/usr/local/share/proj/epsg<br><br><div class="gmail_quote">On Thu, Aug 21, 2008 at 5:41 PM, Subha Ramakrishnan <span dir="ltr"><<a href="mailto:subha@gslab.com">subha@gslab.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
Could you also check the map file and tell me if i am making a mistake there?<br>
This is the map file i am using.<div><div></div><div class="Wj3C7c"><br>
MAP<br>
NAME MAP_POINTS<br>
SIZE 725 800<br>
IMAGETYPE PNG<br>
EXTENT 6679169.446666667 -7.081154550627918 11131949.077777777 4865942.278825832<br>
WEB<br>
METADATA<br>
  wms_srs "EPSG:4326 EPSG:900913"<br>
END<br>
END<br>
PROJECTION<br>
"init=epsg:900913"<br>
END<br>
LAYER<br>
CONNECTIONTYPE postgis<br>
NAME indiastates<br>
CONNECTION "user=postgres dbname=test host=localhost"<br>
TYPE POINT<br>
STATUS DEFAULT<br>
#DATA "topology from states"<br>
DATA "topology from india_states using unique id using SRID -1"<br>
CLASS<br>
  COLOR 255 0 0<br>
END<br>
END<br>
END<br>
<br></div></div>
Is it possible for you to share your map file if you have any?<br>
<br>
Regards,<div class="Ih2E3d"><br>
Subha<br>
<br>
Rafael Almeida Fernandez Soto wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
Subha..<br>
<br>
You need to insert a EPSG:900913 description code in PROJ4 config files and a row in spatial_ref_sys table in postgis DB. By default PROJ4 has not a 900013 projection reference.<br>
<br>
Try it!<br>
<br>
Best regards<br>
<br>
Rafael Soto<br>
<br></div>
2008/8/20 Subha Ramakrishnan <<a href="mailto:subha@gslab.com" target="_blank">subha@gslab.com</a> <mailto:<a href="mailto:subha@gslab.com" target="_blank">subha@gslab.com</a>>><div><div></div><div class="Wj3C7c">
<br>
<br>
    Hi :<br>
    We are building a map based web portal using openlayers ,UMN<br>
    mapserver[5.0.2] and postgis DB.We use google as the base map<br>
    through openlayers.We need to overlay our custom layers from the<br>
    db on top of this base map, for that we are using Mapserver (is<br>
    run on a FC7 linux machine). It is observed that by default<br>
    openlayers converts google projection [900913] to EPSG:4326 when<br>
    the base map is fetched.<br>
<br>
    Now when we try to overlay an image that the mapserver generates,<br>
    there is a mismatch on the base map, though mapserver uses<br>
    epsg::4326. After searching over the internet theere seems to be<br>
    only one solution which is displaying the base map itself in<br>
    epsg:900913 and emit the mapserver image also in the same<br>
    projection. The problem is we are not able to generate an image<br>
    through mapserver in epsg::900913.<br>
<br>
    We have taken following measures untill now :<br>
<br>
    1> For using epsg:900913 projection in mapserver, we have added<br>
    following entry in the /usr/local/share/proj/epsg file.[proj<br>
    version 4.6]<br>
     "<900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0<br>
    +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs <>"  2><br>
    We have added following entry in the "in the spatial_ref_sys table<br>
    in postgis DB.<br>
    "900913 ,'EPSG',900913,'GEOGCS["WGS 84", DATUM["World Geodetic<br>
    System 1984", SPHEROID["WGS 84", 6378137.0,<br>
    298.257223563,AUTHORITY["EPSG","7030"]],<br>
    AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich", 0.0,<br>
    AUTHORITY["EPSG","8901"]], UNIT["degree",0.017453292519943295],<br>
    AXIS["Longitude", EAST], AXIS["Latitude",<br>
    NORTH],AUTHORITY["EPSG","4326"]],<br>
    PROJECTION["Mercator_1SP"],PARAMETER["semi_minor", 6378137.0],<br>
    PARAMETER["latitude_of_origin",0.0], PARAMETER["central_meridian",<br>
    0.0], PARAMETER["scale_factor",1.0], PARAMETER["false_easting",<br>
    0.0], PARAMETER["false_northing", 0.0],UNIT["m", 1.0], AXIS["x",<br>
    EAST], AXIS["y", NORTH],AUTHORITY["EPSG","900913"]] |','+proj=merc<br>
    +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0<br>
    +k=1.0 +units=m +nadgrids=@null +no_defs');  The mapfile is as<br>
    follows: (With this, We get a blank image without any exception.)<br>
    MAP<br>
    NAME MAP_POINTS<br>
    SIZE 725 800<br>
    IMAGETYPE PNG<br>
    EXTENT 6679169.446666667 -7.081154550627918 11131949.077777777<br>
    4865942.278825832<br>
    WEB<br>
    METADATA<br>
       wms_srs "EPSG:4326 EPSG:900913"<br>
    END<br>
    END<br>
    PROJECTION<br>
    "init=epsg:900913"<br>
    END<br>
    LAYER<br>
    CONNECTIONTYPE postgis<br>
    NAME indiastates<br>
    CONNECTION "user=postgres dbname=test host=localhost"<br>
    TYPE POINT<br>
    STATUS DEFAULT<br>
    #DATA "topology from states"<br>
    DATA "topology from india_states using unique id using SRID -1"<br>
    CLASS<br>
       COLOR 255 0 0<br>
    END<br>
    END<br>
    END<br>
<br>
    The client (openlayer) code is as follows :<br>
            options = {<br>
                projection: new OpenLayers.Projection("EPSG:900913"),<br>
                displayProjection: new OpenLayers.Projection("EPSG:4326"),<br>
                units: "m",<br>
                maxResolution: 156543.0339,<br>
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,<br>
                                                 20037508, 20037508.34)<br>
            };<br>
             map = new OpenLayers.Map('map', options);<br>
             var gphy = new OpenLayers.Layer.Google("Google<br>
    Physical",{type: G_PHYSICAL_MAP,'sphericalMercator': true});                map.addLayers(gphy);<br>
            var lonLat = new OpenLayers.LonLat(82, 23) ;<br>
               lonLat.transform(map.displayProjection,map.getProjectionObject());<br>
           map.setCenter(lonLat,5);<br>
             var wms ;<br>
           wms = new OpenLayers.Layer.WMS( layername,<br>
          "<a href="http://localhost/cgi-bin/mapserv" target="_blank">http://localhost/cgi-bin/mapserv</a>?",<br>
          { map: 'demo.map',<br>
            projection:"EPSG:900913",<br>
            transparent: 'true', layers: 'indiastates',<br>
            format: 'image/png'},{singleTile: 'true'} );<br>
               map.addLayer(twms1);<br>
<br>
    Can anyone help us in any way?<br>
    Also,<br>
            We have tried overlaying layer fetched from our map server<br>
    on different basemaps from (meta carta and tera pages) and have<br>
    found it overlays perfectly  So clearly there is is problem<br>
    overlaying on google map through openlayers in epsg : 4326.<br>
    Thanks and sorry for the long mail.<br>
    Expecting a reply.<br>
<br>
    Subha.<br>
    _______________________________________________<br>
    mapserver-users mailing list<br>
    <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br></div></div>
    <mailto:<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>><div class="Ih2E3d"><br>
    <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
<br>
<br>
-- <br></div>
RAFAEL Almeida Fernandez Soto :: <a href="mailto:rafael@opengeo.com.br" target="_blank">rafael@opengeo.com.br</a> <mailto:<a href="mailto:rafael@opengeo.com.br" target="_blank">rafael@opengeo.com.br</a>><div class="Ih2E3d">
<br>
Consultant in FOSS GIS :: 55 21 2518-6233 :: 55 71 8802-0600<br></div>
OpenGEO :: On-demand training and solutions :: <a href="http://www.opengeo.com.br" target="_blank">www.opengeo.com.br</a> <<a href="http://www.opengeo.com.br" target="_blank">http://www.opengeo.com.br</a>><br>
GEO Livre community:: Because Geoinformation should be free :: <a href="http://www.geolivre.org.br" target="_blank">www.geolivre.org.br</a> <<a href="http://www.geolivre.org.br" target="_blank">http://www.geolivre.org.br</a>><div class="Ih2E3d">
<br>
Be free by using Free Software, such as MapServer, PostgreSQL/PostGIS, gvSIG...<br>
<br></div><div class="Ih2E3d">
-- <br>
This message has been scanned for viruses and<br>
dangerous content by *MailScanner* <<a href="http://www.mailscanner.info/" target="_blank">http://www.mailscanner.info/</a>>, and is<br>
believed to be clean. <br>
</div></blockquote>
<br>
_______________________________________________<div><div></div><div class="Wj3C7c"><br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br></div>