Opened 17 years ago

Closed 14 years ago

#199 closed defect (wontfix)

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

Reported by: maciek Owned by:
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 (7)

in reply to:  description comment:1 by maciek, 17 years ago

I use

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

comment:2 by rexszeto, 17 years ago

External ID: 944853

comment:3 by tomfukushima, 16 years ago

Milestone: 2.0

comment:4 by tomfukushima, 16 years ago

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

comment:5 by jbirch, 14 years ago

Resolution: invalid
Status: newclosed

Old ticket; closing. If still a concern, please retest at version 2.1 and re-open.

comment:6 by jbirch, 14 years ago

Resolution: invalid
Status: closedreopened

comment:7 by jbirch, 14 years ago

Resolution: wontfix
Status: reopenedclosed
Note: See TracTickets for help on using tickets.