Hel whit php

carpetascatastro at laplata.gov.ar carpetascatastro at laplata.gov.ar
Wed May 31 16:27:49 EDT 2006



Hi, sorry for my english:

im working in serch code in php, im modify overviewtask.php, my base drawing in
in dwg the objet in the archive is trees, with object data  for example types
old, news, green ....
Im load in studio in sdf files.



object data is:
name= types trees
key = Autogenerated_SDF_ID (number of trees in the city)

the code modify is:

<?php

//
//  Copyright (C) 2004-2006  Autodesk, Inc.
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of version 2.1 of the GNU Lesser
//  General Public License as published by the Free Software Foundation.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
//

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <title>Viewer Sample Application - Navigate Task</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <meta http-equiv="content-script-type" content="text/javascript" />
    <meta http-equiv="content-style-type" content="text/css" />
    <link href="styles/globalstyles.css" rel="stylesheet" type="text/css">
    <link href="styles/alphastyles.css" rel="stylesheet" type="text/css">
    <link href="../viewerfiles/viewer.css" rel="stylesheet" type="text/css">
</head>

<body class="AppFrame">

<h1 class="AppHeading"> Trees City- </h1>

<table width="100%"  border="0">

<?php
    include 'appconstants.php';


    $mgSessionId = ($_SERVER['REQUEST_METHOD'] == "POST")? $_POST['SESSION']:
$_GET['SESSION'];

    try
    {
        // Initialize the Web Extensions and connect to the Server using
        // the Web Extensions session identifier stored in PHP session state.

        MgInitializeWebTier ($configFilePath);

        $userInfo = new MgUserInformation($mgSessionId);
        $siteConnection = new MgSiteConnection();
        $siteConnection->Open($userInfo);

        // Create a FeatureService object and use it to query all of the
        // districts from the "VotingDistricts" feature source. Get the
        // name and geometry properties of each district feature and use
        // that to construct the table of hyperlinks.

        $featureService =
$siteConnection->CreateService(MgServiceType::FeatureService);
        $resId = new
MgResourceIdentifier("Library://mycity/Data/trees.FeatureSource");
	
       
        $featureReader = $featureService->SelectFeatures($resId, "trees",
null);
	

        $tableData = new MgPropertyCollection();
        $geometryReaderWriter = new MgAgfReaderWriter();

        while ($featureReader->ReadNext())
        {
            $key = $featureReader->GetInt32('Autogenerated_SDF_ID');
            $name = $featureReader->GetString('NAME');
            $byteReader = $featureReader->GetGeometry('Data');

            $geometry = $geometryReaderWriter->Read($byteReader);
            $point = $geometry->GetCentroid();
            $x = $point->GetCoordinate()->GetX();
            $y = $point->GetCoordinate()->Gety();

            $tableData->Add(new MgStringProperty($key,
"gotopoint.php?X=$x&Y=$y&Scale=2000"));
        }
        $featureReader->Close();

        // Output the hyperlinks in sorted order. The SDF+ FDO
        // Provider does not support the OrderingFilter in
        // FeatureQueryOptions yet...

         for ($i = 1; $i <= $tableData->GetCount(); $i++)
         {
            $property = $tableData->GetItem((string)$i);
            echo '<tr><td><hr><a href=' . '"' . $property->GetValue() . '"' .
'target="scriptFrame"><b>Casco' . $property->GetName() . '</b></a></td></tr>';
        }
    }
    catch (MgException $e)
    {
        echo $e->GetMessage();
        echo $e->GetDetails();
    }


?>

    <tr><td><hr></td></tr>
</table>
</body>

</html>

but dont work, dont showme the list of trees !!!

some body helpme???

very vere thanks.
Oscar

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the Mapguide-users mailing list