Autodesk MapGuide Enterprise Developer
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Oracle view feature source
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
3 Views, 5 Replies
09-23-2009 08:51 AM
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
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
Re: Oracle view feature source
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-23-2009 08:54 AM 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-instan ce" xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xs d"]
[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]
so the XML is something like this:
[?xml version="1.0" encoding="UTF-8"?]
[FeatureSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan
[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]
Re: Oracle view feature source
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-23-2009 12:06 PM in reply to:
rszabolcs
Did you create an primary key for the view?
Re: Oracle view feature source
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-24-2009 12:11 AM 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;
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;
Re: Oracle view feature source
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-06-2009 06:04 AM 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.o sgeo.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"
Here is the sollution:
http://www.mail-archive.com/mapguide-users@lists.o
"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
(
Once the view has a primary key, selection becomes available.
Bruno"
Re: Oracle view feature source
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-06-2009 06:07 AM in reply to:
rszabolcs
alter view [viewname] add constraint [constraintname] primary key ([columnlist]) disable novalidate;

