<div dir="ltr">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 class="gmail_quote">2008/8/20 Subha Ramakrishnan <span dir="ltr">&lt;<a href="mailto:subha@gslab.com">subha@gslab.com</a>&gt;</span><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>
We are building a map based web portal using openlayers ,UMN mapserver[5.0.2] and postgis DB.We use google as the base map through openlayers.We need to overlay our custom layers from the db on top of this base map, for that we are using Mapserver (is run on a FC7 linux machine). It is observed that by default openlayers converts google projection [900913] to EPSG:4326 when the base map is fetched.<br>

<br>
Now when we try to overlay an image that the mapserver generates, there is a mismatch on the base map, though mapserver uses epsg::4326. After searching over the internet theere seems to be only one solution which is displaying the base map itself in epsg:900913 and emit the mapserver image also in the same projection. The problem is we are not able to generate an image through mapserver in epsg::900913.<br>

<br>
We have taken following measures untill now :<br>
<br>
1&gt; For using epsg:900913 projection in mapserver, we have added following entry in the /usr/local/share/proj/epsg file.[proj version 4.6]<br>
&nbsp;&quot;&lt;900913&gt; +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs &lt;&gt;&quot; &nbsp;2&gt; We have added following entry in the &quot;in the spatial_ref_sys table in postgis DB.<br>

&quot;900913 ,&#39;EPSG&#39;,900913,&#39;GEOGCS[&quot;WGS 84&quot;, DATUM[&quot;World Geodetic System 1984&quot;, SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]], AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]], UNIT[&quot;degree&quot;,0.017453292519943295], AXIS[&quot;Longitude&quot;, EAST], AXIS[&quot;Latitude&quot;, NORTH],AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]], PROJECTION[&quot;Mercator_1SP&quot;],PARAMETER[&quot;semi_minor&quot;, 6378137.0], PARAMETER[&quot;latitude_of_origin&quot;,0.0], PARAMETER[&quot;central_meridian&quot;, 0.0], PARAMETER[&quot;scale_factor&quot;,1.0], PARAMETER[&quot;false_easting&quot;, 0.0], PARAMETER[&quot;false_northing&quot;, 0.0],UNIT[&quot;m&quot;, 1.0], AXIS[&quot;x&quot;, EAST], AXIS[&quot;y&quot;, NORTH],AUTHORITY[&quot;EPSG&quot;,&quot;900913&quot;]] |&#39;,&#39;+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs&#39;); &nbsp;The mapfile is as 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 4865942.278825832<br>
WEB<br>
METADATA<br>
 &nbsp; &nbsp;wms_srs &quot;EPSG:4326 EPSG:900913&quot;<br>
END<br>
END<br>
PROJECTION<br>
&quot;init=epsg:900913&quot;<br>
END<br>
LAYER<br>
CONNECTIONTYPE postgis<br>
NAME indiastates<br>
CONNECTION &quot;user=postgres dbname=test host=localhost&quot;<br>
TYPE POINT<br>
STATUS DEFAULT<br>
#DATA &quot;topology from states&quot;<br>
DATA &quot;topology from india_states using unique id using SRID -1&quot;<br>
CLASS<br>
 &nbsp; &nbsp;COLOR 255 0 0<br>
END<br>
END<br>
END<br>
<br>
The client (openlayer) code is as follows :<br>
 &nbsp; &nbsp; &nbsp; &nbsp; options = {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; units: &quot;m&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxResolution: 156543.0339,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxExtent: new OpenLayers.Bounds(-20037508, -20037508,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20037508, 20037508.34)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; };<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;map = new OpenLayers.Map(&#39;map&#39;, options);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var gphy = new OpenLayers.Layer.Google(&quot;Google Physical&quot;,{type: G_PHYSICAL_MAP,&#39;sphericalMercator&#39;: true}); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.addLayers(gphy);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; var lonLat = new OpenLayers.LonLat(82, 23) ;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; lonLat.transform(map.displayProjection,map.getProjectionObject());<br>
 &nbsp; &nbsp; &nbsp; &nbsp;map.setCenter(lonLat,5);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var wms ;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;wms = new OpenLayers.Layer.WMS( layername,<br>
 &nbsp; &nbsp; &nbsp; &quot;<a href="http://localhost/cgi-bin/mapserv" target="_blank">http://localhost/cgi-bin/mapserv</a>?&quot;,<br>
 &nbsp; &nbsp; &nbsp; { map: &#39;demo.map&#39;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; projection:&quot;EPSG:900913&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; transparent: &#39;true&#39;, layers: &#39;indiastates&#39;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; format: &#39;image/png&#39;},{singleTile: &#39;true&#39;} );<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;map.addLayer(twms1);<br>
<br>
Can anyone help us in any way?<br>
Also,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; We have tried overlaying layer fetched from our map server on different basemaps from (meta carta and tera pages) and have found it overlays perfectly &nbsp;So clearly there is is problem 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>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>RAFAEL Almeida Fernandez Soto :: <a href="mailto:rafael@opengeo.com.br">rafael@opengeo.com.br</a><br>Consultant in FOSS GIS :: 55 21 2518-6233 :: 55 71 8802-0600<br>OpenGEO :: On-demand training and solutions :: <a href="http://www.opengeo.com.br">www.opengeo.com.br</a><br>
GEO Livre community:: Because Geoinformation should be free :: <a href="http://www.geolivre.org.br">www.geolivre.org.br</a><br>Be free by using Free Software, such as MapServer, PostgreSQL/PostGIS, gvSIG...<br>
</div>