Two layers in two different projections
Daniele Margotti
margottid at COMUNE.LUGO.RA.IT
Thu Jun 16 06:24:53 PDT 2005
Hi all,
I have a map in UTM projection (indicated in "MAP" section of the
mapfile):
MAP
...
PROJECTION
"proj=utm"
END
...
END
No other projections are indicated in any "LAYER" section.
Every layer is based on shapefiles.
Now I want to add a layer: another shapefile that is in Cassini-Soldner
projection.
To see the coordinates of a queried feature, I launch this php script:
<?
$Mappa=ms_newMapObj($map);
$Mappali=$Mappa->getLayerByName("Mappali");
if (@$Mappali->queryByAttributes('PARTKEY', 'E730 50 118', MS_SINGLE)
== MS_SUCCESS) {
$Index = $Mappali->getResult(0);
$Mappali->open();
$Shape=$Mappali->getShape(-1,$Index->shapeindex);
$minx=$Shape->bounds->minx;
$miny=$Shape->bounds->miny;
$maxx=$Shape->bounds->maxx;
$maxy=$Shape->bounds->maxy;
$Mappali->close();
$x=($minx+$maxx)/2;
$y=($miny+$maxy)/2;
echo $x." - ".$y;
}
?>
and I obtain two values for x and y center point.
But if I add a "PROJECTION" section to my new layer, whatever projection
I give, I obtain always the same X-Y values!
Is it normal?
How can I check coordinates of my point in different projections (and
see what projection is right)?
I give these parameters for my new layer:
LAYER
...
PROJECTION
"proj=cass"
"ellps=bessel"
"lat_0=44.5318797222" # 44° 31 54.767"
"lon_0=2.8320858333" # 2° 49' 55.509"
"units=m"
"no_defs"
END
...
END
Are these parameters right?
Do I need ohter parameters for Cassini-Soldner (e.g., False Easting and
False Northing) and, if so, how should I define them (e.g.: x_0=...,
y_0=... )?
I have the newest versions of Mapserver and graphic libraries, installed
on a Linux Red Hat 9:
[root at linuxd1 cgi-bin]# ./mapserv -v
MapServer version 4.6.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT INPUT=EPPL7
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
[root at linuxd1 cgi-bin]# proj
Rel. 4.4.9, 29 Oct 2004
Thank you for your help,
Daniele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050616/282b89a1/attachment.htm>
More information about the MapServer-users
mailing list