Open tbonfort opened 12 years ago
Reporter: edmarmoretti Date: 2007/07/02 - 14:28 I need project a shape and calculate the area, but, the result is not correct:
<?php
$wkt = "POLYGON ((-48.5190906467759575 -10.3694247662893702, -44.7171016213105545 -6.4122525152947691, -43.5532274298415558 -12.3092150854043680, -48.5190906467759575 -10.3694247662893702))";
$projInObj = ms_newprojectionobj("proj=latlong,ellps=GRS67");
$projOutObj = ms_newprojectionobj("proj=laea,ellps=GRS67,lat_0=-12,lon_0=-52,x_0=500000,y_0=10000000,units=m");
$geo = ms_shapeObjFromWkt($wkt);
echo " Area before projection: ".$geo->getarea();
//result 13.5129188146 ok
$geo->project($projInObj,$projOutObj);
echo "Area after projection: ".$geo->getarea();
//result 13.5129188146 !!!!!!!
/ MapServer version 4.10.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE /
?>
Author: hobu Date: 2007/08/12 - 05:14 Ed,
This bug is duplicate of #2107 and is fixed for the upcoming 5.0 release.
Howard
Reporter: edmarmoretti Date: 2007/07/02 - 14:28 I need project a shape and calculate the area, but, the result is not correct:
<?php
$wkt = "POLYGON ((-48.5190906467759575 -10.3694247662893702, -44.7171016213105545 -6.4122525152947691, -43.5532274298415558 -12.3092150854043680, -48.5190906467759575 -10.3694247662893702))";
$projInObj = ms_newprojectionobj("proj=latlong,ellps=GRS67");
$projOutObj = ms_newprojectionobj("proj=laea,ellps=GRS67,lat_0=-12,lon_0=-52,x_0=500000,y_0=10000000,units=m");
$geo = ms_shapeObjFromWkt($wkt);
echo "
Area before projection: ".$geo->getarea();
//result 13.5129188146 ok
$geo->project($projInObj,$projOutObj);
echo "
Area after projection: ".$geo->getarea();
//result 13.5129188146 !!!!!!!
/ MapServer version 4.10.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=THREADS SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE /
?>