1 PACKAGE SDO_GEOR_AGGR AUTHID CURRENT_USER AS
2
3 --
4 -- NAME:
5 -- mosaicSubset procedure
6 --
7 -- DESCRIPTION
8 -- Subset from a set of source georaster objects.
9 --
10 -- ARGUMENTS
11 -- inGeoRasters - The input source georaster objects in a cursor.
12 -- pyramidLevel - The pyramid level, if NULL and outResolution is
13 -- specified, use the outResolution to determine the
14 -- pyramidLevel, otherwise defaults to 0.
15 -- outSRID - The output georaster data's SRID.
16 -- outModelCoordLoc - The output georaster data's model coordinate
17 -- location. If NULL, defaults to CENTER.
18 -- referencePoint - The reference point of the mosaic. The mosaic result
19 -- will align with this reference point. If this is
20 -- null, the reference point implicitly uses the
21 -- upper left corner of the cropArea, or when the
22 -- cropArea is null, the upper left corner of the
23 -- output extent.
24 -- This reference point must be in a SDO_GEOMETRY that
25 -- describes a point.
26 -- cropArea - The output georaster data's window. If the
27 -- sdo_geometry object has srid, the source georaster
28 -- objects must be georeferenced, otherwise, the source
29 -- georaster object can be georeferenced or non-
30 -- georeferenced.
31 -- polygonClip - Whether to do polygon clipping. If NULL, defaults
32 -- to FALSE.
33 -- boundaryClip - Whether to use the source data boundary to clip the
34 -- cropArea. If false, the outside the source
35 -- data area is filled with background value. If NULL,
36 -- defaults to TRUE.
37 -- layerNumbers - The layer numbers from the source georasters. If
38 -- NULL, empty or has value of '0', all layers are
39 -- included.
40 -- outResolutions - Output georaster data's resolution. If NULL, defaults
41 -- to the source data's resolution at the given
42 -- pyramid level.
43 -- resolutionUnit - The unit of the output resolution. If NULL, defaults
44 -- to the unit of the output SRID. If outResolutions is
45 -- NULL, this parameter is ignored. It must be in format
46 -- of "unit=val" where val is the unit name.
47 -- mosaicParam - The parameter related to mosaic
48 -- storageParam - The storage parameter
49 -- outGeoRaster - The output georaster object.
50 -- bgValues - The background values for sparse data
51 -- parallelParam - The parameter related to parallel processing.
52 -- Currently we only support
53 -- "parallel=DEFAULT": The database computes
54 -- the degree of parallelism, which can be 2 or
55 -- greater.
56 -- "parallel=n": where n>1 is the degree of parallel.
57 -- The database optimizer uses the degree of
58 -- parallelism specified by n
59 -- By default when this parameter is null, there is
60 -- no parallel processing.
61 --
62 -- RETURNS
63 --
64 PROCEDURE mosaicSubset(
65 inGeoRasters IN SYS_REFCURSOR,
66 pyramidLevel IN NUMBER,
67 outSRID IN NUMBER,
68 outModelCoordLoc IN NUMBER,
69 referencePoint IN MDSYS.SDO_GEOMETRY,
70 cropArea IN MDSYS.SDO_GEOMETRY,
71 polygonClip IN VARCHAR2,
72 boundaryClip IN VARCHAR2,
73 layerNumbers IN VARCHAR2,
74 outResolutions IN MDSYS.SDO_NUMBER_ARRAY,
75 resolutionUnit IN VARCHAR2,
76 mosaicParam IN VARCHAR2,
77 storageParam IN VARCHAR2,
78 outGeoRaster IN OUT MDSYS.SDO_GEORASTER,
79 bgValues IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL,
80 parallelParam IN VARCHAR2 DEFAULT NULL
81 );
82
83 --
84 -- NAME:
85 -- mosaicSubset procedure
86 --
87 -- DESCRIPTION
88 -- Subset from a set of source georaster objects.
89 --
90 -- ARGUMENTS
91 -- georasterTableNames - The table names of the input georaster objects
92 -- georasterColumnNames - The column names of the input georaster objects
93 -- pyramidLevel - The pyramid level, if NULL and outResolution is
94 -- specified, use the outResolution to determine the
95 -- pyramidLevel, otherwise defaults to 0.
96 -- outSRID - The output georaster data's SRID.
97 -- outModelCoordLoc - The output georaster data's model coordinate
98 -- location. If NULL, defaults to CENTER.
99 -- referencePoint - The reference point of the mosaic. The mosaic result
100 -- will align with this reference point. If this is
101 -- null, the reference point implicitly uses the
102 -- upper left corner of the cropArea, or when the
103 -- cropArea is null, the upper left corner of the
104 -- output extent.
105 -- This reference point must be in a SDO_GEOMETRY that
106 -- describes a point.
107 -- cropArea - The output georaster data's window. If the
108 -- sdo_geometry object has srid, the source georaster
109 -- objects must be georeferenced, otherwise, the source
110 -- georaster object can be georeferenced or non-
111 -- georeferenced.
112 -- polygonClip - Whether to do polygon clipping. If NULL, defaults
113 -- to FALSE.
114 -- boundaryClip - Whether to use the source data boundary to clip the
115 -- cropArea. If false, the outside the source
116 -- data area is filled with background value. If NULL,
117 -- defaults to TRUE.
118 -- layerNumbers - The layer numbers from the source georasters. If
119 -- NULL, empty or has value of '0', all layers are
120 -- included.
121 -- outResolutions - Output georaster data's resolution. If NULL, defaults
122 -- to the source data's resolution at the given
123 -- pyramid level.
124 -- resolutionUnit - The unit of the output resolution. If NULL, defaults
125 -- to the unit of the output SRID. If outResolutions is
126 -- NULL, this parameter is ignored.It must be in format
127 -- of "unit=val" where val is the unit name.
128 -- mosaicParam - The parameter related to mosaic
129 -- storageParam - The storage parameter
130 -- outGeoRaster - The output georaster object.
131 -- bgValues - The background values for sparse data
132 -- parallelParam - The parameter related to parallel processing.
133 -- Currently we only support
134 -- "parallel=DEFAULT": The database computes
135 -- the degree of parallelism, which can be 2 or
136 -- greater.
137 -- "parallel=n": where n>1 is the degree of parallel.
138 -- The database optimizer uses the degree of
139 -- parallelism specified by n
140 -- By default when this parameter is null, there is
141 -- no parallel processing.
142 --
143 -- RETURNS
144 --
145 PROCEDURE mosaicSubset(
146 georasterTableNames IN VARCHAR2,
147 georasterColumnNames IN VARCHAR2,
148 pyramidLevel IN NUMBER,
149 outSRID IN NUMBER,
150 outModelCoordLoc IN NUMBER,
151 referencePoint IN MDSYS.SDO_GEOMETRY,
152 cropArea IN MDSYS.SDO_GEOMETRY,
153 polygonClip IN VARCHAR2,
154 boundaryClip IN VARCHAR2,
155 layerNumbers IN VARCHAR2,
156 outResolutions IN MDSYS.SDO_NUMBER_ARRAY,
157 resolutionUnit IN VARCHAR2,
158 mosaicParam IN VARCHAR2,
159 storageParam IN VARCHAR2,
160 outGeoRaster IN OUT MDSYS.SDO_GEORASTER,
161 bgValues IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL,
162 parallelParam IN VARCHAR2 DEFAULT NULL
163 );
164
165 --
166 -- NAME:
167 -- getMosaicSubset procedure
168 --
169 -- DESCRIPTION
170 -- Subset from a set of source georaster objects.
171 --
172 -- ARGUMENTS
173 -- inGeoRasters - The input source georaster objects in a cursor.
174 -- pyramidLevel - The pyramid level, if NULL and outResolution is
175 -- specified, use the outResolution to determine the
176 -- pyramidLevel, otherwise defaults to 0.
177 -- outSRID - The output georaster data's SRID.
178 -- outModelCoordLoc - The output georaster data's model coordinate
179 -- location. If NULL, defaults to CENTER.
180 -- referencePoint - The reference point of the mosaic. The mosaic result
181 -- will align with this reference point. If this is
182 -- null, the reference point implicitly uses the
183 -- left upper corner of the cropArea, or when the
184 -- cropArea is null, the upper corner of the outArea.
185 -- This reference point must be in a SDO_GEOMETRY that
186 -- describes a point.
187 -- cropArea - The output georaster data's window. If the
188 -- sdo_geometry object has srid, the source georaster
192 -- polygonClip - Whether to do polygon clipping. If NULL, defaults
189 -- objects must be georeferenced, otherwise, the source
190 -- georaster object can be georeferenced or non-
191 -- georeferenced.
193 -- to FALSE.
194 -- boundaryClip - Whether to use the source data boundary to clip the
195 -- cropArea. If false, the outside the source
196 -- data area is filled with background value. If NULL,
197 -- defaults to TRUE.
198 -- layerNumbers - The layer numbers from the source georasters. If
199 -- NULL, empty or has value of '0', all layers are
200 -- included.
201 -- outResolutions - Output georaster data's resolution. If NULL, defaults
202 -- to the source data's resolution at the given
203 -- pyramid level.
204 -- resolutionUnit - The unit of the output resolution. If NULL, defaults
205 -- to the unit of output SRID. If outResolutions is
206 -- NULL, this parameter is ignored.It must be in format
207 -- of "unit=val" where val is the unit name.
208 -- mosaicParam - The parameter related to mosaic
209 -- rasterBlob - The output Lob
210 -- outArea - The output area in model space
211 -- outWindow - The output window in cell space
212 -- storageParam - The storage parameter
213 -- bgValues - The background values for sparse data
214 --
215 -- RETURNS
216 --
217 PROCEDURE getMosaicSubset(
218 inGeoRasters IN SYS_REFCURSOR,
219 pyramidLevel IN NUMBER,
220 outSRID IN NUMBER,
221 outModelCoordLoc IN NUMBER,
222 referencePoint IN MDSYS.SDO_GEOMETRY,
223 cropArea IN MDSYS.SDO_GEOMETRY,
224 polygonClip IN VARCHAR2,
225 boundaryClip IN VARCHAR2,
226 layerNumbers IN VARCHAR2,
227 outResolutions IN MDSYS.SDO_NUMBER_ARRAY,
228 resolutionUnit IN VARCHAR2,
229 mosaicParam IN VARCHAR2,
230 rasterBlob IN OUT NOCOPY BLOB,
231 outArea OUT MDSYS.SDO_GEOMETRY,
232 outWindow OUT MDSYS.SDO_NUMBER_ARRAY,
233 storageParam IN VARCHAR2 DEFAULT NULL,
234 bgValues IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL
235 );
236
237 --
238 -- NAME:
239 -- getMosaicSubset procedure
240 --
241 -- DESCRIPTION
242 -- Subset from a set of source georaster objects.
243 --
244 -- ARGUMENTS
245 -- georasterTableNames - The table names of the input georaster objects
246 -- georasterColumnNames - The column names of the input georaster objects
247 -- pyramidLevel - The pyramid level, if NULL and outResolution is
248 -- specified, use the outResolution to determine the
249 -- pyramidLevel, otherwise defaults to 0.
250 -- outSRID - The output georaster data's SRID.
251 -- outModelCoordLoc - The output georaster data's model coordinate
252 -- location. If NULL, defaults to CENTER.
253 -- referencePoint - The reference point of the mosaic. The mosaic result
254 -- will align with this reference point. If this is
255 -- null, the reference point implicitly uses the
256 -- left upper corner of the cropArea, or when the
257 -- cropArea is null, the upper corner of the outArea.
258 -- This reference point must be in a SDO_GEOMETRY that
259 -- describes a point.
260 -- cropArea - The output georaster data's window. If the
264 -- georeferenced.
261 -- sdo_geometry object has srid, the source georaster
262 -- objects must be georeferenced, otherwise, the source
263 -- georaster object can be georeferenced or non-
265 -- polygonClip - Whether to do polygon clipping. If NULL, defaults
266 -- to FALSE.
267 -- boundaryClip - Whether to use the source data boundary to clip the
268 -- cropArea. If false, the outside the source
269 -- data area is filled with background value. If NULL,
270 -- defaults to TRUE.
271 -- layerNumbers - The layer numbers from the source georasters. If
272 -- NULL, empty or has value of '0', all layers are
273 -- included.
274 -- outResolutions - Output georaster data's resolution. If NULL, defaults
275 -- to the source data's resolution at the given
276 -- pyramid level.
277 -- resolutionUnit - The unit of the output resolution. If NULL, defaults
278 -- to the unit of output SRID. If outResolutions is
279 -- NULL, this parameter is ignored.It must be in format
280 -- of "unit=val" where val is the unit name.
281 -- mosaicParam - The parameter related to mosaic
282 -- rasterBlob - The output Lob
283 -- outArea - The output area in model space
284 -- outWindow - The output window in cell space
285 -- storageParam - The storage parameter
286 -- bgValues - The background values for sparse data
287 --
288 -- RETURNS
289 --
290 PROCEDURE getMosaicSubset(
291 georasterTableNames IN VARCHAR2,
292 georasterColumnNames IN VARCHAR2,
293 pyramidLevel IN NUMBER,
294 outSRID IN NUMBER,
295 outModelCoordLoc IN NUMBER,
296 referencePoint IN MDSYS.SDO_GEOMETRY,
297 cropArea IN MDSYS.SDO_GEOMETRY,
298 polygonClip IN VARCHAR2,
299 boundaryClip IN VARCHAR2,
300 layerNumbers IN VARCHAR2,
301 outResolutions IN MDSYS.SDO_NUMBER_ARRAY,
302 resolutionUnit IN VARCHAR2,
303 mosaicParam IN VARCHAR2,
304 rasterBlob IN OUT NOCOPY BLOB,
305 outArea OUT MDSYS.SDO_GEOMETRY,
306 outWindow OUT MDSYS.SDO_NUMBER_ARRAY,
307 storageParam IN VARCHAR2 DEFAULT NULL,
308 bgValues IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL
309 );
310
311 --
312 -- NAME:
313 -- validateForMosaicSubset procedure
314 --
315 -- DESCRIPTION
316 -- Check if the mosaic request is valid. The validation result is stored
317 -- in a user created result table with the following columns:
318 -- (time timestamp, type varchar2, description varchar2,
319 -- table_name varchar2, column_name varchar2, rdt_table_name varchar2,
320 -- raster_id number)
321 --
322 -- ARGUMENTS
323 -- inGeoRasters - The input source georaster objects in a cursor.
324 -- outSRID - The output georaster data's SRID.
325 -- outResolutions - Output georaster data's resolution. If NULL, defaults
326 -- to the source data's resolution at the given
327 -- pyramid level.
328 -- resolutionUnit - The unit of the output resolution. If NULL, defaults
329 -- to the unit of the output SRID. If outResolutions is
330 -- NULL, this parameter is ignored.It must be in format
331 -- of "unit=val" where val is the unit name.
332 -- resultTableName - The name of the result table.
333 --
334 -- RETURNS
335 --
336 PROCEDURE validateForMosaicSubset(
337 inGeoRasters IN SYS_REFCURSOR,
338 outSRID IN NUMBER,
339 outResolutions IN MDSYS.SDO_NUMBER_ARRAY,
340 resolutionUnit IN VARCHAR2,
341 resultTableName IN VARCHAR2
342 );
343
344 --
345 -- NAME:
346 -- validateForMosaicSubset procedure
347 --
348 -- DESCRIPTION
349 -- Check if the mosaic request is valid. The validation result is stored
350 -- in a user created result table with the following columns:
351 -- (time timestamp, type varchar2, description varchar2,
352 -- table_name varchar2, column_name varchar2, rdt_table_name varchar2,
353 -- raster_id number)
354 --
355 -- ARGUMENTS
356 -- georasterTableNames - The table names of the input georaster objects
357 -- georasterColumnNames - The column names of the input georaster objects
358 -- outSRID - The output georaster data's SRID.
359 -- outResolutions - Output georaster data's resolution. If NULL, defaults
360 -- to the source data's resolution at the given
361 -- pyramid level.
362 -- resolutionUnit - The unit of the output resolution. If NULL, defaults
363 -- to the unit of the output SRID. If outResolutions is
367 --
364 -- NULL, this parameter is ignored.It must be in format
365 -- of "unit=val" where val is the unit name.
366 -- resultTableName - The name of the result table.
368 -- RETURNS
369 --
370 PROCEDURE validateForMosaicSubset(
371 georasterTableNames IN VARCHAR2,
372 georasterColumnNames IN VARCHAR2,
373 outSRID IN NUMBER,
374 outResolutions IN MDSYS.SDO_NUMBER_ARRAY,
375 resolutionUnit IN VARCHAR2,
376 resultTableName IN VARCHAR2
377 );
378
379 --
380 -- NAME:
381 -- getMosaicExtent Function.
382 --
383 -- DESCRIPTION
384 -- Calculate the extent of the total mosaic set.
385 --
386 -- ARGUMENTS
387 -- inGeoRasters - The input source georaster objects in a cursor.
388 -- outSRID - The SRID of the output extent. If null, the
389 -- SRID of the output extent will use 4326 (WGS84)
390 --
391 -- RETURNS: A MDSYS.GEOMETRY object that describes the MBR of the total mosaic.
392 --
393 FUNCTION getMosaicExtent(
394 inGeoRasters IN SYS_REFCURSOR,
395 outSRID IN NUMBER DEFAULT NULL
396 ) RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC;
397
398 --
399 -- NAME:
400 -- getMosaicExtent Function.
401 --
402 -- DESCRIPTION
403 -- Calculate the extent of the total mosaic set.
404 --
405 -- ARGUMENTS
406 -- georasterTableNames - The table names of the input georaster objects
407 -- georasterColumnNames - The column names of the input georaster objects
408 -- outSRID - The SRID of the output extent. If null, the
409 -- SRID of the output extent will use 4326 (WGS84)
410 --
411 -- RETURNS: A MDSYS.GEOMETRY object that describes the MBR of the total mosaic.
412 --
413 FUNCTION getMosaicExtent(
414 georasterTableNames IN VARCHAR2,
415 georasterColumnNames IN VARCHAR2,
416 outSRID IN NUMBER DEFAULT NULL
417 ) RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC;
418
419 --
420 -- NAME:
421 -- getMosaicResolutions Function.
422 --
423 -- DESCRIPTION
424 -- Get the resolution range of the total mosaic set in a given coordinate
425 -- system.
426 --
427 -- ARGUMENTS
428 -- inGeoRasters - The input source georaster objects in a cursor.
429 -- resolutionUnit - The unit of the output resolution range. If NULL,
430 -- defaults to 'unit=METER'. It must be in format
431 -- of "unit=val" where val is the unit name.
432 -- RETURN: - The output x and y resolution range in
433 -- MDSYS.SDO_RANGE_ARRAY. The resolution unit will
434 -- be the unit defined by the targetSRID.
435 --
436 --
437 FUNCTION getMosaicResolutions(
438 inGeoRasters IN SYS_REFCURSOR,
439 resolutionUnit IN VARCHAR2 DEFAULT NULL
440 ) return MDSYS.SDO_RANGE_ARRAY DETERMINISTIC;
441
442 --
443 -- NAME:
444 -- getMosaicResolutions Function.
445 --
446 -- DESCRIPTION
447 -- Get the resolution range of the total mosaic set in a given coordinate
448 -- system.
449 --
450 -- ARGUMENTS
451 -- georasterTableNames - The table names of the input georaster objects
452 -- georasterColumnNames - The column names of the input georaster objects
453 -- resolutionUnit - The unit of the output resolution range. If NULL,
454 -- defaults to 'unit=METER'. It must be in format
455 -- of "unit=val" where val is the unit name.
456 -- targetSRID - The target SRID for the resolution. If null, the
457 -- target SRID will default to 4326 (WGS84)
458 -- RETURN: - The output x and y resolution range in
459 -- MDSYS.SDO_RANGE_ARRAY. The resolution unit will
460 -- be the unit defined by the targetSRID.
461 --
462 FUNCTION getMosaicResolutions(
463 georasterTableNames IN VARCHAR2,
464 georasterColumnNames IN VARCHAR2,
465 resolutionUnit IN VARCHAR2 DEFAULT NULL
466 ) RETURN MDSYS.SDO_RANGE_ARRAY DETERMINISTIC;
467
468 --
469 -- NAME:
470 -- Append procedure
471 --
472 -- DESCRIPTION
473 -- Append one GeoRaster object to another GeoRaster object.
474 --
475 -- The source and target GeoRaster objects must have the same number of bands.
479 --
476 --
477 -- There is no change on metadata of target GeoRaster object except the
478 -- extent, the number of blocks and statistics removed.
480 -- The mask of the target GeoRaster object is expanded according to the
481 -- raster data expansion.
482 --
483 -- The sourceGeoRaster object will be appended to the targetGeoRaster pyramid
484 -- level 0. The pyramids of the target GeoRaster object are updated too.
485 --
486 -- The overlapping area of the source and targe GeoRaster objects are resolved
487 -- according to the commonPointRule defined in the appendParam.
488 --
489 -- ARGUMENTS
490 -- targetGeoRaster - The GeoRaster object to be appended. Cannot be the
491 -- same GeoRaster. (Be sure to make a copy of this
492 -- object before calling this procedure as this object
493 -- will be modified).
494 -- sourceGeoRaster - The GeoRaster object to be appended to targeGeoRaster
495 -- sourcePyramidLevel - The source GeoRaster object pyramid level to be
496 -- appended at the target GeoRaster object pyramid level
497 -- 0. If NULL, pyramid level 0 is used.
498 -- appendParam - The parameter related to append.
499 -- bgValues - The background values for sparse data
500 --
501 --
502 PROCEDURE Append(
503 targetGeoRaster IN OUT NOCOPY MDSYS.SDO_GEORASTER,
504 sourceGeoRaster IN MDSYS.SDO_GEORASTER,
505 sourcePyramidLevel IN NUMBEr,
506 appendParam IN VARCHAR2,
507 bgValues IN MDSYS.SDO_NUMBER_ARRAY DEFAULT NULL
508 );
509
510 END SDO_GEOR_AGGR;