A number of Topobase verticals use the utility model which separates geometry from attribute feature classes. Although the utility model provides many advantages, such as soft splits, one of the disadvantages is that symbolization on a map is difficult since the geometry to draw is not available directly from the attribute features. There are a couple of workarounds, but what is proposed here is to create one database view for each attributive feature class that joins the geometry features with the attributive features.
Compared to other alternatives, there is a performance hit because of more layers, but this overhead becomes less significant with larger data sets. The advantage is that all attributes are available to symbolize with, which is difficult to achieve with union views. With the code supplied below it's also easy to do.
The supplied administrator plugin provides a button on an admin page called Flatten. Pushing the button creates a view for each attributive class in each utility model. The view for a point type of feature classes always has the following form:
create or replace view v_wa_valve (FID, GEOM, ORIENTATION, Z, QUALITY,
FID_SITE, CADASTRAL_INFO, ... VALVE_LENGTH) as
select
g.fid,
g.geom,
g.orientation,
g.z,
g.quality,
g.fid_site,
a.cadastral_info,
...
a.valve_length
from wa_point g, wa_valve a
where g.fid_attr = a.fid;
The items in blue come from the geometry class and the green items come from the attribute class (only a few are shown). The name of the view is the same as the attributive class with a "V_" prefix to indicate it is a view. The caption is also given a "View " prefix. There is a similar form for linestring type classes. After executing the view creation SQL, the view is registered as a feature class. The topic for these views is given a " Views" suffix. Various housekeeping chores such as registering the view in user_sdo_geom_metadata are handled automatically.
To use the plugin, copy the .DLL and .TBP file to the Topobase Administrator bin\ directory. Start the administrator and select the Flatten tab. Push the Flatten button. If you don't like it you can push the Unflatten button to drop the feature class references, views and topics that were created.
AUTODESK DOES NOT GUARANTEE THAT YOU WILL BE ABLE TO SUCCESSFULLY DOWNLOAD OR IMPLEMENT ANY SAMPLE CODE. SAMPLE CODE IS SUBJECT TO CHANGE WITHOUT NOTICE TO YOU.
AUTODESK PROVIDES SAMPLE CODE "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. IN NO EVENT SHALL AUTODESK OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS
OF DATA, OR LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, THAT MAY OCCUR AS A RESULT OF IMPLEMENTING OR USING ANY SAMPLE CODE, EVEN IF AUTODESK OR ITS SUPPLIERS
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
I tried flatten but it crash my tb administrator.
How can I register manually (with sql scripts) the created view to became available as feature class in TB. I think it would be a good trick :). Also a new created feature class (attributes) as "Utility point" how became a feature class because now only TB standard feature class like GA_Anode and so are feature class to display in map.
Posted by: Kalman Albert | February 16, 2010 at 09:57 PM
I would like to find out why it didn't work. What version of Topobase were you using? Maybe I need to make a different plugin assembly for your version.
Using SQL to directly update Topobase tables is not recommended. The Flatten plugin uses the API equivalent of the "Create feature class from existing view" radio button in the "Create Feature Class" dialog. This is a simple and supported way to add a view either manually or via the API.
It seems that you haven't added your new class to the GA utility model. Right click on the GA node (at the bottom of the tree view in the data model tab in the "Utilities" node) and select "Properties", and then add your class to the utility model by checking the check-box next to your class in the list of point features.
Posted by: Derrick oswald | February 17, 2010 at 02:23 AM
I tried Flatten but it crashed my tb administrator 2009.
Posted by: frank bowne | April 30, 2010 at 10:26 AM
You will probably need to recompile it for use in TB2009. I'm not sure what will be involved, but there should be equivalent functionality in TB2009 for the simple operations used in the plugin.
Posted by: Derrick Oswald | May 10, 2010 at 12:02 AM
Derrick,
Was this built for TB 2008? Have you created a 2011 version? I would love to try it for a couple customers I have.
Posted by: Brad | October 14, 2010 at 08:18 AM