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 - network.zip. Contents of the network.zip 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:

4 comments:

dtk78 said...

hello,
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

EXECUTE SDO_NET.CREATE_SDO_NETWORK('TEST_NET',1,TRUE,FALSE);

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

Andrej Baranovskij said...

Hi,

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...

Hi,

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

Regards,
Andrejus