1 PACKAGE sdo_net AUTHID current_user AS
2
3 ---------------------------
4 --CONSTANTS
5 ---------------------------
6 --Logging levels
7 --The finer the logging level, the higher the number
8 LOGGING_LEVEL_FATAL CONSTANT INTEGER := 1;
9 LOGGING_LEVEL_ERROR CONSTANT INTEGER := 2;
10 LOGGING_LEVEL_WARN CONSTANT INTEGER := 3;
11 LOGGING_LEVEL_INFO CONSTANT INTEGER := 4;
12 LOGGING_LEVEL_DEBUG CONSTANT INTEGER := 5;
13 LOGGING_LEVEL_FINEST CONSTANT INTEGER := 6;
14
15 --Fearture Types
16 FEAT_TYPE_PON CONSTANT INTEGER := 1; --SINGLE POINT ON NODE
17 FEAT_TYPE_POL CONSTANT INTEGER := 2; --SINGLE POINT ON LINK
18 FEAT_TYPE_POINT CONSTANT INTEGER := 3; --SINGLE POINT
19 FEAT_TYPE_LINE CONSTANT INTEGER := 4; --SINGLE LINE
20 FEAT_TYPE_MPON CONSTANT INTEGER := 5; --MULTI POINT ON NODE
21 FEAT_TYPE_MPOL CONSTANT INTEGER := 6; --MULTI POINT ON LINK
22 FEAT_TYPE_MPOINT CONSTANT INTEGER := 7; --MULTI POINT
23 FEAT_TYPE_MLINE CONSTANT INTEGER := 8; --MULTI LINE
24 FEAT_TYPE_COLL CONSTANT INTEGER := 9; --COLLECTION
25
26 --Fearture Element Types
27 FEAT_ELEM_TYPE_PON CONSTANT INTEGER := 1; --POINT ON NODE
28 FEAT_ELEM_TYPE_POL CONSTANT INTEGER := 2; --POINT ON LINK
29 FEAT_ELEM_TYPE_LINE CONSTANT INTEGER := 3; --LINE
30
31 --Net Element Types
32 NET_ELEM_TYPE_NODE CONSTANT INTEGER := 1; --NODE
33 NET_ELEM_TYPE_LINK CONSTANT INTEGER := 2; --LINK
34
35 ---------------------------
36 --TYPES
37 ---------------------------
38 type ref_cursor is ref cursor;
39
40 ---------------------------
41 --SUBPROGRAMS
42 ---------------------------
43 -- check if the network exists in the network metadata
44 FUNCTION network_exists(network IN VARCHAR2)
45 RETURN VARCHAR2;
46 PRAGMA RESTRICT_REFERENCES(network_exists,WNDS,WNPS,RNPS);
47
48 -----------------------------------------------------
49 -- @deprecated: use network metadata views instead --
50 -----------------------------------------------------
51 -- return the network ID from network name
52 FUNCTION get_network_id(network IN VARCHAR2)
53 RETURN NUMBER;
54 --PRAGMA RESTRICT_REFERENCES(get_network_id,WNDS,WNPS,RNPS);
55
56 -----------------------------------------------------
57 -- @deprecated: use network metadata views instead --
58 -----------------------------------------------------
59 -- return network name from network ID
60 FUNCTION get_network_name(network_id IN NUMBER)
61 RETURN VARCHAR2;
62 PRAGMA RESTRICT_REFERENCES(get_network_name,WNDS,WNPS,RNPS);
63
64 -----------------------------------------------------
65 -- @deprecated: use network metadata views instead --
66 -----------------------------------------------------
67 -- return network name from network ID
68 FUNCTION get_network_name(network_id IN NUMBER, owner OUT VARCHAR2)
69 RETURN VARCHAR2;
70 PRAGMA RESTRICT_REFERENCES(get_network_name,WNDS,WNPS,RNPS);
71
72 -----------------------------------------------------
73 -- @deprecated: use network metadata views instead --
74 -----------------------------------------------------
75 -- return network owner from network ID
76 FUNCTION get_network_owner(network_id IN NUMBER)
77 RETURN VARCHAR2;
78 PRAGMA RESTRICT_REFERENCES(get_network_owner,WNDS,WNPS,RNPS);
79
80 -----------------------------------------------------
81 -- @deprecated: use network metadata views instead --
82 -----------------------------------------------------
83 -- return the type of network
84 FUNCTION get_network_type(network IN VARCHAR2)
85 RETURN VARCHAR2;
86 PRAGMA RESTRICT_REFERENCES(get_network_type,WNDS,WNPS,RNPS);
87
88 -----------------------------------------------------
89 -- @deprecated: use network metadata views instead --
90 -----------------------------------------------------
91 -- return the type of network
92 FUNCTION get_network_category(network IN VARCHAR2)
93 RETURN VARCHAR2;
94 PRAGMA RESTRICT_REFERENCES(get_network_category,WNDS,WNPS,RNPS);
95
96 -----------------------------------------------------
97 -- @deprecated: use network metadata views instead --
98 -----------------------------------------------------
99 -- return the type of geometry
100 FUNCTION get_geometry_type(network IN VARCHAR2)
101 RETURN VARCHAR2;
102 PRAGMA RESTRICT_REFERENCES(get_geometry_type,WNDS,WNPS,RNPS);
103
104 -----------------------------------------------------
105 -- @deprecated: use network metadata views instead --
106 -----------------------------------------------------
107 -- return no of hierarchy levels
108 FUNCTION get_no_of_hierarchy_levels(network IN VARCHAR2)
109 RETURN NUMBER;
110 PRAGMA RESTRICT_REFERENCES(get_no_of_hierarchy_levels,WNDS,WNPS,RNPS);
111
112 -----------------------------------------------------
113 -- @deprecated: query partition table instead --
114 -----------------------------------------------------
115 -- return no of partition
116 FUNCTION get_no_of_partitions(network IN VARCHAR2,
117 link_level IN NUMBER DEFAULT 1)
118 RETURN NUMBER;
119
120 -----------------------------------------------------
121 -- @deprecated: use network metadata views instead --
122 -----------------------------------------------------
123 -- return geometry table(LRS) name of network
124 FUNCTION get_lrs_table_name(network IN VARCHAR2)
125 RETURN VARCHAR2;
126 PRAGMA RESTRICT_REFERENCES(get_lrs_table_name,WNDS,WNPS,RNPS);
127
128 -----------------------------------------------------
129 -- @deprecated: use network metadata views instead --
130 -----------------------------------------------------
131 -- return LRS geom column of network
132 FUNCTION get_lrs_geom_column(network IN VARCHAR2)
133 RETURN VARCHAR2;
134 PRAGMA RESTRICT_REFERENCES(get_lrs_geom_column,WNDS,WNPS,RNPS);
135
136 -----------------------------------------------------
137 -- @deprecated: use network metadata views instead --
138 -----------------------------------------------------
139 -- return node table name of network
140 FUNCTION get_node_table_name(network IN VARCHAR2)
141 RETURN VARCHAR2;
142 PRAGMA RESTRICT_REFERENCES(get_node_table_name,WNDS,WNPS,RNPS);
143
144 -----------------------------------------------------
145 -- @deprecated: use network metadata views instead --
146 -----------------------------------------------------
147 -- return node geom column of network
148 FUNCTION get_node_geom_column(network IN VARCHAR2)
149 RETURN VARCHAR2;
150 PRAGMA RESTRICT_REFERENCES(get_node_geom_column,WNDS,WNPS,RNPS);
151
152 -----------------------------------------------------
153 -- @deprecated: use network metadata views instead --
154 -----------------------------------------------------
155 -- return node cost column of network
156 FUNCTION get_node_cost_column(network IN VARCHAR2)
157 RETURN VARCHAR2;
158 PRAGMA RESTRICT_REFERENCES(get_node_cost_column,WNDS,WNPS,RNPS);
159
160 ----------------------------------------------------------------------
161 -- @deprecated: node partition column is no longer used since 11gR1.--
162 ----------------------------------------------------------------------
163 -- return node partition column of network
164 FUNCTION get_node_partition_column(network IN VARCHAR2)
165 RETURN VARCHAR2;
166 --PRAGMA RESTRICT_REFERENCES(get_node_partition_column,WNDS,WNPS,RNPS);
167
168 -----------------------------------------------------
169 -- @deprecated: use network metadata views instead --
170 -----------------------------------------------------
171 -- return link table name of network
172 FUNCTION get_link_table_name(network IN VARCHAR2)
173 RETURN VARCHAR2;
174 PRAGMA RESTRICT_REFERENCES(get_link_table_name,WNDS,WNPS,RNPS);
175
176 -----------------------------------------------------
177 -- @deprecated: use network metadata views instead --
178 -----------------------------------------------------
179 -- return link geom column of network
180 FUNCTION get_link_geom_column(network IN VARCHAR2)
181 RETURN VARCHAR2;
182 PRAGMA RESTRICT_REFERENCES(get_link_geom_column,WNDS,WNPS,RNPS);
183
184 -----------------------------------------------------
185 -- @deprecated: use network metadata views instead --
186 -----------------------------------------------------
187 -- return link direction of network
188 FUNCTION get_link_direction(network IN VARCHAR2)
189 RETURN VARCHAR2;
190 PRAGMA RESTRICT_REFERENCES(get_link_direction,WNDS,WNPS,RNPS);
191
192 -----------------------------------------------------
193 -- @deprecated: link partition column is not used. --
194 -----------------------------------------------------
195 -- return link partition column of network
196 FUNCTION get_link_partition_column(network IN VARCHAR2)
197 RETURN VARCHAR2;
198 --PRAGMA RESTRICT_REFERENCES(get_link_partition_column,WNDS,WNPS,RNPS);
199
200 -----------------------------------------------------
201 -- @deprecated: use network metadata views instead --
202 -----------------------------------------------------
203 -- return link cost column of network
204 FUNCTION get_link_cost_column(network IN VARCHAR2)
205 RETURN VARCHAR2;
206 PRAGMA RESTRICT_REFERENCES(get_link_cost_column,WNDS,WNPS,RNPS);
207
208 -----------------------------------------------------
209 -- @deprecated: use network metadata views instead --
210 -----------------------------------------------------
211 -- return path table name of network
212 FUNCTION get_path_table_name(network IN VARCHAR2)
213 RETURN VARCHAR2;
214 PRAGMA RESTRICT_REFERENCES(get_path_table_name,WNDS,WNPS,RNPS);
215
216 -----------------------------------------------------
217 -- @deprecated: use network metadata views instead --
218 -----------------------------------------------------
219 -- return path geom column name of network
220 FUNCTION get_path_geom_column(network IN VARCHAR2)
221 RETURN VARCHAR2;
222 PRAGMA RESTRICT_REFERENCES(get_path_geom_column,WNDS,WNPS,RNPS);
223
224 -----------------------------------------------------
225 -- @deprecated: use network metadata views instead --
226 -----------------------------------------------------
227 -- return path-link table name of network
228 FUNCTION get_path_link_table_name(network IN VARCHAR2)
229 RETURN VARCHAR2;
230 PRAGMA RESTRICT_REFERENCES(get_path_link_table_name,WNDS,WNPS,RNPS);
231
232 -----------------------------------------------------
233 -- @deprecated: use network metadata views instead --
234 -----------------------------------------------------
235 -- return subpath table name of network
236 FUNCTION get_subpath_table_name(network IN VARCHAR2)
237 RETURN VARCHAR2;
238 PRAGMA RESTRICT_REFERENCES(get_subpath_table_name,WNDS,WNPS,RNPS);
239
240 -----------------------------------------------------
241 -- @deprecated: use network metadata views instead --
242 -----------------------------------------------------
243 -- return subpath geom column name of network
244 FUNCTION get_subpath_geom_column(network IN VARCHAR2)
245 RETURN VARCHAR2;
246 PRAGMA RESTRICT_REFERENCES(get_subpath_geom_column,WNDS,WNPS,RNPS);
247
248 -----------------------------------------------------
249 -- @deprecated: use network metadata views instead --
250 -----------------------------------------------------
251 -- return partition table name of network
252 FUNCTION get_partition_table_name(network IN VARCHAR2)
253 RETURN VARCHAR2;
254 PRAGMA RESTRICT_REFERENCES(get_partition_table_name,WNDS,WNPS,RNPS);
255
256 -----------------------------------------------------
257 -- @deprecated: use network metadata views instead --
258 -----------------------------------------------------
259 -- return partition blob table name of network
260 FUNCTION get_partition_blob_table_name(network IN VARCHAR2)
261 RETURN VARCHAR2;
262 PRAGMA RESTRICT_REFERENCES(get_partition_blob_table_name,WNDS,WNPS,RNPS);
263
264 -----------------------------------------------------
265 -- @deprecated: use network metadata views instead --
266 -----------------------------------------------------
267 -- return if there is any user defined data in the metadata
268 FUNCTION get_user_defined_data(network IN VARCHAR2)
269 RETURN VARCHAR2;
270 PRAGMA RESTRICT_REFERENCES(get_user_defined_data,WNDS,WNPS,RNPS);
271
272
273 -- return no of nodes of the network
274 FUNCTION get_no_of_nodes(network IN VARCHAR2)
275 RETURN NUMBER;
276
277 -- return no of nodes of the network of specified hierarchy_level
278 FUNCTION get_no_of_nodes(network IN VARCHAR2, hierarchy_level IN NUMBER)
279 RETURN NUMBER;
280
281 -- return no of links of the network
282 FUNCTION get_no_of_links(network IN VARCHAR2)
283 RETURN NUMBER;
284 -- PRAGMA RESTRICT_REFERENCES(get_no_of_links,WNDS,WNPS,RNPS);
285
286 -- return no of links of the network of specified hierarchy_level
287 FUNCTION get_no_of_links(network IN VARCHAR2, hierarchy_level IN NUMBER)
288 RETURN NUMBER;
289
290 -- return no of links of the given path
291 FUNCTION get_no_of_links_in_path(network IN VARCHAR2, path_id IN NUMBER)
292 RETURN NUMBER;
293
294 -- return no of nodes of the given path
295 FUNCTION get_no_of_nodes_in_path(network IN VARCHAR2, path_id IN NUMBER)
296 RETURN NUMBER;
297
298 -- return the in-link ids of a node
299 FUNCTION get_in_links(network IN VARCHAR2, node_id in number)
300 RETURN SDO_NUMBER_ARRAY DETERMINISTIC ;
301
302 -- return the out-link ids of a node
303 FUNCTION get_out_links(network IN VARCHAR2, node_id in number)
304 RETURN SDO_NUMBER_ARRAY DETERMINISTIC;
305
306
307 -- return the in-degree of a node
308 FUNCTION get_node_in_degree(network IN VARCHAR2, node_id in number)
309 RETURN NUMBER;
310
311 -- return the out-degree of a node
312 FUNCTION get_node_out_degree(network IN VARCHAR2, node_id in number)
313 RETURN NUMBER;
314 -- PRAGMA RESTRICT_REFERENCES(get_node_out_degree,WNDS,WNPS,RNPS);
315
316 -- return the degree of a node(in_degree+out_degree)
317 FUNCTION get_node_degree(network IN VARCHAR2, node_id in number)
318 RETURN NUMBER;
319
320
321 -- return the child nodes of a given node
322 FUNCTION get_child_nodes(network IN VARCHAR2, node_id in number)
323 RETURN SDO_NUMBER_ARRAY DETERMINISTIC;
324
325 -- return the child links of a given link
326 FUNCTION get_child_links(network IN VARCHAR2, link_id in number)
327 RETURN SDO_NUMBER_ARRAY DETERMINISTIC;
328
329 -----------------
330 -- @deprecated --
331 -----------------
332 -- return the path links of a given path
333 FUNCTION get_links_in_path(network IN VARCHAR2, path_id in number)
334 RETURN SDO_NUMBER_ARRAY DETERMINISTIC;
335
336 -- return the path nodes of a given path
337 FUNCTION get_nodes_in_path(network IN VARCHAR2, path_id in number)
338 RETURN SDO_NUMBER_ARRAY DETERMINISTIC;
339
340
341 --
342 -- create xxx_network assumes the following naming convention
343 -- table name length limitation: 32 char.
344 -- network name length limitation : 24 char
345 --
346
347 -- default table/columns names:
348 -- node table : <network>_node$
349 -- link table : <network>_link$
350 -- path table : <network>_path$
351 -- path link table : <network>_plink$ (path_id, link_id)
352 -- node geom. column : geometry
353 -- node lrs geom column : geom_id and measure
354 -- node topo geom column : topo_geometry
355 -- link geom. column : geometry
356 -- link lrs geom column : geom_id, start_measure, and end_measure
360 -- link cost column : cost
357 -- link topo geom column : topo_geometry
358 -- path geom. column : geometry
359 -- node cost column : cost
361 -- path cost column : cost
362 -- subpath table name : <network>_spath$
363 -- subpath geom. column : geometry
364 -- storage parameters : for create table statement
365
366
367
368 -- create a logical network
369 PROCEDURE create_logical_network(network IN VARCHAR2,
370 no_of_hierarchy_levels IN NUMBER,
371 is_directed IN BOOLEAN,
372 node_table_name IN VARCHAr2,
373 node_cost_column IN VARCHAR2,
374 link_table_name IN VARCHAR2,
375 link_cost_column IN VARCHAR2,
376 path_table_name IN VARCHAR2,
377 path_link_table_name IN VARCHAR2,
378 subpath_table_name IN VARCHAR2,
379 is_complex IN BOOLEAN DEFAULT FALSE,
380 storage_parameters IN VARCHAR2 DEFAULT '');
381
382 -- create a logical network
383 PROCEDURE create_logical_network(network IN VARCHAR2,
384 no_of_hierarchy_levels IN NUMBER,
385 is_directed IN BOOLEAN,
386 node_table_name IN VARCHAr2,
387 node_cost_column IN VARCHAR2,
388 link_table_name IN VARCHAR2,
389 link_cost_column IN VARCHAR2,
390 path_table_name IN VARCHAR2,
391 path_link_table_name IN VARCHAR2,
392 is_complex IN BOOLEAN DEFAULT FALSE,
393 storage_parameters IN VARCHAR2 DEFAULT '');
394
395 -- create a logical network (simplified version)
396 PROCEDURE create_logical_network(network IN VARCHAR2,
397 no_of_hierarchy_levels IN NUMBER,
398 is_directed IN BOOLEAN,
399 node_with_cost IN BOOLEAN DEFAULT FALSE,
400 is_complex IN BOOLEAN DEFAULT FALSE,
401 storage_parameters IN VARCHAR2 DEFAULT '');
402
403
404
405 -- create a spatial (SDO_GEOMETRY) network
406 PROCEDURE create_sdo_network(network IN VARCHAR2,
407 no_of_hierarchy_levels IN NUMBER,
408 is_directed IN BOOLEAN,
409 node_table_name IN VARCHAR2,
410 node_geom_column IN VARCHAR2,
411 node_cost_column IN VARCHAR2,
412 link_table_name IN VARCHAR2,
413 link_geom_column IN VARCHAR2,
414 link_cost_column IN VARCHAR2,
415 path_table_name IN VARCHAR2,
416 path_geom_column IN VARCHAR2,
417 path_link_table_name IN VARCHAR2,
418 subpath_table_name IN VARCHAR2,
419 subpath_geom_column IN VARCHAR2,
420 is_complex IN BOOLEAN DEFAULT FALSE,
421 storage_parameters IN VARCHAR2 DEFAULT '');
422
423 -- create a spatial (SDO_GEOMETRY) network
424 PROCEDURE create_sdo_network(network IN VARCHAR2,
425 no_of_hierarchy_levels IN NUMBER,
426 is_directed IN BOOLEAN,
427 node_table_name IN VARCHAR2,
428 node_geom_column IN VARCHAR2,
429 node_cost_column IN VARCHAR2,
430 link_table_name IN VARCHAR2,
431 link_geom_column IN VARCHAR2,
432 link_cost_column IN VARCHAR2,
433 path_table_name IN VARCHAR2,
434 path_geom_column IN VARCHAR2,
435 path_link_table_name IN VARCHAR2,
436 is_complex IN BOOLEAN DEFAULT FALSE,
437 storage_parameters IN VARCHAR2 DEFAULT '');
438
439
440
441 -- create a spatial (SDO_GEOMETRY) network
442 PROCEDURE create_sdo_network(network IN VARCHAR2,
443 no_of_hierarchy_levels IN NUMBER,
444 is_directed IN BOOLEAN,
445 node_with_cost IN BOOLEAN DEFAULT FALSE,
449
446 is_complex IN BOOLEAN DEFAULT FALSE,
447 storage_parameters IN VARCHAR2 DEFAULT '');
448
450 -- create a spatial (LRS_GEOMETRY) network
451 PROCEDURE create_lrs_network(network IN VARCHAR2,
452 no_of_hierarchy_levels IN NUMBER,
453 is_directed IN BOOLEAN,
454 node_table_name IN VARCHAR2,
455 node_cost_column IN VARCHAR2,
456 link_table_name IN VARCHAR2,
457 link_cost_column IN VARCHAR2,
458 lrs_table_name IN VARCHAR2,
459 lrs_geom_column IN VARCHAR2,
460 path_table_name IN VARCHAR2,
461 path_geom_column IN VARCHAR2,
462 path_link_table_name IN VARCHAR2,
463 subpath_table_name IN VARCHAR2,
464 subpath_geom_column IN VARCHAR2,
465 is_complex IN BOOLEAN DEFAULT FALSE,
466 storage_parameters IN VARCHAR2 DEFAULT '');
467 -- create a spatial (LRS_GEOMETRY) network
468 PROCEDURE create_lrs_network(network IN VARCHAR2,
469 no_of_hierarchy_levels IN NUMBER,
470 is_directed IN BOOLEAN,
471 node_table_name IN VARCHAR2,
472 node_cost_column IN VARCHAR2,
473 link_table_name IN VARCHAR2,
474 link_cost_column IN VARCHAR2,
475 lrs_table_name IN VARCHAR2,
476 lrs_geom_column IN VARCHAR2,
477 path_table_name IN VARCHAR2,
478 path_geom_column IN VARCHAR2,
479 path_link_table_name IN VARCHAR2,
480 is_complex IN BOOLEAN DEFAULT FALSE,
481 storage_parameters IN VARCHAR2 DEFAULT '');
482
483
484 -- create a spatial (LRS_GEOMETRY) network
485 PROCEDURE create_lrs_network(network IN VARCHAR2,
486 lrs_table_name IN VARCHAR2,
487 lrs_geom_column IN VARCHAR2,
488 no_of_hierarchy_levels IN NUMBER,
489 is_directed IN BOOLEAN,
490 node_with_cost IN BOOLEAN DEFAULT FALSE,
491 is_complex IN BOOLEAN DEFAULT FALSE,
492 storage_parameters IN VARCHAR2 DEFAULT '');
493
494
495
496 PROCEDURE create_topo_network(network IN VARCHAR2,
497 no_of_hierarchy_levels IN NUMBER,
498 is_directed IN BOOLEAN,
499 node_table_name IN VARCHAR2,
500 node_geom_column IN VARCHAR2,
501 node_cost_column IN VARCHAR2,
502 link_table_name IN VARCHAR2,
503 link_geom_column IN VARCHAR2,
504 link_cost_column IN VARCHAR2,
505 path_table_name IN VARCHAR2,
506 path_geom_column IN VARCHAR2,
507 path_link_table_name IN VARCHAR2,
508 subpath_table_name IN VARCHAR2,
509 subpath_geom_column IN VARCHAR2,
510 is_complex IN BOOLEAN DEFAULT FALSE,
511 storage_parameters IN VARCHAR2 DEFAULT '');
512
513 -- create a spatial (TOPO_GEOMETRY) network
514 PROCEDURE create_topo_network(network IN VARCHAR2,
515 no_of_hierarchy_levels IN NUMBER,
516 is_directed IN BOOLEAN,
517 node_table_name IN VARCHAR2,
518 node_geom_column IN VARCHAR2,
519 node_cost_column IN VARCHAR2,
520 link_table_name IN VARCHAR2,
521 link_geom_column IN VARCHAR2,
522 link_cost_column IN VARCHAR2,
523 path_table_name IN VARCHAR2,
524 path_geom_column IN VARCHAR2,
525 path_link_table_name IN VARCHAR2,
526 is_complex IN BOOLEAN DEFAULT FALSE,
527 storage_parameters IN VARCHAR2 DEFAULT '');
528
529
530 -- create a spatial (TOPO_GEOMETRY) network
531 PROCEDURE create_topo_network(network IN VARCHAR2,
532 no_of_hierarchy_levels IN NUMBER,
533 is_directed IN BOOLEAN,
537 link_cost_column IN VARCHAR2,
534 node_table_name IN VARCHAR2,
535 node_cost_column IN VARCHAR2,
536 link_table_name IN VARCHAR2,
538 path_table_name IN VARCHAR2,
539 path_geom_column IN VARCHAR2,
540 path_link_table_name IN VARCHAR2,
541 is_complex IN BOOLEAN DEFAULT FALSE,
542 storage_parameters IN VARCHAR2 DEFAULT '');
543
544
545
546 -- create a spatial (TOPO_GEOMETRY) network
547 PROCEDURE create_topo_network(network IN VARCHAR2,
548 no_of_hierarchy_levels IN NUMBER,
549 is_directed IN BOOLEAN,
550 node_with_cost IN BOOLEAN DEFAULT FALSE,
551 is_complex IN BOOLEAN DEFAULT FALSE,
552 storage_parameters IN VARCHAR2 DEFAULT '');
553
554
555
556 -- create a spatial (TOPO_GEOMETRY) network from existing topology data
557 -- The nodes and links in the resultant network have one-to-one mapping
558 -- to the nodes and edges in the given topology
559 PROCEDURE create_topo_network(network in varchar2,
560 no_of_hierarchy_levels in number,
561 is_directed in boolean,
562 node_with_cost in boolean,
563 is_complex in boolean,
564 topology in varchar2,
565 storage_parameters in varchar2 );
566
567 -----------------
568 -- @deprecated --
569 -----------------
570 PROCEDURE create_network(network IN VARCHAR2,
571 geom_type IN VARCHAR2,
572 no_of_hierarchy_levels IN NUMBER,
573 is_directed IN BOOLEAN,
574 node_table_name IN VARCHAR2,
575 node_geom_column IN VARCHAR2,
576 node_cost_column IN VARCHAR2,
577 link_table_name IN VARCHAR2,
578 link_geom_column IN VARCHAR2,
579 link_cost_column IN VARCHAR2,
580 lrs_table_name IN VARCHAR2,
581 lrs_geom_column IN VARCHAR2,
582 path_table_name IN VARCHAR2,
583 path_geom_column IN VARCHAR2,
584 path_link_table_name IN VARCHAR2,
585 subpath_table_name IN VARCHAR2,
586 subpath_geom_column IN VARCHAR2,
587 is_complex IN BOOLEAN DEFAULT FALSE,
588 storage_parameters IN VARCHAR2 DEFAULT '');
589
590 -----------------
591 -- @deprecated --
592 -----------------
593 -- create a general network creation
594 PROCEDURE create_network(network IN VARCHAR2,
595 geom_type IN VARCHAR2,
596 no_of_hierarchy_levels IN NUMBER,
597 is_directed IN BOOLEAN,
598 node_table_name IN VARCHAR2,
599 node_geom_column IN VARCHAR2,
600 node_cost_column IN VARCHAR2,
601 link_table_name IN VARCHAR2,
602 link_geom_column IN VARCHAR2,
603 link_cost_column IN VARCHAR2,
604 lrs_table_name IN VARCHAR2,
605 lrs_geom_column IN VARCHAR2,
606 path_table_name IN VARCHAR2,
607 path_geom_column IN VARCHAR2,
608 path_link_table_name IN VARCHAR2,
609 is_complex IN BOOLEAN DEFAULT FALSE,
610 storage_parameters IN VARCHAR2 DEFAULT '');
611
612
613 -----------------
614 -- @deprecated --
615 -----------------
616 -- create a general network creation
617 PROCEDURE create_network(network IN VARCHAR2,
618 geom_type IN VARCHAR2,
619 no_of_hierarchy_levels IN NUMBER,
620 is_directed IN BOOLEAN,
621 node_with_cost IN BOOLEAN,
622 lrs_table_name IN VARCHAR2,
623 lrs_geom_column IN VARCHAR2,
624 is_complex IN BOOLEAN DEFAULT FALSE,
625 storage_parameters IN VARCHAR2 DEFAULT '');
626
627
631
628 -- validate a network
629 FUNCTION validate_network(network IN VARCHAR2, check_data IN VARCHAR2 default 'FALSE')
630 RETURN VARCHAR2;
632 -- validate the table consistency of a network
633 FUNCTION validate_consistency(network IN VARCHAR2, is_fast IN VARCHAR2 default 'TRUE')
634 RETURN VARCHAR2;
635
636 -- create an empty node table with necessary columns
637 PROCEDURE create_node_table(table_name in varchar2,
638 geom_type in varchar2,
639 geom_column in varchar2,
640 cost_column in varchar2,
641 partition_column in varchar2,
642 no_of_hierarchy_levels in number,
643 is_complex in boolean default false,
644 storage_parameters in varchar2 default '');
645
646
647 -- create an empty node table with necessary columns
648 PROCEDURE create_node_table(table_name in varchar2,
649 geom_type in varchar2,
650 geom_column in varchar2,
651 cost_column in varchar2,
652 no_of_hierarchy_levels in number,
653 is_complex in boolean default false,
654 storage_parameters in varchar2 default '');
655
656
657
658 -- create an empty link table with necessary columns
659 PROCEDURE create_link_table(table_name in varchar2,
660 geom_type in varchar2,
661 geom_column in varchar2,
662 cost_column in varchar2,
663 no_of_hierarchy_levels in number,
664 add_bidirected_column in boolean default false,
665 storage_parameters in varchar2 default '');
666
667 -- create an empty compact path table with necessary columns
668 PROCEDURE create_path_table(table_name in varchar2, geom_column in varchar2,
669 storage_parameters IN VARCHAR2 DEFAULT '');
670 -- create an empty compact subpath table with necessary columns
671 PROCEDURE create_subpath_table(table_name in varchar2, geom_column in varchar2,
672 storage_parameters IN VARCHAR2 DEFAULT '');
673
674 -- create an empty compact path table with necessary columns
675 PROCEDURE create_path_link_table(table_name in varchar2,
676 storage_parameters IN VARCHAR2 DEFAULT '');
677
678 -- create an empty lrs geom table with necessary columns
679 PROCEDURE create_lrs_table(table_name in varchar2, geom_column in varchar2,
680 storage_parameters IN VARCHAR2 DEFAULT '');
681
682 -- create an empty partition table with necessary columns
683 PROCEDURE create_partition_table(table_name in varchar2);
684
685 -- create an empty partition blob table with necessary schema
686 PROCEDURE create_partition_blob_table(table_name in varchar2);
687
688 -- create an empty component table with necessary schema
689 PROCEDURE create_component_table(table_name in varchar2);
690
691 -- validate a node schema
692 FUNCTION validate_node_schema(network IN VARCHAR2)
693 RETURN VARCHAR2;
694
695 -- validate a link schema
696 FUNCTION validate_link_schema(network IN VARCHAR2)
697 RETURN VARCHAR2;
698
699 -- validate a path schema
700 FUNCTION validate_path_schema(network IN VARCHAR2)
701 RETURN VARCHAR2;
702
703 -- validate a subpath schema
704 FUNCTION validate_subpath_schema(network IN VARCHAR2)
705 RETURN VARCHAR2;
706
707 -- validate an lrs geom schema
708 FUNCTION validate_lrs_schema(network IN VARCHAR2)
709 RETURN VARCHAR2;
710
711 -- validate a partition table schema
712 FUNCTION validate_partition_schema(network IN VARCHAR2)
713 RETURN VARCHAR2;
714
715 -- validate necessary partition blob table schema and blob content
716 FUNCTION validate_partition_blob_schema(network IN VARCHAR2)
717 RETURN VARCHAR2;
718
719 -- validate necessary connected component schema
720 FUNCTION validate_component_schema(network IN VARCHAR2)
721 RETURN VARCHAR2;
722
723 --
724 -- drop a network
725 -- it drops :
726 -- node table, link table, and path table
727 -- network metadata
728 --
729
730 PROCEDURE drop_network(network in varchar2);
731
732 --
733 -- create a point geometry from an LRS geometry and a measure
734 --
735 FUNCTION get_lrs_node_geometry(network in VARCHAR2,
736 node_id in number)
737 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
738
739 --
740 -- create a point geometry from a topology
741 --
742 FUNCTION get_topo_node_geometry(network in VARCHAR2,
743 node_id in number)
744 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
745
746
747 --
751 node_id in number)
748 -- get the node geometry
749 --
750 FUNCTION get_node_geometry(network in VARCHAR2,
752 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
753
754
755 --
756 -- create linestring geometry from an LRS geometry and start/end measure
757 --
758 FUNCTION get_lrs_link_geometry(network in VARCHAR2,
759 link_id in number)
760
761 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
762
763 --
764 -- create linestring geometry from a topo geometry
765 --
766 FUNCTION get_topo_link_geometry(network in VARCHAR2,
767 link_id in number)
768
769 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
770
771
772 --
773 -- get the link geometry
774 --
775 FUNCTION get_link_geometry(network in VARCHAR2,
776 link_id in number,
777 start_percentage IN NUMBER default 0,
778 end_percentage IN NUMBER default 1.0)
779
780 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
781
782
783
784 --
785 -- network type queries
786 --
787 FUNCTION is_spatial(network IN VARCHAR2)
788 RETURN VARCHAR2;
789 PRAGMA RESTRICT_REFERENCES(is_spatial,WNDS,WNPS,RNPS);
790
791 FUNCTION is_logical(network IN VARCHAR2)
792 RETURN VARCHAR2;
793 PRAGMA RESTRICT_REFERENCES(is_logical,WNDS,WNPS,RNPS);
794
795 FUNCTION is_hierarchical(network IN VARCHAR2)
796 RETURN VARCHAR2;
797 PRAGMA RESTRICT_REFERENCES(is_hierarchical,WNDS,WNPS,RNPS);
798
799 -----------------
800 -- @deprecated --
801 -----------------
802 -- a simple network does not refer nodes/links in another networks
803 -- a complex network has the network_type anything other than 'COMPLEX'
804 -- before 10GR1, all networks are simple networks
805 FUNCTION is_simple(network IN VARCHAR2)
806 RETURN VARCHAR2;
807
808 -----------------
809 -- @deprecated --
810 -----------------
811 -- a complex network can refer nodes/links in another networks
812 -- a complex network has the network_type = 'COMPLEX'
813 -- after 10GR2, a network can refer nodes/links in other networks (network_id, and element_id)
814 FUNCTION is_complex(network IN VARCHAR2)
815 RETURN VARCHAR2;
816 PRAGMA RESTRICT_REFERENCES(is_complex,WNDS,WNPS,RNPS);
817
818 FUNCTION is_simple(network IN VARCHAR2,path_id in number)
819 RETURN VARCHAR2;
820
821 FUNCTION is_link_in_path(network IN VARCHAR2,path_id in number, link_id in number)
822 RETURN VARCHAR2;
823
824 FUNCTION is_node_in_path(network IN VARCHAR2,path_id in number,node_id in number)
825 RETURN VARCHAR2;
826
827
828 FUNCTION sdo_geometry_network(network IN VARCHAR2)
829 RETURN VARCHAR2;
830 PRAGMA RESTRICT_REFERENCES(sdo_geometry_network,WNDS,WNPS,RNPS);
831
832 FUNCTION lrs_geometry_network(network IN VARCHAR2)
833 RETURN VARCHAR2;
834 PRAGMA RESTRICT_REFERENCES(lrs_geometry_network,WNDS,WNPS,RNPS);
835
836 FUNCTION topo_geometry_network(network IN VARCHAR2)
837 RETURN VARCHAR2;
838 PRAGMA RESTRICT_REFERENCES(topo_geometry_network,WNDS,WNPS,RNPS);
839
840
841
842 --
843 -- copy network structure
844 --
845
846 PROCEDURE copy_network(source_network in varchar2,
847 target_network in varchar2,
848 storage_parameters in varchar2 default '');
849
850
851 --
852 -- create delete trigger on node/link table
853 --
854
855 PROCEDURE create_delete_trigger(network in varchar2);
856
857
858 -- return the hierarchy_level of a node
859 FUNCTION get_node_hierarchy_level(network IN VARCHAR2, node_id in number)
860 RETURN NUMBER;
861
862
863 --
864 -- add referential constraints
865 --
866
867 PROCEDURE create_ref_constraints(network IN VARCHAR2);
868
869 --
870 -- drop referential constraints
871 --
872
873 PROCEDURE drop_ref_constraints(network IN VARCHAR2);
874
875 --
876 -- enable referential constraints
877 --
878
879 PROCEDURE enable_ref_constraints(network IN VARCHAR2);
880
881
882 --
883 -- disable referential constraints
884 --
885
886 PROCEDURE disable_ref_constraints(network IN VARCHAR2);
887
888
889
890 --
891 -- add an geometry metadata entry
892 --
893
894 PROCEDURE insert_geom_metadata(geom_table_name IN VARCHAR2,
895 geom_column_name IN VARCHAR2,
896 diminfo IN MDSYS.SDO_DIM_ARRAY,
897 srid IN NUMBER);
898 --PRAGMA RESTRICT_REFERENCES(insert_geom_metadata,WNPS,RNPS);
899
900
901 --
902 -- add geometry metadata entries for a spatial network
903 --
904
905 PROCEDURE insert_geom_metadata(network IN VARCHAR2,
906 diminfo IN MDSYS.SDO_DIM_ARRAY,
910
907 srid IN NUMBER);
908 --PRAGMA RESTRICT_REFERENCES(insert_geom_metadata,WNPS,RNPS);
909
911
912 --
913 -- return the ids of isolated nodes
914 --
915
916 FUNCTION get_isolated_nodes(network IN VARCHAR2)
917 RETURN SDO_NUMBER_ARRAY DETERMINISTIC ;
918
919 --
920 -- return the ids of invalid nodes
921 --
922
923 FUNCTION get_invalid_nodes(network IN VARCHAR2)
924 RETURN SDO_NUMBER_ARRAY DETERMINISTIC ;
925
926
927 --
928 -- return the ids of invalid links
929 --
930
931 FUNCTION get_invalid_links(network IN VARCHAR2)
932 RETURN SDO_NUMBER_ARRAY DETERMINISTIC ;
933
934 --
935 -- return the ids of invalid paths
936 --
937
938 FUNCTION get_invalid_paths(network IN VARCHAR2)
939 RETURN SDO_NUMBER_ARRAY DETERMINISTIC ;
940
941
942 -----------------
943 -- @deprecated --
944 -----------------
945 --
946 -- add path-link information to the path-link table
947 -- the seq no is indicated by the order in the given link array
948 --
949 PROCEDURE insert_path_link_info(network IN VARCHAR2,
950 path_id IN NUMBER,
951 links IN SDO_NUMBER_ARRAY,
952 is_simple IN BOOLEAN DEFAULT TRUE) ;
953
954
955 --
956 -- delete a node from a network
957 --
958 --
959 PROCEDURE delete_node(network IN VARCHAR2,
960 node_id IN NUMBER) ;
961
962 --
963 -- delete a link from a network
964 --
965 --
966 PROCEDURE delete_link(network IN VARCHAR2,
967 link_id IN NUMBER) ;
968
969
970 --
971 -- delete a path from a network
972 --
973 --
974 PROCEDURE delete_path(network IN VARCHAR2,
975 path_id IN NUMBER) ;
976
977
978 --
979 -- delete a subpath from a network
980 --
981 --
982 PROCEDURE delete_subpath(network IN VARCHAR2,
983 subpath_id IN NUMBER) ;
984
985 -----------------
986 -- @deprecated --
987 -----------------
988 --
989 -- change a spatial network into a logical network (Metadata Level)
990 --
991 --
992 PROCEDURE switch_to_logical_network(network IN VARCHAR2);
993 PRAGMA RESTRICT_REFERENCES(switch_to_logical_network,WNPS,RNPS);
994
995 -----------------
996 -- @deprecated --
997 -----------------
998 --
999 -- change a logical network into a spatial network (Metadata Level)
1000 --
1001 --
1002 PROCEDURE switch_to_spatial_network(network IN VARCHAR2,
1003 node_geom_col IN VARCHAR2,
1004 link_geom_col IN VARCHAR2,
1005 path_geom_col IN VARCHAR2,
1006 subpath_geom_col IN VARCHAR2);
1007
1008
1009 -----------------------------------------------------
1010 -- @deprecated: use network metadata views instead --
1011 -----------------------------------------------------
1012 -- return the topology of a topology network
1013 FUNCTION get_topology(network IN VARCHAR2)
1014 RETURN VARCHAR2;
1015 PRAGMA RESTRICT_REFERENCES(get_topology,WNDS,WNPS,RNPS);
1016
1017 -- compute the geometry of a path from its constituent link geometries
1018 FUNCTION compute_path_geometry(network IN VARCHAR2,
1019 path_id IN NUMBER,
1020 tolerance IN NUMBER)
1021 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
1022
1023 -- Partition the nodes in the network and write the result into the
1024 -- partition table.
1025 PROCEDURE spatial_partition(network IN VARCHAR2,
1026 partition_table_name IN VARCHAR2,
1027 max_num_nodes IN NUMBER,
1028 log_loc IN VARCHAR2,
1029 log_file IN VARCHAR2,
1030 open_mode IN VARCHAR2 DEFAULT 'a',
1031 link_level IN INTEGER DEFAULT 1);
1032
1033 -- Generate or regenerate blobs for all the partitions.
1034 -- @param regenerate_node_levels whether to overwrite existing node level table.
1035 -- Set to true if there are nodes added/deleted to/from second or higher
1036 -- link levels, since the last time blobs were generated.
1037 PROCEDURE generate_partition_blobs(
1038 network IN VARCHAR2,
1039 link_level IN NUMBER DEFAULT 1,
1040 partition_blob_table_name IN VARCHAR2,
1041 include_user_data IN BOOLEAN,
1042 commit_for_each_blob IN BOOLEAN DEFAULT true,
1043 log_loc IN VARCHAR2,
1044 log_file IN VARCHAR2,
1045 open_mode IN VARCHAR2 DEFAULT 'a',
1046 perform_delta_update IN BOOLEAN DEFAULT false,
1050 -- into the partition blob table
1047 regenerate_node_levels IN BOOLEAN DEFAULT false);
1048
1049 -- generate or regenerate the blob for the specified partition
1051 -- assumption: partition blob table already exists
1052 PROCEDURE generate_partition_blob(
1053 network IN VARCHAR2,
1054 link_level IN NUMBER DEFAULT 1,
1055 partition_id IN NUMBER,
1056 include_user_data IN BOOLEAN,
1057 log_loc IN VARCHAR2,
1058 log_file IN VARCHAR2,
1059 open_mode IN VARCHAR2 DEFAULT 'a',
1060 perform_delta_update IN BOOLEAN DEFAULT false);
1061
1062 -- Find connected components for the network on the specified link level,
1063 -- and store node_id component_id relation into the component table.
1064 PROCEDURE find_connected_components(
1065 network IN VARCHAR2,
1066 link_level IN NUMBER DEFAULT 1,
1067 component_table_name IN VARCHAR2,
1068 log_loc IN VARCHAR2,
1069 log_file IN VARCHAR2,
1070 open_mode IN VARCHAR2 DEFAULT 'a');
1071
1072 -- Sets the maximum java heap size for the java stored procedure.
1073 PROCEDURE set_max_java_heap_size(bytes NUMBER);
1074
1075 -- Sets the logging level for both the plsql subprograms and
1076 -- the java stored procedure.
1077 PROCEDURE set_logging_level( level IN NUMBER );
1078
1079 -- Returns the logging level
1080 FUNCTION get_logging_level RETURN NUMBER;
1081
1082 -- Loads the configuration xml for the java stored procedure.
1083 PROCEDURE load_config( file_directory IN VARCHAR2 ,
1084 file_name IN VARCHAR2 );
1085
1086 -- return the partition size in bytes
1087 FUNCTION get_partition_size(network IN VARCHAR2,
1088 partition_id IN NUMBER,
1089 link_level IN NUMBER DEFAULT 1,
1090 include_user_data IN VARCHAR2 DEFAULT 'FALSE',
1091 include_spatial_data IN VARCHAR2 DEFAULT 'FALSE')
1092 RETURN NUMBER;
1093
1094 --- register given network constraint into user_sdo_network_constraints
1095 PROCEDURE register_constraint(
1096 constraint_name VARCHAR2, class_name VARCHAR2,
1097 directory_name VARCHAR2, description VARCHAR2);
1098
1099 --- deregister given constraint from user_sdo_network_constraints
1100 PROCEDURE deregister_constraint(
1101 constraint_name VARCHAR2);
1102
1103 -- clear the content of the given network's related history tables
1104 PROCEDURE db_sync_clear(network IN VARCHAR2);
1105
1106 -- disable database synchronization option for the given network
1107 PROCEDURE db_sync_disable(network IN VARCHAR2);
1108
1109 -- enable database synchronization option for the given network
1110 PROCEDURE db_sync_enable(network IN VARCHAR2, base_node_table IN VARCHAR2 default NULL,
1111 base_link_table IN VARCHAR2 default NULL);
1112
1113 -- for the given network and link level, get updates between the given
1114 -- timestamp and the current largest timestamp recorded
1115 FUNCTION db_sync_get_update(network IN VARCHAR2, last_get_time IN TIMESTAMP,
1116 node_change_history OUT SDO_NET_UPD_HIST_NTBL,
1117 link_change_history OUT SDO_NET_UPD_HIST_TBL)
1118 RETURN TIMESTAMP;
1119
1120 -- the variant using the cursor to facilitate the calls made by JDBC
1121 FUNCTION db_sync_get_update(network IN VARCHAR2, last_get_time IN TIMESTAMP,
1122 node_change_history OUT ref_cursor,
1123 link_change_history OUT ref_cursor)
1124 RETURN TIMESTAMP;
1125
1126 --- register given java object into user_sdo_network_java_objects
1127 PROCEDURE register_java_object(
1128 name VARCHAR2, class_name VARCHAR2,
1129 directory_name VARCHAR2, description VARCHAR2, java_interface VARCHAR2);
1130
1131 --- deregister given java object from user_sdo_network_java_objects
1132 PROCEDURE deregister_java_object(
1133 name VARCHAR2);
1134 --- validate lod partition information
1135 FUNCTION validate_partition_info(network IN VARCHAR2,check_data IN VARCHAR2 default 'FALSE')
1136 RETURN VARCHAR2;
1137
1138 -- return the percentage of the given pt geometry from the start of the linestring geometry
1139 -- if the pt geometry is not on the link geometry, the nearest pt on the link geometry is used
1140 -- percentage is between [0,1]
1141 FUNCTION get_percentage(network IN VARCHAR2, link_id IN NUMBER, pt_geom IN mdsys.sdo_geometry)
1142 RETURN NUMBER;
1143
1144
1145 -- return the pt geometry on the givne link geometry based on the given percentage
1146 -- if the pt geometry is not on the link geometry, the nearest pt on the link geometry is used
1147 -- valid percentage is between [0,1]
1148 FUNCTION get_pt(network IN VARCHAR2, link_id IN NUMBER, percentage IN NUMBER)
1152 -- valid percentage is between [0,1]
1149 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
1150
1151 -- return the geometry on the givne link geometry based on the given percentages
1153 FUNCTION get_geometry(network IN VARCHAR2, link_id IN NUMBER, start_percentage IN NUMBER, end_percentage IN NUMBER)
1154 RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC PARALLEL_ENABLE;
1155
1156 -- Generates node levels for the specified multi-level network.
1157 -- If the the input network is single level, do nothing.
1158 -- @param overwrite: whether to overwrite existing node level table or not
1159 PROCEDURE generate_node_levels(
1160 network in varchar2,
1161 node_level_table_name in varchar2,
1162 overwrite in boolean default false,
1163 log_loc IN VARCHAR2,
1164 log_file IN VARCHAR2,
1165 open_mode IN VARCHAR2 DEFAULT 'a');
1166
1167 -- Make sure the data in the newwork tables are consistent.
1168 PROCEDURE update_consistency(network in VARCHAR2);
1169
1170 -- create the logical network partitions on node table
1171 PROCEDURE logical_partition(network IN VARCHAR2,
1172 partition_table_name IN VARCHAR2,
1173 max_num_nodes IN NUMBER,
1174 log_loc IN VARCHAR2,
1175 log_file IN VARCHAR2,
1176 open_mode IN VARCHAR2 DEFAULT 'a',
1177 link_level IN INTEGER DEFAULT 1);
1178
1179 -- Create logical network partitions on node table
1180 -- with focus on minimizing partition degree
1181 PROCEDURE logical_partition(network IN VARCHAR2,
1182 partition_table_name IN VARCHAR2,
1183 max_num_nodes IN NUMBER,
1184 log_loc IN VARCHAR2,
1185 log_file IN VARCHAR2,
1186 open_mode IN VARCHAR2 DEFAULT 'a',
1187 link_level IN INTEGER DEFAULT 1,
1188 part_size_tolerance IN NUMBER);
1189
1190 PROCEDURE logical_powerlaw_partition(network IN VARCHAR2,
1191 partition_table_name IN VARCHAR2,
1192 max_num_nodes IN NUMBER,
1193 log_loc IN VARCHAR2,
1194 log_file IN VARCHAR2,
1195 open_mode IN VARCHAR2 default 'a',
1196 link_level IN INTEGER default 1,
1197 part_size_tolerance IN NUMBER default 0);
1198
1199
1200 -- Returns the ordinate of a point geometry given the ordinate index
1201 -- the point geometry can be a 2d standard geometry or an LRS geometry
1202
1203 FUNCTION get_pt_geom_ord(geometry IN MDSYS.SDO_GEOMETRY, idx IN INTEGER)
1204 RETURN NUMBER;
1205
1206
1207 ----------------------------
1208 -- BEGIN Feature Modeling --
1209 ----------------------------
1210
1211 FUNCTION GET_FEATURE_LAYER_ID(
1212 network_name IN VARCHAR2,
1213 feature_layer_name IN VARCHAR2)
1214 RETURN NUMBER;
1215
1216 -- Adds a feature layer.
1217 -- A feature layer ID will be automatically generated
1218 -- for the feature layer.
1219 PROCEDURE ADD_FEATURE_LAYER(
1220 network_name IN VARCHAR2,
1221 feature_layer_name IN VARCHAR2,
1222 feature_layer_type IN NUMBER,
1223 feature_table IN VARCHAR2,
1224 relation_table IN VARCHAR2,
1225 hierarchy_table IN VARCHAR2);
1226
1227 -- Drops a feature layer.
1228 -- @param drop_tables If set to false, then only the feature
1229 -- layer metadata will be deleted. All the
1230 -- relevant tables will remain untouched.
1231 -- If set to true, then all relevant tables,
1232 -- including feature table, relation table
1233 -- and hierarchy table, will be dropped.
1234 PROCEDURE DROP_FEATURE_LAYER(
1235 network_name IN VARCHAR2,
1236 feature_layer_name IN VARCHAR2,
1237 drop_tables IN BOOLEAN DEFAULT FALSE);
1238
1239 -- Adds a feature to the input feature layer.
1240 PROCEDURE ADD_FEATURE(
1241 feature_layer_id IN NUMBER,
1242 feature_id IN NUMBER,
1243 feature_elements IN SDO_NET_FEAT_ELEM_ARRAY DEFAULT NULL,
1244 child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY DEFAULT NULL,
1245 check_integrity IN BOOLEAN DEFAULT TRUE);
1246
1247 -- Adds a feature element to the input feature.
1248 -- The input feature element will be appended to the end of the
1249 -- existing feature elements in the feature.
1250 PROCEDURE ADD_FEATURE_ELEMENT(
1251 feature_layer_id IN NUMBER,
1252 feature_id IN NUMBER,
1253 feature_element IN SDO_NET_FEAT_ELEM,
1254 sequence_number IN NUMBER DEFAULT NULL,
1255 check_integrity IN BOOLEAN DEFAULT TRUE);
1256
1257 -- Adds an array of feature elements to a feature.
1258 -- The input feature elements will be appended to the end of the
1259 -- existing feature elements in the feature.
1260 PROCEDURE ADD_FEATURE_ELEMENTS(
1261 feature_layer_id IN NUMBER,
1262 feature_id IN NUMBER,
1263 feature_elements IN SDO_NET_FEAT_ELEM_ARRAY,
1264 check_integrity IN BOOLEAN DEFAULT TRUE);
1265
1266 -- Adds a child feature. This precedure assumes that the child feature
1267 -- already exists.
1268 PROCEDURE ADD_CHILD_FEATURE(
1269 parent_layer_id IN NUMBER,
1270 parent_feature_id IN NUMBER,
1271 child_layer_id IN NUMBER,
1272 child_feature_id IN NUMBER,
1273 sequence_number IN NUMBER DEFAULT NULL,
1274 check_integrity IN BOOLEAN DEFAULT TRUE);
1275
1279 parent_layer_id IN NUMBER,
1276 -- Adds child features. This procedure assumes that the child features
1277 -- already exist.
1278 PROCEDURE ADD_CHILD_FEATURES(
1280 parent_feature_id IN NUMBER,
1281 child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY,
1282 check_integrity IN BOOLEAN DEFAULT TRUE);
1283
1284 -- Deletes the input feature elements from the feature.
1285 PROCEDURE DELETE_FEATURE_ELEMENTS(
1286 feature_layer_id IN NUMBER,
1287 feature_id IN NUMBER,
1288 feature_elements IN SDO_NET_FEAT_ELEM_ARRAY,
1289 delete_net_elems IN BOOLEAN DEFAULT FALSE);
1290
1291 -- Deletes the feature elements at the given sequence numbers.
1292 PROCEDURE DELETE_FEATURE_ELEMENTS_AT(
1293 feature_layer_id IN NUMBER,
1294 feature_id IN NUMBER,
1295 sequence_numbers IN SDO_NUMBER_ARRAY,
1296 delete_net_elems IN BOOLEAN DEFAULT FALSE);
1297
1298 -- Remove the parent-child relationship for the input child features.
1299 PROCEDURE DELETE_CHILD_FEATURES(
1300 parent_layer_id IN NUMBER,
1301 parent_feature_id IN NUMBER,
1302 child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY);
1303
1304 -- Remove the parent-child relationship for the child features
1305 -- at the given sequence numbers.
1306 PROCEDURE DELETE_CHILD_FEATURES_AT(
1307 parent_layer_id IN NUMBER,
1308 parent_id IN NUMBER,
1309 sequence_numbers IN SDO_NUMBER_ARRAY);
1310
1311 -- Deletes the features with the given feature IDs.
1312 -- If delete_net_elems is set to true, then all network elements
1313 -- that are referenced only by the input features are also deleted.
1314 -- If delete_children is set to true, then all child features
1315 -- that are referenced only by the input features are also deleted.
1316 PROCEDURE DELETE_FEATURES(
1317 feature_layer_id IN NUMBER,
1318 feature_ids IN SDO_NUMBER_ARRAY,
1319 delete_net_elems IN BOOLEAN DEFAULT FALSE,
1320 delete_children IN BOOLEAN DEFAULT FALSE);
1321
1322 -- Deletes the dangling features in the given feature layer.
1323 -- A dangling feature is a feature ths is not associated with any
1324 -- network elements.
1325 PROCEDURE DELETE_DANGLING_FEATURES(
1326 feature_layer_id IN NUMBER);
1327
1328 -- Returns the IDs of the dangling features.
1329 -- A dangling feature is a feature ths is not associated with any
1330 -- network elements.
1331 FUNCTION GET_DANGLING_FEATURES(
1332 feature_layer_id IN NUMBER)
1333 RETURN SDO_NUMBER_ARRAY;
1334
1335 -- Deletes the phantom features in the given feature layer.
1336 -- A phantom feature is a feature that references nonexistent
1337 -- network elements.
1338 PROCEDURE DELETE_PHANTOM_FEATURES(
1339 feature_layer_id IN NUMBER);
1340
1341 -- Returns the IDs of the phantom features.
1342 -- A phantom feature is a feature that references nonexistent
1343 -- network elements.
1344 FUNCTION GET_PHANTOM_FEATURES(
1345 feature_layer_id IN NUMBER)
1346 RETURN SDO_NUMBER_ARRAY;
1347
1348 -- Returns the nodes that are not referenced by
1349 -- any feature in any feature layer.
1350 FUNCTION GET_DANGLING_NODES(
1351 network IN VARCHAR2)
1352 RETURN SDO_NUMBER_ARRAY;
1353
1354 -- Returns the links that are not referenced by
1355 -- any feature in any feature layer.
1356 FUNCTION GET_DANGLING_LINKS(
1357 network IN VARCHAR2)
1358 RETURN SDO_NUMBER_ARRAY;
1359
1360 -- Deletes the network nodes that are not referenced by
1361 -- any feature in any feature layer.
1362 PROCEDURE DELETE_DANGLING_NODES(
1363 network IN VARCHAR2);
1364
1365 -- Deletes the network links that are not referenced by
1366 -- any feature in any feature layer.
1367 PROCEDURE DELETE_DANGLING_LINKS(
1368 network IN VARCHAR2);
1369
1370 -- Returns the IDs of the features that references the given nodes.
1371 FUNCTION GET_FEATURES_ON_NODES(
1372 feature_layer_id IN NUMBER,
1373 node_ids IN SDO_NUMBER_ARRAY)
1374 RETURN SDO_NUMBER_ARRAY;
1375
1376 -- Returns the IDs of the features that references the given links.
1377 FUNCTION GET_FEATURES_ON_LINKS(
1378 feature_layer_id IN NUMBER,
1379 link_ids IN SDO_NUMBER_ARRAY)
1380 RETURN SDO_NUMBER_ARRAY;
1381
1382 -- Returns the feature layer ID and feature ID of the child features.
1383 FUNCTION GET_CHILD_FEATURE_IDS(
1384 feature_layer_id IN NUMBER,
1385 feature_id IN NUMBER
1386 )
1387 RETURN SDO_NET_LAYER_FEAT_ARRAY;
1388
1389 -- Returns the feature layer ID and feature ID of the parent features.
1390 FUNCTION GET_PARENT_FEATURE_IDS(
1391 feature_layer_id IN NUMBER,
1392 feature_id IN NUMBER
1393 )
1394 RETURN SDO_NET_LAYER_FEAT_ARRAY;
1395
1396 -- Updates the feature elements, child features and/or feature
1397 -- user data.
1398 -- @param feature_elements new feature elements. If null, then the existing
1399 -- feature elements are left unchanged. If empty, then
1400 -- the existing feature elements are removed.
1401 -- @param child_features new child features. If null, then the existing
1402 -- child features are left unchanged. If empty, then
1403 -- relationship with the existing child features are removed.
1404 PROCEDURE UPDATE_FEATURE(
1405 feature_layer_id IN NUMBER,
1406 feature_id IN NUMBER,
1407 feature_elements IN SDO_NET_FEAT_ELEM_ARRAY DEFAULT NULL,
1408 child_feature_ids IN SDO_NET_LAYER_FEAT_ARRAY DEFAULT NULL,
1409 check_integrity IN BOOLEAN DEFAULT TRUE);
1410
1411 -- Updates the feature element at the given sequence number.
1412 PROCEDURE UPDATE_FEATURE_ELEMENT(
1413 feature_layer_id IN NUMBER,
1414 feature_id IN NUMBER,
1415 sequence_number IN NUMBER,
1416 feature_element IN SDO_NET_FEAT_ELEM,
1417 check_integrity IN BOOLEAN DEFAULT TRUE);
1418
1419 -- Returns the feature elements in the given feature.
1420 FUNCTION GET_FEATURE_ELEMENTS(
1421 feature_layer_id IN NUMBER,
1422 feature_id IN NUMBER)
1423 RETURN SDO_NET_FEAT_ELEM_ARRAY;
1424
1425 ----------------------------
1426 -- END Feature Modeling --
1427 ----------------------------
1428
1429 -- Create and/or populate link table in parent network based on
1430 -- the content of the hierarchy table
1431 PROCEDURE GENERATE_PARENT_LINK_TABLE(
1432 parent_network IN VARCHAR2,
1433 cost_function IN VARCHAR2);
1434
1435 -- Find the child link IDs on the given link level of the child network
1436 FUNCTION GET_LINKS_IN_CHILD_NETWORK(
1437 network IN VARCHAR2,
1438 link_id IN NUMBER)
1439 RETURN SDO_NUMBER_ARRAY;
1440
1441 -- Find the child node IDs on the given link level of the child network
1442 FUNCTION GET_NODES_IN_CHILD_NETWORK(
1443 network IN VARCHAR2,
1444 node_id IN NUMBER)
1445 RETURN SDO_NUMBER_ARRAY;
1446
1447 -- Sends xml requests to the given URL, and returns the xml response.
1448 FUNCTION POST_XML(
1449 url IN VARCHAR2,
1450 request IN XMLTYPE)
1451 RETURN XMLTYPE;
1452
1453 -- Checks if the network (spatial network) is geodetic('TRUE'), 'FALSE' otherwise
1454 -- Return NULL if the network is logical
1455
1456 FUNCTION is_geodetic(network IN VARCHAR2)
1457 RETURN VARCHAR2;
1458
1459
1460 -- This function checks whether the input link interval
1461 -- covers given point on the same link.
1462 -- It returns 'TRUE' if the point is covered by the link
1463 -- interval; 'FALSE' otherwise.
1464 FUNCTION is_covered_by_link_interval(
1465 query_percentage IN NUMBER,
1466 interval_start_percentage IN NUMBER,
1467 interval_end_percentage IN NUMBER)
1468 RETURN VARCHAR2;
1469
1470
1471 -- Returns the cost from (to) network buffer center to (from) the query point
1472 -- based on the start and end costs of the link interval defined on
1473 -- the same link as the query point.
1474 -- Returns null if not covered.
1475 FUNCTION get_buffer_cost(
1476 query_percentage IN NUMBER,
1477 interval_start_percentage IN NUMBER,
1478 interval_end_percentage IN NUMBER,
1479 interval_start_cost IN NUMBER,
1480 interval_end_cost IN NUMBER)
1481 RETURN NUMBER;
1482
1483 END sdo_net;