MapGuide Open Source:  Home |  Download |  Internals

Ticket #199 (new defect)

Opened 1 year ago

Last modified 4 months ago

BUG in SetSelectionXML on layer from database (PostgreSQL->PostgGIS)

Reported by: maciek Assigned to:
Priority: high Milestone:
Component: General Version: 1.2.0
Severity: critical Keywords:
Cc: External ID: 944853

Description

Hi

I try make SetSelectionXML method on my layer who come from PostGIS (PostgreSQL database).

I make it whit SHP and all works fine...i get corect xml of selected polygon...after call it MG make selection...

BUT.

When i try this whit layer who are in PostGIS i get bad xml (it is not completed)

this xml come from SHP file:

<?xml version="1.0" encoding="UTF-8"?>
<FeatureSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd">
<Layer id="5b908772-0000-1000-8002-0019d10e3e0f">
<Class id="SHP_Schema:RoadCenterLines">
<ID>DgEAAA==</ID></Class></Layer></FeatureSet>

this xml come from PostGIS.

<?xml version="1.0" encoding="UTF-8"?>
<FeatureSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd">
</FeatureSet>

what is wrong whit that?

take a look on my code.

------- php code begin----------------

MgInitializeWebTier ($configFilePath);
$userInfo = new MgUserInformation($mgSessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
 
$resourceService=$siteConnection->CreateService(MgServiceType::ResourceService);
$featureService=$siteConnection->CreateService(MgServiceType::FeatureService);
                                               


$map = new MgMap();
$map->Open($resourceService, 'budynek2_db');
$pomQuery = new MgFeatureQueryOptions();
$pomQuery->SetFilter("Ogc_fid = '".trim($key)."'");

//i get db connection to postgis
//normaly it should be shp source

$pomResId = new
MgResourceIdentifier("Library://budynek2/db_postgres/db.FeatureSource");

//this is my layer
$featureReader = $featureService->SelectFeatures($pomResId,
"SDF_2_Schema:0x_poziom_0", $pomQuery);

$layer = $map->GetLayers()->GetItem('0x_poziom_0');
$selection = new MgSelection($map);
$selection->AddFeatures($layer, $featureReader, 0);
$selectionXml = $selection->ToXml();

echo "<script type='text/javascript'>\n function OnPageLoad() {\n";
echo "selectionXml = '$selectionXml';\n
parent.SetSelectionXML(selectionXml);\n";
echo "$selectionXml";
echo "}\n</script>";
 
 

------- php code end----------------

Change History

(in reply to: ↑ description ) 06/12/07 06:35:24 changed by maciek

I use

MG 1.2.0 BETA + OGR Provider + XP + PHP + APACHE

06/15/07 16:05:08 changed by rexszeto

  • external_id set to 944853.

02/28/08 23:03:11 changed by tomfukushima

  • milestone deleted.

03/20/08 16:10:10 changed by tomfukushima

Hi, this is a defect that you should report in OSGeo FDO. Please create a trac ticket there (http://trac.osgeo.org/fdo/) and put a reference to that ticket in this ticket. Thanks, Tom