[mapguide-users] Petitions too slow?

oscar carpetascatastro at laplata.gov.ar
Thu Jun 1 11:06:38 EDT 2006


very thanks

my msn is:

osolp at hotmail.com


----- Original Message -----
From: "Jose Manuel C G" <gis at mapas-sll.com>
To: <users at mapguide.osgeo.org>
Sent: Thursday, June 01, 2006 11:57 AM
Subject: Re: [mapguide-users] Petitions too slow?


>
> Here is the modified code in php, the basic is here, the rest you can
> imagine...
>
> <?php
>     include 'appconstants.php';   //In this file I've included the code to
> $siteConnection, $resourceService and $featureService.
>
> $matches = 0;
>
> $StrAddr = trim($_GET['StrAddr']);
> $NumVia = trim($_GET['HouseNumber']);
>         if (strlen($owner) > 0){
> if (strlen($NumVia) > 0){
> $filter = "NOMBREVIA LIKE '" . $StrAddr . "' AND PRIMERNUM = " . $NumVia
> . "";
>
> $featureResId = new MgResourceIdentifier("Library://<path to your
> FSource>/Callejero.FeatureSource");
> $queryOptions = new MgFeatureQueryOptions();
> $queryOptions->SetFilter($filter);
>
> $geometryReaderWriter = new MgAgfReaderWriter();
>
> $featureReader = $featureService->SelectFeatures($featureResId,
> "Callejero", $queryOptions); // Callejero is the name of the layer
>
> while ($featureReader->ReadNext()){
> $name = $featureReader->GetString('NOMBREVIA');
> $tipovia = $featureReader->GetString('TIPOVIA');
> $refcat = $featureReader->GetString('CRT');
>
> $byteReader = $featureReader->GetGeometry('Geometry');
>
> $geometry = $geometryReaderWriter->Read($byteReader);
> $point = $geometry->GetCentroid();
> $x = $point->GetCoordinate()->GetX();
> $y = $point->GetCoordinate()->GetY();
>
> echo "setArrayElement(' $tipovia $name, $NumVia ');";
> $matches++;
> }
> }else{
> //  If the user only input Street Name
> $filter = "NOMBREVIA LIKE '" . $StrAddr . "'";
>
> $featureResId = new MgResourceIdentifier("Library://<path to your
> FSource>/Calles.FeatureSource");
> $queryOptions = new MgFeatureQueryOptions();
> $queryOptions->SetFilter($filter);
>
> $geometryReaderWriter = new MgAgfReaderWriter();
>
> $featureReader = $featureService->SelectFeatures($featureResId,
> "Calles", $queryOptions); //Calles is the name of another layer
>
> while ($featureReader->ReadNext()){
> $idc = $featureReader->GetString('IDC');
> $tipovia = $featureReader->GetString('TIPOVIA');
> $name = $featureReader->GetString('NOMBREVIA');
> $escala = $featureReader->GetString('ESC');
>
> $byteReader = $featureReader->GetGeometry('Geometry');
>
> $geometry = $geometryReaderWriter->Read($byteReader);
> $point = $geometry->GetCentroid();
> $x = $point->GetCoordinate()->GetX();
> $y = $point->GetCoordinate()->GetY();
>
> echo "setArrayElement(' $tipovia $name ');";
> $matches++;
> }
> }
> $featureReader->Close();
>         }else{
> // The user doesn't input a Street Name
> echo "traducir('Bsq03');"; // traducir is a function in javascript to
> translate.
>         }
> if ($matches == 0){
> echo "traducir('Bsq04');";
> }
> ?>
> --
> View this message in context:
http://www.nabble.com/Petitions+too+slow--t1715911.html#a4663663
> Sent from the OSGeo MapGuide forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.8.0/353 - Release Date: 31/05/2006
>
>





More information about the Mapguide-users mailing list