Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Oracle view feature source

5 REPLIES 5
Reply
Message 1 of 6
rszabolcs
244 Views, 5 Replies

Oracle view feature source

Hi,

We would like to use Oracle views (based on Spatial tables) for feature sources of the Mapguide layers. The display of the features is o.k., but the selection does not work. It does not work in the viewer, I can't select elements, nothing happens when I click on an element or draw envelope around an element. And it does not work from the API, I try to use the $selection->ToXml() and the XML looks like this, the IDs are empty:










But if I modify the layer definition, and set the feature source to the Oracle table, instead of the view, the selection works fine, either with the viewer or from the API.

What is missing from the view? Should I put any specific column into the view? I tried the "FEATID", but nothing changed.

Mapguide Enterprise 2010
Oracle 10.2.0.4
Linux

Thanks,
Szabolcs
5 REPLIES 5
Message 2 of 6
rszabolcs
in reply to: rszabolcs

ooops, the engine erased my XML....

so the XML is something like this:

[?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="177000fc-0000-1000-8000-0019660110f5"]
[Class id="FdoERV_GIS_IPE:ETAB_VV_VEZ_4_V"]
[ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID] [ID][/ID]
[/Class]
[/Layer]
[/FeatureSet]
Message 3 of 6
RafaelDeMelo
in reply to: rszabolcs

Did you create an primary key for the view?
Message 4 of 6
rszabolcs
in reply to: rszabolcs

The view is a join of two tables, like this:

create table A
(
geom_id number primary key,
geom mdsys.sdo_geometry,
b_id number,
....
);

create table B
(
id number primary key,
code varchar2(20),
name varchar2(200),
....
);

create or replace view AB_V as
select
A.geom_id,
A.geom,
B.id,
B.code
...
A.geom_id ID,
A.geom_id FEATID
from
A,B
where
A.b_id = B.id;
Message 5 of 6
rszabolcs
in reply to: rszabolcs

I didn't know that I can create primary key for a view. I created PKs for the tables only.

Here is the sollution:
http://www.mail-archive.com/mapguide-users@lists.osgeo.org/msg10933.html

"RE: [mapguide-users] Oracle FDO and View
Bruno Scott
Fri, 29 May 2009 02:15:36 -0700

This is the SQL syntax to add a primary key on an Oracle View

alter view add constraint primary key
() disable novalidate;

Once the view has a primary key, selection becomes available.

Bruno"
Message 6 of 6
rszabolcs
in reply to: rszabolcs

alter view [viewname] add constraint [constraintname] primary key ([columnlist]) disable novalidate;

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report