Configure Spatial Data
Note:
The mapping between the spatial columns and the dimensional columns (such as City and State) from the Address dimension is defined in the spatial metadata catalog, which is available as a part of the Web Catalog component in OUAW. Through the spatial data and the map metadata, users can view the star schema data in the map reports that are delivered out-of-box.Procure Spatial Data
Note:
Some of these vendors might require you to purchase a separate license for the spatial data. Contact the vendor directly to do this. You can then download a spatial data dump from the spatial data vendor.Install Spatial Data
Spatial data acquired from a third party vendor can have various formats. Commonly, vendors provide shape files (.shp) or a database dump for download. The exact spatial data model varies from vendor to vendor, since there is not a standardized format for it. Hence, the documentation that comes along with the spatial data is of utmost importance, as it is necessary to identify what type of spatial data is available and where to locate it.
Note:
- A database dump can be imported by the standard oracle impdp command.
- A shape file can also contain the spatial data tables, along with the data that can be imported by Oracle MapBuilder.
-
Unzip the .zip file (typically, the shape file is zipped for data compression) to a temp directory.
Example: /u01/Spatial/
-
Download the standalone MapBuilder application from this site:
https://www.oracle.com/middleware/technologies/fusion-middleware-mapviewer-downloads.html
-
Start the MapBuilder.
Note:
Refer to the MapViewer documentation for detailed instructions on installing and running MapBuilder from this site: http://www.oracle.com/technetwork/middleware/mapviewer/documentation/index.html - Create a connection to the DWADM schema in the Oracle Utilities Analytics Data Warehouse database by navigating to File and then to New Connection.
- Navigate to Tools and then to Import Shapefile. Click Next.
- Click on the shapefile.
- Browse to the C:\Spatial directory, select the .shp file, and click Open.
- Click Next.
- Ensure the Create Predefined Theme box is unchecked, and click Next.
- Review the summary information and click Finish. A sample screenshot is shown below.
Import Spatial Data into Spatial Data Tables
Once the spatial data tables from a third party vendor have been imported into the DWADM schema, the next step is to import the spatial data needed by Oracle Utilities Analytics Warehouse (OUAW) into certain specific tables. This step to import a certain subset of the data into a standardized set of OUAW tables is for decoupling. This decoupling helps the Oracle Analytics Server map reports and other Oracle Analytics Server map configuration to remain oblivious to the variations in the spatial data schema coming from various vendors. This way you do not need to handle the spatial metadata catalog or to modify any of the map reports being delivered out-of-the-box.
Oracle Utilities Analytics Warehouse needs the administrative boundary type of spatial data at four levels: State, City, County and Postal Code. All map reports in OUAW are using one of these levels. Since the spatial data model varies from vendor to vendor, further details provided in this section are based on a sample spatial data from a specific vendor. The following sections describe how to import the data based on a sample spatial data dump provided by HERE Technologies (formerly NAVTEQ).This sample data set contains administrative boundary data for the OHIO city in the US. The sample data set from the Oracle partner can be downloaded from Oracle Spatial Partners Data.
However, the steps can be used with a little variation to set up the spatial data for OUAW for any city from any country. The extent of the changes to be done must be based on the vendor used to purchase the spatial data. Read through the documentation of the spatial data model provided by the vendor to understand the type of data provided and and where to locate it.
The following table provides a simple mapping based on the HERE maps sample data.

