Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
OpenCities Map
  • Product Communities
  • Geospatial
  • OpenCities Map
  • Cancel
OpenCities Map
OpenCities Map Wiki - Creating Oracle Spatial Views
    • Sign In
    • -OpenCities Map Wiki
      • -OpenCities Map
        • - End of Support for Bentley Map V8i (SELECTseries) products
        • +Release Information
        • +Installation Information
        • +Getting Started
        • +Administration
        • +General Topics
        • +Geospatial Administrator
        • +Feature Definitions and Inference Rules
        • +Interoperability
        • -Spatial Databases
          • - 3D arcs being stroked when posted and queried
          • - Angle of queried point feature is wrong
          • - Conflict Inspector
          • - Convert DGNs with MSLinks to MS SQL Server Spatial via FME
          • - Create domain lists in Microsoft SQL Server Spatial or Oracle
          • - Create XFM DGN file using Import from database
          • - Creating a Map schema for spatial features
          • - Creating Oracle Spatial multi-table views
          • - Creating Oracle Spatial Views
          • - Data streaming
          • - Data streaming and the Data Browser
          • - Date field settings for use with PBA in SQL Server
          • - Determine which features are locked and modified
          • - Difference between Erase and Delete for removing spatial database features
          • - Disable Connect to Database dialog
          • - Esri File Geodatabase as a Graphical Source
          • - Establish database connection upon startup
          • - Item names showing __x00##__
          • - Keep connection to database open when changing files
          • - Key-ins for interacting with spatial databases
          • - Key-ins to created queries incorporating a simple WHERE
          • - Long transactions - Versioned optimistic transactions
          • - Non planar polygon posting error ORA-54505
          • - Oracle views in spatial feature definitions
          • - Plane Constraint settings
          • - Register features times out with error
          • - Saving connection parameters to settings file
          • - SQL Server Features Not Displaying in Bentley Map
          • - Supported OGC geometry types
          • - Using joins to create custom searches
          • - WFS graphical source connection and feature registration
          • - Connecting to ArcGIS Server
        • +Spatial Analysis
        • +3D Geospatial
        • +Geographic Coordinate Systems
        • +Troubleshooting
        • +Freeware - Utilities - Applications - Programs
        • +Advanced Map Finishing
      • OpenCities Map Ultimate for Finland CONNECT Edition x64 (SES)
      • OpenCities Map Ultimate for Finland CONNECT Edition - Suomi
      • Bentley Descartes
      • +Other Geospatial Products

     
     Questions about this article, topic, or product? Click here. 

    - Creating Oracle Spatial Views

    The following may be helpful to create an Oracle view that can be registered and queried as a spatial feature.

    The PARCELS has a number of columns:

    Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
    SQL> DESCRIBE PARCELS;
    
    Name                                 Null?   Type
    
    ------------------------------------ -------- ------------------
    
    OWNER                                       VARCHAR2(50)
    ADDRESS_1                                   VARCHAR2(50)
    CITY_STATE_ZIP                              VARCHAR2(30)
    ADDRESS_2                                   VARCHAR2(50)
    LAND_TYPE                                   VARCHAR2(24)
    TOWNSHIP                                    VARCHAR2(24)
    FIRE_DISTRICT                               VARCHAR2(24)
    ZONING                                      VARCHAR2(8)
    TAX_DISTRICT                                VARCHAR2(8)
    OGC_GEOMETRY                                MDSYS.SDO_GEOMETRY
    XFM_ID                          NOT NULL    VARCHAR2(36)
    ACRES                                       NUMBER(8,2)
    ASSESSMENT_YEAR                             NUMBER(8)
    DEEDBOOK                                    NUMBER(8)
    LAND_VALUE                                  NUMBER(8)
    MARKET_VALUE                                NUMBER(8)
    REMODELED_YEAR                              NUMBER(8)
    ROOMS                                       NUMBER(8)
    SALE_PRICE                                  NUMBER(8)
    TAXABLE_VALUE                               NUMBER(8)
    

    These columns are also visible in OpenCities Map using the Data Browser or Analyze Feature:

    This complete set of property data may be needed for managing the parcel data in OpenCities Map by GIS editors. However, for map reviewers, it may be necessary to provide a limited set of property data. To to that, you can set up an Oracle view.

    In the following example, a view called PARCEL_MAIL_VIEW is created with the following columns from the PARCELS table: OWNER, ADDRESS_1, CITY_STATE_ZIP, XFM_ID, and OGC_GEOMETRY

     

    CREATE VIEW PARCEL_MAIL_VIEW
    AS SELECT OWNER, ADDRESS_1, CITY_STATE_ZIP, XFM_ID, OGC_GEOMETRY
    FROM PARCELS;
    

     

     

    OpenCities Map requires a primary key be defined on the spatial table. However you can’t have a primary key on a view. To get around this limitation, a primary key is created and then disabled.

     

    ALTER VIEW PARCEL_MAIL_VIEW ADD PRIMARY KEY(XFM_ID) DISABLE;

     

    As with spatial tables, the geometry metadata needs to be added:

     

    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
     VALUES ('PARCEL_MAIL_VIEW', 'OGC_GEOMETRY',
     MDSYS.SDO_DIM_ARRAY
    (
    MDSYS.SDO_DIM_ELEMENT('X', 2197290.78, 2401264.08, 0.00000005),
    MDSYS.SDO_DIM_ELEMENT('Y', 703310.077, 911592.401, 0.00000005)
    ),
    NULL);
    

     

    Reviewing the contents of the view in Oracle SQL Developer shows that it only contains those columns as specified in the CREATE VIEW statement.

     

      

    When registering the Oracle data source in Bentley Geospatial Administrator, the view will appear in the Register Features page of the wizard.

     

     

    Once registered, you can proceed to insert the feature placement metadata, define symbology and perform any other administrator tasks required. Once saved and exported, the same columns are available for review using the Data Browser:

      

      

    Using Oracle views is a great way to show limited property data in OpenCities Map. In this example, you could query the data and easily save the mailing address into a CSV file to use with a Microsoft Word mail merge.

     

    Lastly, you can also consider creating Oracle user roles to provide further protection to the data. For example, a GIS_EDITOR role for the users who require full access to the spatial tables and data, and a GIS_VIEWER role for those users who only need to view the data.

    A PDF of this article is available for download:

    PDF

    • Oracle
    • OpenCities Map
    • Views
    • Share
    • History
    • More
    • Cancel
    • Inga Morozoff Created by Bentley Colleague Inga Morozoff
    • When: Thu, Apr 19 2018 4:07 PM
    • Dan Weston Last revision by Bentley Colleague Dan Weston
    • When: Thu, Dec 10 2020 4:03 PM
    • Revisions: 4
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies