RE: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Monier Clement

Thanks for your answers Roger  Pietro.

I've followed your advice by trying these 4 test-cases :

1) 
Map proj set to :   init=epsg:3785 (web spherical Mercator, manually added
into espg file)
Layer proj set to : init=epsg:4326 (latlon wgs84, proj system of my
shapefiles)

= got a blank map

2) 
Map projection set to : init=epsg:4326
Layer projection set to : init=epsg:4326

= got a map

3)
Map projection set to : init=epsg:3785
Layer projection set to : init=epsg:3785

= got the same map as 2)

4) 
Map projection set to : init=epsg:4326
Layer projection set to : init=epsg:3785

= got a blank map

I've also tried with another well-known existing epsg proj-system (instead
of the manually-added 3785 code), but got the same results.
I've made other attempts by replacing init=3785 by full description
proj-string like +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs  no_defs
or +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
But it didn't change anything...

It seems that :
- a map is drawn only if the map's and layer's proj-systems are the same.
- the output projection is always overridden by the shapefile system, no
re-projection is done anyway.

Let me know if you have any further leads to solve this issue.

Thanks for your help

Clément 

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Pietro
Giannini
Envoyé : vendredi 24 octobre 2008 21:40
À : mapserver-users@lists.osgeo.org
Objet : Re: [mapserver-users] projection = geographer's pain

I can confirm that projection is often a pain!

However, the problem may be in the projection of the layer.

The PROJECTION section in a layer declare the projection of the data
source of this layer, while the PROJECTION on the map level is the
projection wich you want to show the whole map. So you can overlay more
data sources in different projection in a single map.

Try to set the layer PROJECTION as init=epsg:4326.
Let us know...
ciao
... pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
 Hi,



 I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.

 My datasource is shapefiles with WGS84 projection (epsg:4326).

 I would like MapServer to render these data into a Web (spherical)
 Mercator projected map (epsg:3785) in order to perfectly overlay the
 GoogleMaps tile images (for the moment, my maps are slightly shifted
 north.)



 I've added this string at the end of the file epsg in /ms4w/proj/nad :

 3785 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
 +y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m [EMAIL PROTECTED] +no_defs 



 But I don't know how to modify my request and mapfile in order to get the
 correct map.

 I've tried many combinations so far but with no success until now.



 Do I have to change the projection system of my shapefiles ?

 Is MapServer able to change projection between input and output ?



 Request : SRS=epsg:3785



 MapFile :



 [Map section]

   METADATA

 wms_srs   EPSG:4326 EPSG:3785 # is this correct ?

   END



 PROJECTION

init=epsg:3785 # is this correct ?

 END



 [Layer section]

   METADATA

 wms_srs   EPSG:3785 # is this correct ?

   END

   PROJECTION

init=epsg:3785 # is this correct ?

   END



 With these settings, the pictures I got from MapServer are still shifted.



 Thanks for your help



 Clement



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



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

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


Re: VS: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Pietro Giannini
there is something strange... :-)

I normally project data in lat-lon wgs84 coordinates in world mercator.

