CreateFromCode("LL84"); $cs2 = $csFactory->CreateFromCode("WGS84.PseudoMercator"); $xform = $csFactory->GetTransform($cs1, $cs2); $wktRw = new MgWktReaderWriter(); $pt = $wktRw->Read("POINT (1 2)"); $coord = $pt->GetCoordinate(); echo "Point (".$coord->GetX().", ".$coord->GetY().")\n"; $pt = $pt->Transform($xform); $coord = $pt->GetCoordinate(); echo "XPoint (".$coord->GetX().", ".$coord->GetY().")\n"; } function connectionServiceTest() { /* Expected release book-keeping: MgUserInformation - 1 MgSiteConnection - 1 MgProxyResourceService - 1 MgProxyFeatureService - 1 MgProxyRenderingService - 1 MgProxyMappingService - 1 MgProxyKmlService - 1 MgProxyDrawingService - 1 MgProxyTileService - 1 MgProxyProfilingService - 1 */ $userInfo = new MgUserInformation("Anonymous", ""); $site = new MgSiteConnection(); $site->Open($userInfo); $service1 = $site->CreateService(MgServiceType::ResourceService); $service2 = $site->CreateService(MgServiceType::FeatureService); $service3 = $site->CreateService(MgServiceType::RenderingService); $service4 = $site->CreateService(MgServiceType::MappingService); $service5 = $site->CreateService(MgServiceType::KmlService); $service6 = $site->CreateService(MgServiceType::DrawingService); $service7 = $site->CreateService(MgServiceType::TileService); $service8 = $site->CreateService(MgServiceType::ProfilingService); } function functionWithParam($userInfo) { $userInfo->SetLocale("en"); } function parameterPassingTest() { // We want to check parameters of Mg* objects passed do not encounter // refcounting shenanigans, but if they do, we want to make sure that // proper increment/decrement is happening so that the MgUserInformation // is released to 0 refcount (and thus deleted) when this function returns /* Expected release book-keeping: MgUserInformation - 1 */ $userInfo = new MgUserInformation(); functionWithParam($userInfo); echo "Locale: " . $userInfo->GetLocale() . "\n"; } MgInitializeWebTier("C:\\mg-4.0-install\\Web\\www\\webconfig_dev.ini"); echo "=========== BEGIN - exceptionTest() ===========\n"; exceptionTest(); echo "=========== END - exceptionTest() ===========\n"; echo "=========== BEGIN - exceptionTest2() ===========\n"; exceptionTest2(); echo "=========== END - exceptionTest2() ===========\n"; echo "=========== BEGIN - exceptionTest3() ===========\n"; exceptionTest3(); echo "=========== END - exceptionTest3() ===========\n"; echo "=========== BEGIN - connectionServiceTest() ===========\n"; connectionServiceTest(); echo "=========== END - connectionServiceTest() ===========\n"; echo "=========== BEGIN - parameterPassingTest() ===========\n"; parameterPassingTest(); echo "=========== END - parameterPassingTest() ===========\n"; echo "=========== BEGIN - geometryXformTest() ===========\n"; geometryXformTest(); echo "=========== END - geometryXformTest() ===========\n"; ?>