Ticket #2334 (closed defect: fixed)
ShapeObj->project doesn't re-project Shapes created from WKT
| Reported by: | stoeckmann | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.0.1 release |
| Component: | MapScript-PHP | Version: | 4.10 |
| Severity: | critical | Keywords: | ShapeObj project ms_shapeObjFromWkt |
| Cc: | assefa, hobu |
Description
ShapeObj?->project doesn't re-project when ShapeObj? was created using ms_shapeObjFromWkt(), although ShapeObj?->project method returns MS_TRUE.
This won't work:
$etrs32 = ms_newProjectionObj("proj=tmerc,lon_0=9,ellps=GRS80,k=0.9996,units=m,datum=WGS84,x_0=2500000"); $etrs33 = ms_newProjectionObj("proj=tmerc,lon_0=15,ellps=GRS80,k=0.9996,units=m,datum=WGS84,x_0=3500000");
$Shp = ms_shapeObjFromWkt("POINT(3383442 5933645)"); $Shp2->Project($etrs33,$etrs32); print $Shp2->toWkt();
RETURNS: "POINT (3383442.0000000000000000 5933645.0000000000000000)" (these are the source coordinates, not the destination ones)
But this works:
$etrs32 = ms_newProjectionObj("proj=tmerc,lon_0=9,ellps=GRS80,k=0.9996,units=m,datum=WGS84,x_0=2500000"); $etrs33 = ms_newProjectionObj("proj=tmerc,lon_0=15,ellps=GRS80,k=0.9996,units=m,datum=WGS84,x_0=3500000");
$Line = ms_newLineObj(); $Line->addXY(3383442,5933645); $Shp2 = ms_newShapeObj(0); $Shp2->add($Line); $Shp2->Project($etrs33,$etrs32); print $Shp2->toWkt();
RETURNS CORRECTLY: "POINT (2780993.2288354267366230 5940576.6376133039593697)"