I declare latlon wgs as
epsg:4326
or
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
and world mercator as
+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84
+datum=WGS84 +units=m +no_defs
(http://spatialreference.org/ref/epsg/3395/)

You use another declaration, that is the google mercator
(http://spatialreference.org/ref/user/google-projection/) that is slightly
different... I don't know well Proj4, but I believe that this is not the
core of the problem...

I know (maybe I do not know well) that the projection of the map is
different from the projection of the layer bcause the layer data source
(shapefile, postgis...) can be data with coordinates referred to a spatial
reference which can be different from the spatial reference of the map.

This allow mapserver to combine data coming from different source in a
single map.

If not declared, the LAYER inherits the PROJECTION of the map.

So, if yo have data in a projection and you want to project them in
another, all you have to do is correctly declare both PROJECTION section:
in the MAP and in LAYER.

obviously you must to set correctly the EXTENT and the UNIT of the MAP,
according to the PROJECTION of MAP, otherwise you will obtain a wrong part
of the map from the mapserver.
e.g.: if you have a PROJECTION latlon wgs84 the extent of the entire world
is -180 -90 180 90 and units is DD, if the projection is world
mercator the extent is -2000 -2000 2000 2000 (from my
experience!) and units is meters.

( If someone can explain me the difference from world mercator and google
mercator, and more generally can explain the parameters of proj4, I'll be
eternally grateful! )

Hope this help
pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E



On Lun, Ottobre 27, 2008 12:46, Rahkonen Jukka wrote:
 Hi,

 Have you double-checked that your map extent correspods with the map
 projection?
 Or if you could send your whole mapfile I am pretty sure that you will get
 a final answer to your problem.

 -Jukka Rahkonen-

 -Alkuperäinen viesti-
 Lähettäjä: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Puolesta
 Monier Clement
 Lähetetty: 27. lokakuuta 2008 13:39
 Vastaanottaja: 'Pietro Giannini'; mapserver-users@lists.osgeo.org
 Aihe: RE: [mapserver-users] projection = geographer's pain


 Thanks for your answers Roger  Pietro.

 I've followed your advice by trying these 4 test-cases :

 1)
 Map proj set to :   init=epsg:3785 (web spherical Mercator,
 manually added
 into espg file)
 Layer proj set to : init=epsg:4326 (latlon wgs84, proj system of my
 shapefiles)

 = got a blank map

 2)
 Map projection set to : init=epsg:4326
 Layer projection set to : init=epsg:4326

 = got a map

 3)
 Map projection set to : init=epsg:3785
 Layer projection set to : init=epsg:3785

 = got the same map as 2)

 4)
 Map projection set to : init=epsg:4326
 Layer projection set to : init=epsg:3785

 = got a blank map

 I've also tried with another well-known existing epsg
 proj-system (instead of the manually-added 3785 code), but
 got the same results.
 I've made other attempts by replacing init=3785 by full
 description proj-string like +proj=longlat +ellps=WGS84
 +datum=WGS84 +no_defs  no_defs
 or +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
 But it didn't change anything...

 It seems that :
 - a map is drawn only if the map's and layer's proj-systems
 are the same.
 - the output projection is always overridden by the shapefile
 system, no re-projection is done anyway.

 Let me know if you have any further leads to solve this issue.

 Thanks for your help

 Clément

 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] De la part
 de Pietro Giannini Envoyé : vendredi 24 octobre 2008 21:40 À 
 : mapserver-users@lists.osgeo.org Objet : Re:
 [mapserver-users] projection = geographer's pain

 I can confirm that projection is often a pain!

 However, the problem may be in the projection of the layer.

 The PROJECTION section in a layer declare the projection of
 the data source of this layer, while the PROJECTION on the
 map level is the projection wich you want to show the whole
 map. So you can overlay more data sources in different
 projection in a single map.

 Try to set the layer PROJECTION as init=epsg:4326.
 Let us know...
 ciao
 ... pg


 --
 Pietro Giannini
 Bytewise srl - Area GIS
 41°50'38.58N 12°29'13.39E




 On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
  Hi,
 
 
 
  I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.
 
  My datasource is shapefiles with WGS84 projection (epsg:4326).
 
  I would like MapServer to render these data into a Web (spherical)
  Mercator projected map (epsg:3785) in order to perfectly

Re: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Rahkonen Jukka
Monier Clement wrote:

Hi, 

There is bigger than tiny difference in extents in epsg:4326 and in epsg:3785.  
The latter is using meters as an unit.
I had a try with Finland polygon and here are the results:

D:\TEMPogrinfo -summary Finland_WGS84.shp Finland_WGS84
Feature Count: 1
Extent: (19.648331, 59.804989) - (31.587299, 70.079422)

D:\TEMPogr2ogr -f ESRI Shapefile -s_srs epsg:4326 -t_srs epsg:900913 Finland_
Spherical.shp Finland_WGS84.shp

