Re: [mapserver-users] Using mapserver with EPSG:900913

2008-08-26 Thread nbest


Does anyone have some JS that overlays a WMS serving EPSG:900913 images
through the GMap API?

I am aware of the tile mode available in MS 5.2 but at the moment I would
have to break up with FWTools and I am hesitant to tinker with my server in
that way.  I took the projection description from
http://spatialreference.org/ref/user/google-projection/ (which appears to be
functionally equivalent the definition in the RFC 43 patch) and added it to
the epsg file as 900913.  I found some JS examples such as
http://gapanalysis.nbii.gov/files/gmaps/gmap_WMS.html and
http://lyceum.massgis.state.ma.us/wiki/doku.php?id=googlemaps:home that
appear to connect to WMSs that are serving images not in the Google
projection and doing some adjustments to the bounding box coordinates. 
Using those JS scripts appears to introduce a north-south shift but I don't
know if that's coming from the JS or a server-side proj problem.  Does
anyone have any lat-lon, 900913 x-y coordinate pairs that I could use to
test in proj?  spatialreference.org can't seem to do it right now.  Thanks.

Neil

-- 
View this message in context: 
http://n2.nabble.com/Re%3A-Using-mapserver-with-EPSG%3A900913-tp738215p785077.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Using mapserver with EPSG:900913

2008-08-26 Thread Christopher Schmidt
On Tue, Aug 26, 2008 at 12:32:47PM -0700, nbest wrote:
 
 
 Does anyone have some JS that overlays a WMS serving EPSG:900913 images
 through the GMap API?

I've always just done this with TileCache:

http://crschmidt.net/blog/311/using-tilecache-with-google-maps-and-virtual-earth/

Do you really need WMS? It's possible, but I'd have to write some code,
and I'm very lazy :)

 Does anyone have any lat-lon, 900913 x-y coordinate pairs that I could
 use to test in proj?  spatialreference.org can't seem to do it right
 now.  Thanks.

Open any modern OpenLayers page.

