Saturday, December 9, 2006

Oracle Spatial and Network Data Model

During this week, a student from university where I'm achieving my master degree - Vincent, have asked me how to create SDO network data model in Oracle Spatial. Before asking me, he has already developed his own network model, but validation error was generated when using SDO_NET.VALIDATE_NETWORK function. When reviewing his data model definition, I have found that network metadata was declared incorrectly.

I have developed a short tutorial, which may be useful when working with Oracle Spatial Network Data Model. Scripts developed for SDO network data model definition - Contents of the archive are:
  1. nodes.sql - creates empty table to store network nodes;
  2. nodes_data.sql - data to be stored in nodes table;
  3. links.sql - creates empty table to store network links;
  4. links_data.sql - data to be stored in links table;
  5. path.sql - creates empty table to store paths data;
  6. path_links - creates empty table to store path links data;
  7. medata.sql - defines metadata for nodes, links and paths spatial columns and metadata for spatial network;
  8. indexes.sql - creates indexes for nodes, links and paths spatial columns;
  9. validate.sql - performs test for network validity, result should be TRUE
When defining SDO network data model, ensure that you have stored correct spatial information in nodes, links and paths tables. And, do not forget to define metadata correctly.

Resources for Oracle Spatial technology:


dtk78 said...

it's very interresting but it seems that you just have a command to create NODE, LINK , PATH and PATH_LINK at the same time, and also create index and view in metadata


'BUS'= Network name
1= no of hierarchy level
true, = --directed link ?
false = node with cost ?

Andrej Baranovskij said...


Yes, that true. However, this procedure does not create index and inserts metadata only for network definition (not for spatial columns). Depending on the situation, user should choose to use this procedure or separate procedures.

Thanks for the comment!

Anonymous said...

I want to make analysis like shortest path , spanning tree, etc with NDM.. would you like to help me with give me some sample?? may be oracle have made procedure like SDO_NN in NDM

Andrej Baranovskij said...


I'm sure, Oracle have described this in Spatial Developer guide. This document is available on OTN.