D:\TEMPogrinfo -summary Finland_Spherical.shp Finland_Spherical
Feature Count: 1
Extent: (2187242.167179, 8356448.200347) - (3516282.078834, 11094615.004724)

-Jukka-


 Hi,
 
 I got the map extent from shpinfo. 
 Beside, I know that there should only be a tiny difference 
 between coordinates in latlon-wgs84 (data proj) and web 
 spherical mercator (map proj).
 
 You'll find the whole test-case files as attachement.
 
 Here's the command line to get the map :
 C:\ms4w\tools\mapserv\shp2img -m 
 C:\ms4w\apps\gmap\htdocs\test.map -o test.png -l layer1 -i agga
 
 Thanks
 
 Clément   
 
 
 -Message d'origine-
 De : Rahkonen Jukka [mailto:[EMAIL PROTECTED]
 Envoyé : lundi 27 octobre 2008 12:46
 À : Monier Clement; mapserver-users@lists.osgeo.org Objet : 
 VS: [mapserver-users] projection = geographer's pain
 
 Hi,
 
 Have you double-checked that your map extent correspods with 
 the map projection?
 Or if you could send your whole mapfile I am pretty sure that 
 you will get a final answer to your problem.
 
 -Jukka Rahkonen-
 
  -Alkuperäinen viesti-
  Lähettäjä: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Puolesta Monier 
  Clement
  Lähetetty: 27. lokakuuta 2008 13:39
  Vastaanottaja: 'Pietro Giannini'; mapserver-users@lists.osgeo.org
  Aihe: RE: [mapserver-users] projection = geographer's pain
  
  
  Thanks for your answers Roger  Pietro.
  
  I've followed your advice by trying these 4 test-cases :
  
  1) 
  Map proj set to :   init=epsg:3785 (web spherical Mercator, 
  manually added
  into espg file)
  Layer proj set to : init=epsg:4326 (latlon wgs84, proj 
 system of my
  shapefiles)
  
  = got a blank map
  
  2)
  Map projection set to : init=epsg:4326
  Layer projection set to : init=epsg:4326
  
  = got a map
  
  3)
  Map projection set to : init=epsg:3785
  Layer projection set to : init=epsg:3785
  
  = got the same map as 2)
  
  4)
  Map projection set to : init=epsg:4326
  Layer projection set to : init=epsg:3785
  
  = got a blank map
  
  I've also tried with another well-known existing epsg proj-system 
  (instead of the manually-added 3785 code), but got the same results.
  I've made other attempts by replacing init=3785 by full 
 description 
  proj-string like +proj=longlat +ellps=WGS84
  +datum=WGS84 +no_defs  no_defs
  or +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
  But it didn't change anything...
  
  It seems that :
  - a map is drawn only if the map's and layer's proj-systems are the 
  same.
  - the output projection is always overridden by the 
 shapefile system, 
  no re-projection is done anyway.
  
  Let me know if you have any further leads to solve this issue.
  
  Thanks for your help
  
  Clément 
  
  -Message d'origine-
  De : [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] De la part 
 de Pietro 
  Giannini Envoyé : vendredi 24 octobre 2008 21:40 À
  : mapserver-users@lists.osgeo.org Objet : Re: 
  [mapserver-users] projection = geographer's pain
  
  I can confirm that projection is often a pain!
  
  However, the problem may be in the projection of the layer.
  
  The PROJECTION section in a layer declare the projection of 
 the data 
  source of this layer, while the PROJECTION on the map level is the 
  projection wich you want to show the whole map. So you can overlay 
  more data sources in different projection in a single map.
  
  Try to set the layer PROJECTION as init=epsg:4326.
  Let us know...
  ciao
  ... pg
  
  
  --
  Pietro Giannini
  Bytewise srl - Area GIS
  41°50'38.58N 12°29'13.39E
  
  
  
  
  On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
   Hi,
  
  
  
   I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.
  
   My datasource is shapefiles with WGS84 projection (epsg:4326).
  
   I would like MapServer to render these data into a Web 
 (spherical) 
   Mercator projected map (epsg:3785) in order to perfectly
  overlay the
   GoogleMaps tile images (for the moment, my maps are 
 slightly shifted
   north.)
  
  
  
   I've added this string at the end of the file epsg in
  /ms4w/proj/nad :
  
   3785 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
  +lon_0=0.0 +x_0=0.0
   +y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m
  [EMAIL PROTECTED] +no_defs 
  
  
  
   But I don't know how to modify my request and mapfile in
  order to get the
   correct map.
  
   I've tried many combinations so far but with no success until now.
  
  
  
   Do I have to change