Open Firebug. (Or just open
http://openlayers.org/dev/examples/debug.html , which has firebug lite.)

Type the following:

 new OpenLayers.LonLat(-71,42).transform(new
  OpenLayers.Projection(EPSG:4326), new
  OpenLayers.Projection(EPSG:900913));

Get result:
lon=-7903683.84523,lat=5160979.443331368

Regards,
-- 
Christopher Schmidt
MetaCarta
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Using mapserver with EPSG:900913

2008-08-26 Thread Richard Greenwood
On Tue, Aug 26, 2008 at 6:16 PM, Christopher Schmidt
[EMAIL PROTECTED] wrote:
 On Tue, Aug 26, 2008 at 05:21:48PM -0600, Richard Greenwood wrote:
  Type the following:
 
   new OpenLayers.LonLat(-71,42).transform(new
   OpenLayers.Projection(EPSG:4326), new
   OpenLayers.Projection(EPSG:900913));

 I know I'll get slammed for this, but it should be something more like:

 new OpenLayers.LonLat(-71,42).transform(new
 OpenLayers.CS(EPSG:4326), new
 OpenLayers.CS(EPSG:900913));

 Because EPSG:4326 is not a Projection, it is a Coordinate System.

 I don't mind you saying that, but the user should realize that when you
 say Should Be you're not not instructing what he should actually be
 doing in his current code, since the OpenLayers Library uses
 OpenLayers.Projection, not OpenLayers.CS.

Yes, you are quite right about that. I did not mean to imply that
OpenLayers.CS worked, I was picking at nomenclature.

 I'd recommend if you care about this issue, you should bring it up with
 the OpenLayers development list, but I wouldn't bother; getting people
 to undestand Projection is hard enough. (ANd why should it be CS
 instead of CRS? or SRS? Or any number of other names that it could be
 related to?)

CS, CRS, SRS are all great - they cover spherical  projected
coordinate systems, and include datums. Projections are just
projections w/o datums.

-- 
Richard Greenwood
[EMAIL PROTECTED]
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Using mapserver with EPSG:900913

2008-08-21 Thread Subha Ramakrishnan

Hi,
Could you also check the map file and tell me if i am making a mistake 
there?

This is the map file i am using.
MAP
NAME MAP_POINTS
SIZE 725 800
IMAGETYPE PNG
EXTENT 6679169.44667 -7.081154550627918 11131949.0 
4865942.278825832

WEB
METADATA
  wms_srs EPSG:4326 EPSG:900913
END
END
PROJECTION
init=epsg:900913
END
LAYER
CONNECTIONTYPE postgis
NAME indiastates
CONNECTION user=postgres dbname=test host=localhost
TYPE POINT
STATUS DEFAULT
#DATA topology from states
DATA topology from india_states using unique id using SRID -1
CLASS
  COLOR 255 0 0
END
END
END

Is it possible for you to share your map file if you have any?

Regards,
Subha

Rafael Almeida Fernandez Soto wrote:

Subha..

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.


Try it!

Best regards

Rafael Soto

2008/8/20 Subha Ramakrishnan [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

Hi :
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.

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.

We have taken following measures untill now :

1 For using epsg:900913 projection in mapserver, we have added
following entry in the /usr/local/share/proj/epsg file.[proj
version 4.6]
 900913 +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 [EMAIL PROTECTED] +no_defs   2
We have added following entry in the in the spatial_ref_sys table
in postgis DB.
900913 ,'EPSG',900913,'GEOGCS[WGS 84, DATUM[World Geodetic
System 1984, SPHEROID[WGS 84, 6378137.0,
298.257223563,AUTHORITY[EPSG,7030]],
AUTHORITY[EPSG,6326]],PRIMEM[Greenwich, 0.0,
AUTHORITY[EPSG,8901]], UNIT[degree,0.017453292519943295],
AXIS[Longitude, EAST], AXIS[Latitude,
NORTH],AUTHORITY[EPSG,4326]],
PROJECTION[Mercator_1SP],PARAMETER[semi_minor, 6378137.0],
PARAMETER[latitude_of_origin,0.0], PARAMETER[central_meridian,
0.0], PARAMETER[scale_factor,1.0], PARAMETER[false_easting,
0.0], PARAMETER[false_northing, 0.0],UNIT[m, 1.0], AXIS[x,
EAST], AXIS[y, NORTH],AUTHORITY[EPSG,900913]] |','+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 [EMAIL PROTECTED] +no_defs');  The mapfile is as
follows: (With this, We get a blank image without any exception.)
MAP
NAME MAP_POINTS
SIZE 725 800
IMAGETYPE PNG
EXTENT 6679169.44667 -7.081154550627918 11131949.0
4865942.278825832
WEB
METADATA
   wms_srs EPSG:4326 EPSG:900913
END
END
PROJECTION
init=epsg:900913
END
LAYER
CONNECTIONTYPE postgis
NAME indiastates
CONNECTION user=postgres dbname=test host=localhost
TYPE POINT
STATUS DEFAULT
#DATA topology from states
DATA topology from india_states using unique id using SRID -1
CLASS
   COLOR 255 0 0
END
END
END

The client (openlayer) code is as follows :
options = {
projection: new OpenLayers.Projection(EPSG:900913),
displayProjection: new OpenLayers.Projection(EPSG:4326),
units: m,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
 20037508, 20037508.34)
};
 map = new OpenLayers.Map('map', options);
 var gphy = new OpenLayers.Layer.Google(Google
Physical,{type: G_PHYSICAL_MAP,'sphericalMercator': true});  
  map.addLayers(gphy);

var lonLat = new OpenLayers.LonLat(82, 23) ;
   
lonLat.transform(map.displayProjection,map.getProjectionObject());

   map.setCenter(lonLat,5);
 var wms ;
   wms = new OpenLayers.Layer.WMS( layername,
  http://localhost/cgi-bin/mapserv?;,
  { map: 'demo.map',
projection:EPSG:900913,
transparent: 'true', layers: 'indiastates',
format: 'image/png'},{singleTile: 'true'} );
   map.addLayer(twms1);

Can anyone help us in any way?
Also,
We have tried overlaying layer 

Re: [mapserver-users] Using mapserver with EPSG:900913

2008-08-21 Thread ritesh ambastha
I am not sure this will help or not