Note:
Apart from these four levels, there are also some standard themes and styles that need to be imported.- The procurement of spatial data from a third party vendor.
- The import of the spatial data dump into the DWADM schema.
Note:
It is assumed that the eLocation website is being used as the base map in the Oracle Analytics Server mapviewer setup, for which the Spatial Reference System Identifier (SRID) is 54004. The SRID is a unique value used to identify the coordinate system used in a Geographic Information System (GIS) application. If some other base map is used, then the transform parameter in the insert statements should specify the SRID of the base map being used.
Improve Performance by Prefetching the Map Tiles
- In the MapViewer console, click on Admin in the top-right corner of the page and log in to the Admin Console page.
- In the Admin Console page, click on Management and then on Manage Map Tile Layers.
- Select the required online map tile and click on View Map/Manage Tiles. The Prefetching wizard opens.
-
Enter the X and Y coordinates of the center of the map, the SRID, and the zoom level. Click on Show Map.
To prefetch map images, enter the latitude and longitude values. You need to know these values of the center of the location in interest. The SRID is a unique value used to identify the coordinate system used in a GIS application.
Example: The following are the X and Y axis for Ohio city.
- When you see the map, turn on Area Selection and select the area on the map for which you want to prefetch the tiles.
- Select one or more zoom-levels for which you want to prefetch the tiles.
Load Oracle Utilities Specific Themes
This section describes how to load spatial metadata in the USER_SDO* tables for OUAW.
- Create the dump_dir directory in the database and copy the user_sdo.dmp file from ../ BI2802/Spatial-Metadata folder to that location.
-
Import the released spatial tables to the target database using the following command:
impdp directory=dump_dir dumpfile=user_sdo.dmp logfile= impdp_user_sdo.log schemas=DWADM remap_tablespace=cists_01:Note:
Run this command from database server.Note:
Make sure to change the tablespace_name to a tablespace name on which DWADM has the quota. If DWADM user have quota on cists_01 tablespace, then exclude whole remap_tablespace clause from command. -
Review the impdp_user_sdo.log file to ensure the tables are imported successfully.
-
After importing the tables, run the following SQL scripts from the ../BI2802/SpatialMetadata folder:
sqlplus DWADM/<DWADM password>@database-name @copy_spatial_metadata.sql @clean_sdo_release_tbls.sql
- Review the log files.
Additional Setup for Oracle Utilities Outage Analytics Warehouse
The Outage Analytics product within Oracle Utilities Analytics Warehouse (OUAW) requires some additional spatial data setup, as Outage Analytics alone uses point information from spatial data for plotting outage event-related information on maps. This section should be skipped if NMS is not one of the source systems for OUAW.
To begin with this setup, it is necessary to replicate the DIAGRAM_OBJECTS table into the Oracle Utilities Analytics Warehouse database. However, a suitable mechanism needs to be built to refresh this table with the latest data from Oracle Utilities Network Management System whenever there are changes in the source system.
-
Create the required spatial metadata:
INSERT INTO user_sdo_geom_metadata VALUES ('DIAGRAM_OBJECTS','LL_GEOMETRY', MDSYS.SDO_DIM_ARRAY (SDO_DIM_ELEMENT ('X', -20037508, 20037508, .05), SDO_DIM_ELEMENT ('Y', -45884542, 45884542, .05) ), 3857);
-
Ensure that the spatial index is created on the LL_GEOMETRY column. The LL_GEOMETRY column by default stores spatial data using SRID 54004, so this works without changes with the eLocation base map:
create index Q1_DIAGRAM_OBJECTS_SDX on diagram_objects (ll_geometry) indextype is mdsys.spatial_index;
-
Connect to the DWADM schema of Oracle Utilities Analytics Warehouse database and execute the following:
CREATE TABLE Q1_DIAGRAM_OBJECTS_54004 as select * from DIAGRAM_OBJECTS;
-
INSERT INTO
user_sdo_geom_metadata: VALUES ('Q1_DIAGRAM_OBJECTS_54004','LL_GEOMETRY', MDSYS.SDO_DIM_ARRAY ( SDO_DIM_ELEMENT ('X', -20037508, 20037508, .05),SDO_DIM_ELEMENT ('Y', -45884542, 45884542, .05)), 3857);
- CREATE INDEX
Q1_DIAGRAM_OBJECTS_SDX_54004 on Q1_DIAGRAM_OBJECTS_54004 (ll_geometry) indextype is mdsys.spatial_index;
. - CREATE INDEX
Q1_DIAGRAM_OBJECTS_IDX_54004 ON Q1_DIAGRAM_OBJECTS_54004(H_CLS,H_IDX);
. -
Under Tile Operations, click on Prefetch Tiles. Here is a snapshot of the area selection and the tile operation.
This process takes some time, depending upon the hardware configuration of the system and the amount of data to be prefetched. To check the current status of the operation, click on Refresh under Operation Status. The status will change to Finished when the operation is done.