RE: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Monier Clement

Of course !
You're right, that's why it didn't work.
The bbox/extent should be in the same projection than the output system.
Thanks for all Jukka  Pietro !

I'll now try to figure out why GoogleMaps supplies some PixelToLongLat
function to their Tile Overlay system, if longlat don't fit their actual
projection system !

Clément 


-Message d'origine-
De : Rahkonen Jukka [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 27 octobre 2008 15:19
À : Monier Clement; mapserver-users@lists.osgeo.org
Objet : Re: [mapserver-users] projection = geographer's pain

Monier Clement wrote:

Hi, 

There is bigger than tiny difference in extents in epsg:4326 and in
epsg:3785.  The latter is using meters as an unit.
I had a try with Finland polygon and here are the results:

D:\TEMPogrinfo -summary Finland_WGS84.shp Finland_WGS84
Feature Count: 1
Extent: (19.648331, 59.804989) - (31.587299, 70.079422)

D:\TEMPogr2ogr -f ESRI Shapefile -s_srs epsg:4326 -t_srs epsg:900913
Finland_
Spherical.shp Finland_WGS84.shp

D:\TEMPogrinfo -summary Finland_Spherical.shp Finland_Spherical
Feature Count: 1
Extent: (2187242.167179, 8356448.200347) - (3516282.078834, 11094615.004724)

-Jukka-


 Hi,
 
 I got the map extent from shpinfo. 
 Beside, I know that there should only be a tiny difference 
 between coordinates in latlon-wgs84 (data proj) and web 
 spherical mercator (map proj).
 
 You'll find the whole test-case files as attachement.
 
 Here's the command line to get the map :
 C:\ms4w\tools\mapserv\shp2img -m 
 C:\ms4w\apps\gmap\htdocs\test.map -o test.png -l layer1 -i agga
 
 Thanks
 
 Clément   
 
 
 -Message d'origine-
 De : Rahkonen Jukka [mailto:[EMAIL PROTECTED]
 Envoyé : lundi 27 octobre 2008 12:46
 À : Monier Clement; mapserver-users@lists.osgeo.org Objet : 
 VS: [mapserver-users] projection = geographer's pain
 
 Hi,
 
 Have you double-checked that your map extent correspods with 
 the map projection?
 Or if you could send your whole mapfile I am pretty sure that 
 you will get a final answer to your problem.
 
 -Jukka Rahkonen-
 
  -Alkuperäinen viesti-
  Lähettäjä: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Puolesta Monier 
  Clement
  Lähetetty: 27. lokakuuta 2008 13:39
  Vastaanottaja: 'Pietro Giannini'; mapserver-users@lists.osgeo.org
  Aihe: RE: [mapserver-users] projection = geographer's pain
  
  
  Thanks for your answers Roger  Pietro.
  
  I've followed your advice by trying these 4 test-cases :
  
  1) 
  Map proj set to :   init=epsg:3785 (web spherical Mercator, 
  manually added
  into espg file)
  Layer proj set to : init=epsg:4326 (latlon wgs84, proj 
 system of my
  shapefiles)
  
  = got a blank map
  
  2)
  Map projection set to : init=epsg:4326
  Layer projection set to : init=epsg:4326
  
  = got a map
  
  3)
  Map projection set to : init=epsg:3785
  Layer projection set to : init=epsg:3785
  
  = got the same map as 2)
  
  4)
  Map projection set to : init=epsg:4326
  Layer projection set to : init=epsg:3785
  
  = got a blank map
  
  I've also tried with another well-known existing epsg proj-system 
  (instead of the manually-added 3785 code), but got the same results.
  I've made other attempts by replacing init=3785 by full 
 description 
  proj-string like +proj=longlat +ellps=WGS84
  +datum=WGS84 +no_defs  no_defs
  or +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
  But it didn't change anything...
  
  It seems that :
  - a map is drawn only if the map's and layer's proj-systems are the 
  same.
  - the output projection is always overridden by the 
 shapefile system, 
  no re-projection is done anyway.
  
  Let me know if you have any further leads to solve this issue.
  
  Thanks for your help
  
  Clément 
  
  -Message d'origine-
  De : [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] De la part 
 de Pietro 
  Giannini Envoyé : vendredi 24 octobre 2008 21:40 À
  : mapserver-users@lists.osgeo.org Objet : Re: 
  [mapserver-users] projection = geographer's pain
  
  I can confirm that projection is often a pain!
  
  However, the problem may be in the projection of the layer.
  
  The PROJECTION section in a layer declare the projection of 
 the data 
  source of this layer, while the PROJECTION on the map level is the 
  projection wich you want to show the whole map. So you can overlay 
  more data sources in different projection in a single map.
  
  Try to set the layer PROJECTION as init=epsg:4326.
  Let us know...
  ciao
  ... pg
  
  
  --
  Pietro Giannini
  Bytewise srl - Area GIS
  41°50'38.58N 12°29'13.39E
  
  
  
  
  On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
   Hi,
  
  
  
   I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.
  
   My datasource is shapefiles with WGS84 projection (epsg:4326).
  
   I would like MapServer to render these data into a Web 
 (spherical) 
   Mercator projected map (epsg:3785) in order