I found two epsg files in my /usr/local/share/proj directory:

epsg
EPSG (in caps)

I modify the values in both the files for my use. You can also try the same

Regards,
Ritesh Ambastha

/usr/local/share/proj/epsg

On Thu, Aug 21, 2008 at 5:41 PM, Subha Ramakrishnan [EMAIL PROTECTED] wrote:

 Hi,
 Could you also check the map file and tell me if i am making a mistake
 there?
 This is the map file i am using.

 MAP
 NAME MAP_POINTS
 SIZE 725 800
 IMAGETYPE PNG
 EXTENT 6679169.44667 -7.081154550627918 11131949.0
 4865942.278825832
 WEB
 METADATA
  wms_srs EPSG:4326 EPSG:900913
 END
 END
 PROJECTION
 init=epsg:900913
 END
 LAYER
 CONNECTIONTYPE postgis
 NAME indiastates
 CONNECTION user=postgres dbname=test host=localhost
 TYPE POINT
 STATUS DEFAULT
 #DATA topology from states
 DATA topology from india_states using unique id using SRID -1
 CLASS
  COLOR 255 0 0
 END
 END
 END

 Is it possible for you to share your map file if you have any?

 Regards,
 Subha

 Rafael Almeida Fernandez Soto wrote:

 Subha..

 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.

 Try it!

 Best regards

 Rafael Soto

 2008/8/20 Subha Ramakrishnan [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]


Hi :
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.

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.

We have taken following measures untill now :

1 For using epsg:900913 projection in mapserver, we have added
following entry in the /usr/local/share/proj/epsg file.[proj
version 4.6]
 900913 +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 [EMAIL PROTECTED] +no_defs   2
We have added following entry in the in the spatial_ref_sys table
in postgis DB.
900913 ,'EPSG',900913,'GEOGCS[WGS 84, DATUM[World Geodetic
System 1984, SPHEROID[WGS 84, 6378137.0,
298.257223563,AUTHORITY[EPSG,7030]],
AUTHORITY[EPSG,6326]],PRIMEM[Greenwich, 0.0,
AUTHORITY[EPSG,8901]], UNIT[degree,0.017453292519943295],
AXIS[Longitude, EAST], AXIS[Latitude,
NORTH],AUTHORITY[EPSG,4326]],
PROJECTION[Mercator_1SP],PARAMETER[semi_minor, 6378137.0],
PARAMETER[latitude_of_origin,0.0], PARAMETER[central_meridian,
0.0], PARAMETER[scale_factor,1.0], PARAMETER[false_easting,
0.0], PARAMETER[false_northing, 0.0],UNIT[m, 1.0], AXIS[x,
EAST], AXIS[y, NORTH],AUTHORITY[EPSG,900913]] |','+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 [EMAIL PROTECTED] +no_defs');  The mapfile is as
follows: (With this, We get a blank image without any exception.)
MAP
NAME MAP_POINTS
SIZE 725 800
IMAGETYPE PNG
EXTENT 6679169.44667 -7.081154550627918 11131949.0
4865942.278825832
WEB
METADATA
   wms_srs EPSG:4326 EPSG:900913
END
END
PROJECTION
init=epsg:900913
END
LAYER
CONNECTIONTYPE postgis
NAME indiastates
CONNECTION user=postgres dbname=test host=localhost
TYPE POINT
STATUS DEFAULT
#DATA topology from states
DATA topology from india_states using unique id using SRID -1
CLASS
   COLOR 255 0 0
END
END
END

The client (openlayer) code is as follows :
options = {
projection: new OpenLayers.Projection(EPSG:900913),
displayProjection: new OpenLayers.Projection(EPSG:4326),
units: m,
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
 20037508, 20037508.34)
};
 map = new OpenLayers.Map('map', options);
 var gphy = new OpenLayers.Layer.Google(Google
Physical,{type: G_PHYSICAL_MAP,'sphericalMercator': true});
  map.addLayers(gphy);
var lonLat = new OpenLayers.LonLat(82, 23) ;

  lonLat.transform(map.displayProjection,map.getProjectionObject());
   map.setCenter(lonLat,5);
 var wms ;
   wms = new OpenLayers.Layer.WMS( layername,