Thursday, May 25, 2023

Using Spatial Studio to Extend / Enhance Dimensions for OAC

Oracle Spatial Studio is a great tool that can be leveraged to extend or enhance location based data you may already be working with in your analytic projects.

Say you would like to define sales regions that are based on counties within the state and you would like to view those regions on a map.

Here is a publicly available map of Missouri, the task is to create 6 sales regions so that sale can be tracked by region and then be able to drill into region to see the sales by county for that region.

I exported the shapefile and imported it into Spatial Studio via Create Dataset.

I provide a meaningful name for the Dataset as well as the name of the table in the database.

 
Next, I need to designate a column in the dataset to be the Key. I picked the CountyFIPS as it is unique to the County name.
 Now i can create a project from the new dataset.

Creating custom regions from existing boundaries is actually quite easy.  As each County has its own boundary I could pick the Counties I want in my new Region by holding shift key and clicking with mouse or use the lasso tool.

  Now click the Create Custom Region from the Actions Toolbar.

In the dialog Select Create New, Provide the new table name and dataset name, column name and key value.

The newly created dataset is part of the project and can now be added to the canvas by dragging it into the existing map 

Now just need to make 5 more.

This time I will select append to existing and select the previously created dataset and give new attribute name.

Once all 6 regions are created I now have new map layer.

To link regions to counties I now need to create a cross reference dataset. This will involve using the Analytics feature of Spatial Studio. Click Create Analysis.

From the menu of Analysis I am selecting Return Shapes that having spatial relationship to another.

I provide a name select the county boundaries as the layer to be filter, select regions as the layer to be used as the filter and then set the mask to be Inside and Covered by
Click the Advanced and check the include the key of the secondary dataset in the result

the result can be viewed as a table

Now I can save the analysis back to my database as a new table in my ADW instance.

And when I look at it in SQLDeveloper I can see the County and Region information.

For the last bit in Spatial Studio I need to export the Custom Regions as GeoJSON map layer and then import it into OAC Custom Map Layers.


Change File Format to GeoJSON and check the REGION_NAME to be included in the file


In OAC Console Maps interface import the GeoJSON file and check REGION_NAME


I now have a map layer of Regions and Counties.


Now to create a dataset with the tables from my ADW.



Next The Workbook to analyze Sales by Region


Since I have the County to Region table I can drill to County level data from Region by right clicking on a region and selecting Drill to Attribute/Hierarchy


In this case I want to drill to COUNTYNAME


A filter is set to the Region I right clicked on and the Map now shows those counties within the region selected.


I hope this example shows how easy it is to use Spatial Studio to help extend dimensions and create hierarchical geographic data.