Re: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Roger André
Hi Monier,

My understanding of how this works is as follows.

Assuming your data is in epsg:4326, and you wish to display it in epsg:3785:

1) Your LAYER needs to reflect epsg:4326.
PROJECTION
  init=epsg:4326
END

2) Your layer also needs to have a wms_srs parameter in the METADATA section
to allow for the layer to be requested in epsg:3785, ie
METADATA
  wms_srs EPSG:4326 EPSG:3785
  wms_namecounties
  wms_server_version  1.1.1
  wms_format  image/png
  wms_onlineresource  
http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map;
END

3) Your request to Mapserver needs to define the extents of the image you
want , *in the units of the projection.  *So a valid request for the layer
above would be:

http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/state.maphttp://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/test/test.map
layers=counties
srs=EPSG%3A3785
version=1.1.1
bbox=-20037508.34%2C-20037508.34%2C-10018754.1704%2C-10018754.1704
service=WMS
width=256
styles=
format=image%2Fpng
request=GetMap
height=25

Hope that helps,

Roger
--

Monier Clement wrote:

 Hi,

 There is bigger than tiny difference in extents in epsg:4326 and in
 epsg:3785.  The latter is using meters as an unit.
 I had a try with Finland polygon and here are the results:

 D:\TEMPogrinfo -summary Finland_WGS84.shp Finland_WGS84
 Feature Count: 1
 Extent: (19.648331, 59.804989) - (31.587299, 70.079422)

 D:\TEMPogr2ogr -f ESRI Shapefile -s_srs epsg:4326 -t_srs epsg:900913
 Finland_
 Spherical.shp Finland_WGS84.shp

 D:\TEMPogrinfo -summary Finland_Spherical.shp Finland_Spherical
 Feature Count: 1
 Extent: (2187242.167179, 8356448.200347) - (3516282.078834,
 11094615.004724)

 -Jukka-


  Hi,
 
  I got the map extent from shpinfo.
  Beside, I know that there should only be a tiny difference
  between coordinates in latlon-wgs84 (data proj) and web
  spherical mercator (map proj).
 
  You'll find the whole test-case files as attachement.
 
  Here's the command line to get the map :
  C:\ms4w\tools\mapserv\shp2img -m
  C:\ms4w\apps\gmap\htdocs\test.map -o test.png -l layer1 -i agga
 
  Thanks
 
  Clément
 
 
  -Message d'origine-
  De : Rahkonen Jukka [mailto:[EMAIL PROTECTED]
  Envoyé : lundi 27 octobre 2008 12:46
  À : Monier Clement; mapserver-users@lists.osgeo.org Objet :
  VS: [mapserver-users] projection = geographer's pain
 
  Hi,
 
  Have you double-checked that your map extent correspods with
  the map projection?
  Or if you could send your whole mapfile I am pretty sure that
  you will get a final answer to your problem.
 
  -Jukka Rahkonen-
 
   -Alkuperäinen viesti-
   Lähettäjä: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] Puolesta Monier
   Clement
   Lähetetty: 27. lokakuuta 2008 13:39
   Vastaanottaja: 'Pietro Giannini'; mapserver-users@lists.osgeo.org
   Aihe: RE: [mapserver-users] projection = geographer's pain
  
  
   Thanks for your answers Roger  Pietro.
  
   I've followed your advice by trying these 4 test-cases :
  
   1)
   Map proj set to :   init=epsg:3785 (web spherical Mercator,
   manually added
   into espg file)
   Layer proj set to : init=epsg:4326 (latlon wgs84, proj
  system of my
   shapefiles)
  
   = got a blank map
  
   2)
   Map projection set to : init=epsg:4326
   Layer projection set to : init=epsg:4326
  
   = got a map
  
   3)
   Map projection set to : init=epsg:3785
   Layer projection set to : init=epsg:3785
  
   = got the same map as 2)
  
   4)
   Map projection set to : init=epsg:4326
   Layer projection set to : init=epsg:3785
  
   = got a blank map
  
   I've also tried with another well-known existing epsg proj-system
   (instead of the manually-added 3785 code), but got the same results.
   I've made other attempts by replacing init=3785 by full
  description
   proj-string like +proj=longlat +ellps=WGS84
   +datum=WGS84 +no_defs  no_defs
   or +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
   But it didn't change anything...
  
   It seems that :
   - a map is drawn only if the map's and layer's proj-systems are the
   same.
   - the output projection is always overridden by the
  shapefile system,
   no re-projection is done anyway.
  
   Let me know if you have any further leads to solve this issue.
  
   Thanks for your help
  
   Clément
  
   -Message d'origine-
   De : [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] De la part
  de Pietro
   Giannini Envoyé : vendredi 24 octobre 2008 21:40 À
   : mapserver-users@lists.osgeo.org Objet : Re:
   [mapserver-users] projection = geographer's pain
  
   I can confirm that projection is often a pain!
  
   However, the problem may be in the projection of the layer.
  
   The PROJECTION section in a layer declare the projection of
  the data
   source of this layer, while the PROJECTION on the map level is the
   projection wich you

RE: [mapserver-users] projection = geographer's pain

2008-10-27 Thread Monier Clement
 

You’re right.

I finally got a correct map by following your advices.

Thanks a lot.

  _  

De : Roger André [mailto:[EMAIL PROTECTED] 
Envoyé : lundi 27 octobre 2008 17:14
À : Monier Clement
Cc : mapserver-users@lists.osgeo.org
Objet : Re: [mapserver-users] projection = geographer's pain

 

Hi Monier,

My understanding of how this works is as follows.

Assuming your data is in epsg:4326, and you wish to display it in epsg:3785:

1) Your LAYER needs to reflect epsg:4326.
PROJECTION
  init=epsg:4326
END

2) Your layer also needs to have a wms_srs parameter in the METADATA section
to allow for the layer to be requested in epsg:3785, ie
METADATA
  wms_srs EPSG:4326 EPSG:3785
  wms_namecounties
  wms_server_version  1.1.1
  wms_format  image/png
  wms_onlineresource
http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map
http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map;

END

3) Your request to Mapserver needs to define the extents of the image you
want , in the units of the projection.  So a valid request for the layer
above would be:

http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/state.map
http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/test/test.map 
layers=counties
srs=EPSG%3A3785
version=1.1.1
bbox=-20037508.34%2C-

20037508.34%2C-10018754.1704%2C-10018754.1704
service=WMS
width=256
styles=
format=image%2Fpng
request=GetMap
height=25


Hope that helps,

Roger
--

 

Monier Clement wrote:

Hi,

There is bigger than tiny difference in extents in epsg:4326 and in
epsg:3785.  The latter is using meters as an unit.
I had a try with Finland polygon and here are the results:

D:\TEMPogrinfo -summary Finland_WGS84.shp Finland_WGS84
Feature Count: 1
Extent: (19.648331, 59.804989) - (31.587299, 70.079422)

D:\TEMPogr2ogr -f ESRI Shapefile -s_srs epsg:4326 -t_srs epsg:900913
Finland_
Spherical.shp Finland_WGS84.shp

D:\TEMPogrinfo -summary Finland_Spherical.shp Finland_Spherical
Feature Count: 1
Extent: (2187242.167179, 8356448.200347) - (3516282.078834, 11094615.004724)

-Jukka-


 Hi,

 I got the map extent from shpinfo.
 Beside, I know that there should only be a tiny difference
 between coordinates in latlon-wgs84 (data proj) and web
 spherical mercator (map proj).

 You'll find the whole test-case files as attachement.

 Here's the command line to get the map :
 C:\ms4w\tools\mapserv\shp2img -m
 C:\ms4w\apps\gmap\htdocs\test.map -o test.png -l layer1 -i agga

 Thanks

 Clément


 -Message d'origine-
 De : Rahkonen Jukka [mailto:[EMAIL PROTECTED]
 Envoyé : lundi 27 octobre 2008 12:46
 À : Monier Clement; mapserver-users@lists.osgeo.org Objet :
 VS: [mapserver-users] projection = geographer's pain

 Hi,

 Have you double-checked that your map extent correspods with
 the map projection?
 Or if you could send your whole mapfile I am pretty sure that
 you will get a final answer to your problem.

 -Jukka Rahkonen-

  -Alkuperäinen viesti-
  Lähettäjä: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Puolesta Monier
  Clement
  Lähetetty: 27. lokakuuta 2008 13:39
  Vastaanottaja: 'Pietro Giannini'; mapserver-users@lists.osgeo.org
  Aihe: RE: [mapserver-users] projection = geographer's pain

 
 
  Thanks for your answers Roger  Pietro.
 
  I've followed your advice by trying these 4 test-cases :
 
  1)
  Map proj set to :   init=epsg:3785 (web spherical Mercator,
  manually added
  into espg file)
  Layer proj set to : init=epsg:4326 (latlon wgs84, proj
 system of my
  shapefiles)
 
  = got a blank map
 
  2)
  Map projection set to : init=epsg:4326
  Layer projection set to : init=epsg:4326
 
  = got a map
 
  3)
  Map projection set to : init=epsg:3785
  Layer projection set to : init=epsg:3785
 
  = got the same map as 2)
 
  4)
  Map projection set to : init=epsg:4326
  Layer projection set to : init=epsg:3785
 
  = got a blank map
 
  I've also tried with another well-known existing epsg proj-system
  (instead of the manually-added 3785 code), but got the same results.
  I've made other attempts by replacing init=3785 by full
 description
  proj-string like +proj=longlat +ellps=WGS84
  +datum=WGS84 +no_defs  no_defs
  or +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
  But it didn't change anything...
 
  It seems that :
  - a map is drawn only if the map's and layer's proj-systems are the
  same.
  - the output projection is always overridden by the
 shapefile system,
  no re-projection is done anyway.
 
  Let me know if you have any further leads to solve this issue.
 
  Thanks for your help
 
  Clément
 
  -Message d'origine-
  De : [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] De la part
 de Pietro
  Giannini Envoyé : vendredi 24 octobre 2008 21:40 À
  : mapserver-users@lists.osgeo.org Objet : Re:
  [mapserver-users] projection = geographer's pain
 
  I can confirm

[mapserver-users] projection = geographer's pain

2008-10-24 Thread Monier Clement
Hi,

 

I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.

My datasource is shapefiles with WGS84 projection (epsg:4326).

I would like MapServer to render these data into a Web (spherical)
Mercator projected map (epsg:3785) in order to perfectly overlay the
GoogleMaps tile images (for the moment, my maps are slightly shifted north.)

 

I've added this string at the end of the file epsg in /ms4w/proj/nad :

3785 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m [EMAIL PROTECTED] +no_defs 

 

But I don't know how to modify my request and mapfile in order to get the
correct map.

I've tried many combinations so far but with no success until now.

 

Do I have to change the projection system of my shapefiles ?

Is MapServer able to change projection between input and output ?

 

Request : SRS=epsg:3785

 

MapFile :

 

[Map section]

  METADATA

wms_srs   EPSG:4326 EPSG:3785 # is this correct ?

  END

 

PROJECTION

   init=epsg:3785 # is this correct ?

END

 

[Layer section]

  METADATA

wms_srs   EPSG:3785 # is this correct ?

  END

  PROJECTION

   init=epsg:3785 # is this correct ?

  END

 

With these settings, the pictures I got from MapServer are still shifted.

 

Thanks for your help

 

Clement

 

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


Re: [mapserver-users] projection = geographer's pain

2008-10-24 Thread Roger André
Hi Clement,

Looking at the info you provided, I think the problem is here in your
MAPFILE




 PROJECTION

init=epsg:3785 # is this correct ?

 END

I believe this should be set to init=epsg:4326 in order to define the
projection of the shapefile.  Then when the request is made to display the
data in epsg:3785, the system will know how to calculate the reprojection.

Best wishes,

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


Re: [mapserver-users] projection = geographer's pain

2008-10-24 Thread Pietro Giannini
I can confirm that projection is often a pain!

However, the problem may be in the projection of the layer.

The PROJECTION section in a layer declare the projection of the data
source of this layer, while the PROJECTION on the map level is the
projection wich you want to show the whole map. So you can overlay more
data sources in different projection in a single map.

Try to set the layer PROJECTION as init=epsg:4326.
Let us know...
ciao
... pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E




On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
 Hi,



 I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.

 My datasource is shapefiles with WGS84 projection (epsg:4326).

 I would like MapServer to render these data into a Web (spherical)
 Mercator projected map (epsg:3785) in order to perfectly overlay the
 GoogleMaps tile images (for the moment, my maps are slightly shifted
 north.)



 I've added this string at the end of the file epsg in /ms4w/proj/nad :

 3785 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
 +y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m [EMAIL PROTECTED] +no_defs 



 But I don't know how to modify my request and mapfile in order to get the
 correct map.

 I've tried many combinations so far but with no success until now.



 Do I have to change the projection system of my shapefiles ?

 Is MapServer able to change projection between input and output ?



 Request : SRS=epsg:3785



 MapFile :



 [Map section]

   METADATA

 wms_srs   EPSG:4326 EPSG:3785 # is this correct ?

   END



 PROJECTION

init=epsg:3785 # is this correct ?

 END



 [Layer section]

   METADATA

 wms_srs   EPSG:3785 # is this correct ?

   END

   PROJECTION

init=epsg:3785 # is this correct ?

   END



 With these settings, the pictures I got from MapServer are still shifted.



 Thanks for your help



 Clement



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



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