oracle spatial sdo_centroid,Oracle_spatial的函数

  • Post author:
  • Post category:其他


‘。可以查看MDSYS.SDO_DIST_UNITS表的length函数和 MDSYS.SDO_AREA_UNITS表的面积函数获得这些单位的可能取值

6.1 SDO_AREA

select name,sdo_geom.sdo_area(a.gwm_geometry,0.05) from p_region_area a;

6.2 SDO_LENGTH

此函数返回一条线的长度和多边形、平面和立方体的周长。对于点,这个函数返回0。

select name,sdo_geom.sdo_length(a.gwm_geometry,0.05) from p_region_area a;

6.3 SDO_VOLUME

如果输入的几何体是三维的立方体或者是多重立方体,那么这个函数将一个几何体和一个容差值作为参数并且返回体积。对所有其他的几何体类型,这个函数返回0。

7、MBR(最小边界矩形) 函数 sdo_Geom.

7.1 SDO_MBR

SDO_GEOM.SDO_MBR(

geom IN SDO_GEOMETRY

[, dim IN SDO_DIM_ARRAY]

) RETURN SDO_GEOMETRY;

l SDO_MBR函数把SDO_GEOMETRY作为一个参数并且计算这个几何体的MBR。它返回的是一个SDO_GEOMETRY对象。

l 如果输入的是一个点,那么SDO_MBR函数返回的是一个点几何体。

l 如果输入的是一条平行于X或Y轴的线串,那么函数返回一个线性几何体。

否则,函数返回输入几何体的MBR,将它作为一个SDO_GEOMETRY对象。

l 对于一个输入的三维对象,SDO_MBR函数返回一个范围,也就是说,返回这个三

维几何体在三个维度上的最小值和最大值。

— Return the minimum bounding rectangle of cola_d (a circle).

SELECT SDO_GEOM.SDO_MBR(c.shape, m.diminfo)

FROM cola_markets c, user_sdo_geom_metadata m

WHERE m.table_name = ‘COLA_MARKETS’

AND m.column_name = ‘SHAPE’

AND c.name = ‘cola_d’;

注:

SDO_AGGR_UNION, SDO_AGGR_CENTROID和SDO_CONVEXHULL这些函数只能在二维几何体上使用。

7.2SDO_MIN_MBR_ORDINATE与 SDO_MAX_MBR_ORDINATE

除了获得两个维数上的范围,有时你可能对获得指定的维数上的范围感兴趣。你可以通过SDO_MIN_MBR_ORDINATE和SDO_MAX_MBR_ORDINATE函数来获得指定的维数上的范围,这两个函数返回指定维数上几何体的最小和最大坐标值。

也可以在三维对象上使用这些函数。

SELECT SDO_GEOM.SDO_MIN_MBR_ORDINATE(sr.geom, 1) min_extent,

SDO_GEOM.SDO_MAX_MBR_ORDINATE(sr.geom, 1) max_extent

FROM sales_regions sr;

SELECT SDO_GEOM.SDO_MIN_MBR_ORDINATE(sr.geom, 3) min_extent,

SDO_GEOM.SDO_MAX_MBR_ORDINATE(sr.geom, 3) max_extent

FROM sales_regions sr;

8、各种几何分析函数 sdo_Geom.

(

Geometry IN SDO_GEOMETRY,

Tolerance IN NUMBER

)

RETURENS SDO_GEOMETRY

8.1 SDO_CONVEXHULL

–该函数可用于简化面的顶点(与原来的面仍保持近似)

select name,sdo_geom.sdo_convexhull(a.gwm_geometry,0.5) from p_region_area a;

在Oracle 11g中,SDO_CONVEXHULL函数只适用于二维的几何体

8.2 SDO_CENTROID

在Oracle 11g中,SDO_CENTROID函数只适用于二维的几何体

点返回的仍是一个点,线返回的是空值,面返回的是该面的质心。

8.3 SDO_POINTONSURFACE

既然一个多边形的质心有可能在也有可能不在这个多边形内,那么在几何体表面的其他点放置一个标签也可能是有用的。在创建多边形地图的一些类型时,这个也是必要的。你可以通过使用SDO_POINTONSURFACE函数来得到这样的点。

也可以在三维的几何体上使用这个函数。

SDO_POINTONSURFACE函数的唯一保证是返回的点在穿过的多边形的边界上或者内部(在目前的实现中,它实际返回的是多边形几何体的SDO_ORDINATE_ARRAY中的第一个点)。

SDO_GEOM.SDO_POINTONSURFACE(

geom1 IN SDO_GEOMETRY,

dim1 IN SDO_DIM_ARRAY

) RETURN SDO_GEOMETRY;

or

SDO_GEOM.SDO_POINTONSURFACE(

geom1 IN SDO_GEOMETRY,

tol IN NUMBER

) RETURN SDO_GEOMETRY;

9、聚合函数 非免费 sdo_Geom.

SDO_AGGR_MBR 可用于三维几何体;SDO_AGGR_UNION、SDO_AGGR_CENTROID和SDO_CONVEXHULL函数只适用于二维的几何体

9.1 聚合MBR函数(SDO_AGGR_MBR)

假设你想找到SDO_GEOMETRY对象集覆盖的范围(通常,在创建索引之前,需要使用这个信息来填充USER_SDO_GEOM_METADATA视图)

9.2 SDO_AGGR_UNION

聚合函数SDO_AGGR_UNION计算几何体集合的并。并以SDO_GEOMETRY对象返回。

9.3 SDO_AGGR_CONVEXHULL

如果所有输入的几何体的所有顶点是共线的或者如果只有一个顶点(一个点),那么SDO_AGGR_CONVEXHULL返回空值

9.4 SDO_AGGR_CENTROID

SDO_AGGR_CENTROID函数允许你计算客户任意组合的质心

10、SDO_GEOM.SDO_ARC_DENSIFY

SDO_GEOM.SDO_ARC_DENSIFY(

geom IN SDO_GEOMETRY,

dim IN SDO_DIM_ARRAY

params IN VARCHAR2

) RETURN SDO_GEOMETRY;

or

SDO_GEOM.SDO_ARC_DENSIFY(

geom IN SDO_GEOMETRY,

tol IN NUMBER

params IN VARCHAR2

) RETURN SDO_GEOMETRY;

— Arc densification of the circle cola_d

SELECT c.name,

SDO_GEOM.SDO_ARC_DENSIFY(c.shape, m.diminfo, ‘arc_tolerance=0.05’)

FROM cola_markets c, user_sdo_geom_metadata m

WHERE m.table_name = ‘COLA_MARKETS’

AND m.column_name = ‘SHAPE’

AND c.name = ‘cola_d’;

10、验证函数(sdo_Geom.)

10.1 VALIDATE_GEOMETRY_WITH_CONTEXT

SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(

Geometry IN SDO_GEOMETRY,

DimInfo IN SDO_DIM_ARRAY –该参数指定了维度(范围)和容差值的信息

) RETURN VARCHAR2;

or

SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(

Geometry IN SDO_GEOMETRY,

tolerance IN NUMBER

) RETURN VARCHAR2;

10.2 VALIDATE_LAYER_WITH_CONTEXT

SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT(

geom_table IN VARCHAR2, –验证的表

geom_column IN VARCHAR2, –验证的列

result_table IN VARCHAR2 –验证结果存放的表

[, commit_interval IN NUMBER]); –验证结果每隔多少个提交一次

二sdo_util包的函数

1、sdo_util.remove_duplicate_vertices

删除重复的顶点

SDO_UTIL.REMOVE_DUPLICATE_VERTICES

geometry IN SDO_GEOMETRY,

tolerance IN NUMBER

) RETURN SDO_GEOMETRY;

2、sdo_util.extract(只能提取二维)

SDO_UTIL.EXTRACT(

geometry IN SDO_GEOMETRY, –提取的对象

element IN NUMBER –提取哪个元素

[, ring IN NUMBER] –环号,可选

) RETURN SDO_GEOMETRY;

3、sdo_util.append

在给定的容差值内,这个函数将两个输入的几何体合成为单个几何体。

SDO_UTIL.APPEND(

geom1 IN SDO_GEOMETRY,

geom2 IN SDO_GEOMETRY

) RETURN SDO_GEOMETRY

4、sdo_util.GetNumElem

获取元素的数目(即由几个元素组成)

SDO_UTIL.GETNUMELEM(

geometry IN SDO_GEOMETRY

) RETURN NUMBER;

5、sdo_util.GetNumVertices

获取对象的顶点数目

SDO_UTIL.GETNUMVERTICES(

geometry IN SDO_GEOMETRY

) RETURN NUMBER;

6、sdo_util.getvertices

SDO_UTIL.GETVERTICES(

geometry IN SDO_GEOMETRY

) RETURN VERTEX_SET_TYPE;

7、SDO_UTIL.CIRCLE_POLYGON

返回一个圆

SDO_UTIL.CIRCLE_POLYGON(

center_longitude IN NUMBER,

center_latitude IN NUMBER,

radius IN NUMBER,

arc_tolerance IN NUMBER

) RETURN SDO_GEOMETRY;

SELECT SDO_UTIL.CIRCLE_POLYGON(-71.34937, 42.46101, 100, 5) FROM DUAL;

8、SDO_UTIL.ELLIPSE_POLYGON

返回一个椭圆

SDO_UTIL.ELLIPSE_POLYGON(

center_longitude IN NUMBER,

center_latitude IN NUMBER,

semi_major_axis IN NUMBER,

semi_minor_axis IN NUMBER,

azimuth IN NUMBER,

arc_tolerance IN NUMBER

) RETURN SDO_GEOMETRY;

SELECT SDO_UTIL.ELLIPSE_POLYGON(-71.34937, 42.46101, 100, 50, 90, 5)FROM DUAL;

9、SDO_UTIL.CONVERT_UNIT

单位转换

SDO_UTIL.CONVERT_UNIT(

input_value IN NUMBER,

from_unit IN VARCHAR2,

to_unit IN VARCHAR2

) RETURN NUMBER;

SELECT SDO_UTIL.CONVERT_UNIT(1, ‘Radian’, ‘Degree’) FROM DUAL;

10、wkt、wkb与geometry互转与验证

Ø SDO_UTIL.FROM_WKBGEOMETRY

Ø SDO_UTIL.FROM_WKTGEOMETRY

Ø SDO_UTIL.TO_WKBGEOMETRY

Ø SDO_UTIL.TO_WKTGEOMETRY

Ø SDO_UTIL.VALIDATE_WKBGEOMETRY

Ø SDO_UTIL.VALIDATE_WKTGEOMETRY

DECLARE

wkbgeom BLOB;

wktgeom CLOB;

val_result VARCHAR2(5);

geom_result SDO_GEOMETRY;

geom SDO_GEOMETRY;

BEGIN

SELECT c.shape INTO geom FROM cola_markets c WHERE c.name = ‘cola_b’;

— To WBT/WKT geometry

wkbgeom := SDO_UTIL.TO_WKBGEOMETRY(geom);

wktgeom := SDO_UTIL.TO_WKTGEOMETRY(geom);

DBMS_OUTPUT.PUT_LINE(‘To WKT geometry result = ‘ || TO_CHAR(wktgeom));

— From WBT/WKT geometry

geom_result := SDO_UTIL.FROM_WKBGEOMETRY(wkbgeom);

geom_result := SDO_UTIL.FROM_WKTGEOMETRY(wktgeom);

— Validate WBT/WKT geometry

val_result := SDO_UTIL.VALIDATE_WKBGEOMETRY(wkbgeom);

DBMS_OUTPUT.PUT_LINE(‘WKB validation result = ‘ || val_result);

val_result := SDO_UTIL.VALIDATE_WKTGEOMETRY(wktgeom);

DBMS_OUTPUT.PUT_LINE(‘WKT validation result = ‘ || val_result);

END;

11、GML与GEOMETRY转换

SDO_UTIL.TO_GMLGEOMETRY(

thegeom IN SDO_GEOMETRY

) RETURN CLOB;

SELECT TO_CHAR(SDO_UTIL.TO_GMLGEOMETRY(shape)) AS GmlGeometry

FROM COLA_MARKETS c

WHERE c.name = ‘cola_b’;

12、SDO_UTIL.SIMPLIFY

根据输入的阈值来简化输入的对象

SDO_UTIL.SIMPLIFY(

geometry IN SDO_GEOMETRY,

threshold IN NUMBER

tolerance IN NUMBER DEFAULT 0.0000005

) RETURN SDO_GEOMETRY;

SELECT SDO_UTIL.SIMPLIFY(

SDO_GEOMETRY(

3302, — line string, 3 dimensions (X,Y,M), 3rd is linear ref. dimension

NULL,

NULL,

SDO_ELEM_INFO_ARRAY(1,2,1), — one line string, straight segments

SDO_ORDINATE_ARRAY(

2,2,0, — Starting point – Exit1; 0 is measure from start.

2,4,2, — Exit2; 2 is measure from start.

8,4,8, — Exit3; 8 is measure from start.

12,4,12, — Exit4; 12 is measure from start.

12,10,NULL, — Not an exit; measure automatically calculated and filled.

8,10,22, — Exit5; 22 is measure from start.

5,14,27) — Ending point (Exit6); 27 is measure from start.

),

6, — threshold value for geometry simplification

0.5 — tolerance

) FROM DUAL;

13、SDO_UTIL.RECTIFY_GEOMETRY

纠正有错误的对象并正确输出

SDO_UTIL.RECTIFY_GEOMETRY(

geometry IN SDO_GEOMETRY,

tolerance IN NUMBER

) RETURN SDO_GEOMETRY;

SELECT SDO_UTIL.RECTIFY_GEOMETRY(shape, 0.005)

FROM COLA_MARKETS c WHERE c.name = ‘cola_b’;

14、SDO_UTIL.PREPARE_FOR_TTS与SDO_UTIL.INITIALIZE_INDEXES_FOR_TTS

在不同的Oracle数据库之间传输数据可通过表空间。而为了保证表空间上的表的空间索引也被传输,需要执行这些函数SDO_UTIL.PREPARE_FOR_TTS(在传输表空间前执行)与SDO_UTIL.INITIALIZE_INDEXES_FOR_TTS(在表空间导出后执行)

例子:创建一个dmp文件,从一个源数据库中传输表空间tbs。

首先:从一个源数据库中传输表空间tbs

Sqlplus spatial/ spatial

Execute SDO_UTIL.PREPARE_FOR_TTS(‘TBS’)

Connect system/manager as sysdba

Execute dbms_tts.transport_set_check(‘TBS’,true);

Alter tablespace TBS read only;

Exit;

Exp spatial/ spatial transport_ tablespace=y tablespaces=TBS file=trans_ts.dmp

然后导入

ixp spatial/ spatial transport_ tablespace=y file=trans_ts.dmp datafiles=’sdo_tts.dbf’ tablespaces=tbs

Sqlplus sys/password

Alter tablespace TBS read write;

Connect spatial/ spatial;

Exec SDO_UTIL.INITIALIZE_INDEXES_FOR_TTS

15、sdo_util.extract3d

提取三维对象的元素

16、sdo_util.sdo_concat_lines

连接两个线串

SDO_UTIL.CONCAT_LINES(

geom1 IN SDO_GEOMETRY,

geom2 IN SDO_GEOMETRY

) RETURN SDO_GEOMETRY;

17、sdo_util.sdo_reverse_linestring

倒转一条线串中的顶点的顺序

SDO_UTIL.REVERSE_LINESTRING(

geometry IN SDO_GEOMETRY

) RETURN SDO_GEOMETRY;

18、sdo_util.sdo_polygontoline

将多边形转换为线串几何体

SDO_UTIL.POLYGONTOLINE(

geometry IN SDO_GEOMETRY

) RETURN SDO_GEOMETRY;

15到18非免费

三 sdo_lrs包

Subprograms for Creating and Editing Geometric Segments

1、SDO_LRS.DEFINE_GEOM_SEGMENT(过程)

语法:

SDO_LRS.DEFINE_GEOM_SEGMENT(

geom_segment IN OUT SDO_GEOMETRY

[, start_measure IN NUMBER,

end_measure IN NUMBER]);

or

SDO_LRS.DEFINE_GEOM_SEGMENT(

geom_segment IN OUT SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY

[, start_measure IN NUMBER,

end_measure IN NUMBER]);

功能:根据起始点和终止点测量值计算出没有测量的点

例子:

— Test the LRS procedures.

DECLARE

geom_segment SDO_GEOMETRY;

line_string SDO_GEOMETRY;

dim_array SDO_DIM_ARRAY;

result_geom_1 SDO_GEOMETRY;

result_geom_2 SDO_GEOMETRY;

result_geom_3 SDO_GEOMETRY;

BEGIN

SELECT a.route_geometry into geom_segment FROM lrs_routes a

WHERE a.route_name = ‘Route1’;

SELECT m.diminfo into dim_array from

user_sdo_geom_metadata m

WHERE m.table_name = ‘LRS_ROUTES’ AND m.column_name = ‘ROUTE_GEOMETRY’;

— Define the LRS segment for Route1. This will populate any null measures.

— No need to specify start and end measures, because they are already defined in the geometry.

SDO_LRS.DEFINE_GEOM_SEGMENT (geom_segment, dim_array);

SELECT a.route_geometry INTO line_string FROM lrs_routes a

WHERE a.route_name = ‘Route1’;

— Split Route1 into two segments.

SDO_LRS.SPLIT_GEOM_SEGMENT(line_string,dim_array,5,result_geom_1,result_geom_2);

— Concatenate the segments that were just split.

result_geom_3 := SDO_LRS.CONCATENATE_GEOM_SEGMENTS(result_geom_1, dim_array,

result_geom_2, dim_array);

— Update and insert geometries into table, to display later.

UPDATE lrs_routes a SET a.route_geometry = geom_segment

WHERE a.route_id = 1;

INSERT INTO lrs_routes VALUES(

11,

‘result_geom_1’,

result_geom_1

);

INSERT INTO lrs_routes VALUES(

12,

‘result_geom_2’,

result_geom_2

);

INSERT INTO lrs_routes VALUES(

13,

‘result_geom_3’,

result_geom_3

);

END;

2、SDO_LRS.REDEFINE_GEOM_SEGMENT(过程)

语法:

SDO_LRS.REDEFINE_GEOM_SEGMENT(

geom_segment IN OUT SDO_GEOMETRY

[, start_measure IN NUMBER,

end_measure IN NUMBER]);

or

SDO_LRS.REDEFINE_GEOM_SEGMENT(

geom_segment IN OUT SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY

[, start_measure IN NUMBER,

end_measure IN NUMBER]);

功能:重新定义几何体(可进行单位转换)

例子:

— Redefine geometric segment to “convert” miles to kilometers

DECLARE

geom_segment SDO_GEOMETRY;

dim_array SDO_DIM_ARRAY;

BEGIN

SELECT a.route_geometry into geom_segment FROM lrs_routes a WHERE a.route_name = ‘Route1’;

SELECT m.diminfo into dim_array from user_sdo_geom_metadata m WHERE m.table_name = ‘LRS_ROUTES’ AND m.column_name =’ROUTE_GEOMETRY’;

— “Convert” mile measures to kilometers (27 * 1.609 = 43.443).

SDO_LRS.REDEFINE_GEOM_SEGMENT (geom_segment,

dim_array,

0, — Zero starting measure: LRS segment starts at start of route.

43.443); — End of LRS segment. 27 miles = 43.443 kilometers.

— Update and insert geometries into table, to display later.

UPDATE lrs_routes a SET a.route_geometry = geom_segment WHERE a.route_id = 1;

END;

3、SDO_LRS.CLIP_GEOM_SEGMENT

语法:

SDO_LRS.CLIP_GEOM_SEGMENT(

geom_segment IN SDO_GEOMETRY,

start_measure IN NUMBER,

end_measure IN NUMBER,

tolerance IN NUMBER DEFAULT 1.0e-8

) RETURN SDO_GEOMETRY;

or

SDO_LRS.CLIP_GEOM_SEGMENT(

geom_segment IN SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY,

start_measure IN NUMBER,

end_measure IN NUMBER

) RETURN SDO_GEOMETRY;

功能:截取指定的一段

例子:

— Clip a piece of Route1.

SELECT SDO_LRS.CLIP_GEOM_SEGMENT(route_geometry, 5, 10) FROM lrs_routes WHERE route_id = 1;

4、SDO_LRS.DYNAMIC_SEGMENT

语法:

SDO_LRS.DYNAMIC_SEGMENT(

geom_segment IN SDO_GEOMETRY,

start_measure IN NUMBER,

end_measure IN NUMBER,

tolerance IN NUMBER DEFAULT 1.0e-8

) RETURN SDO_GEOMETRY;

or

SDO_LRS.DYNAMIC_SEGMENT(

geom_segment IN SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY,

start_measure IN NUMBER,

end_measure IN NUMBER

) RETURN SDO_GEOMETRY;

用法与SDO_LRS.CLIP_GEOM_SEGMENT一样

5、 SDO_LRS.CONCATENATE_GEOM_SEGMENTS

语法:

SDO_LRS.CONCATENATE_GEOM_SEGMENTS(

geom_segment_1 IN SDO_GEOMETRY,

geom_segment_2 IN SDO_GEOMETRY,

tolerance IN NUMBER DEFAULT 1.0e-8

) RETURN SDO_GEOMETRY;

or

SDO_LRS.CONCATENATE_GEOM_SEGMENTS(

geom_segment_1 IN SDO_GEOMETRY,

dim_array_1 IN SDO_DIM_ARRAY,

geom_segment_2 IN SDO_GEOMETRY,

dim_array_2 IN SDO_DIM_ARRAY

) RETURN SDO_GEOMETRY;

功能:连接线串,例子见1

6、SDO_LRS.OFFSET_GEOM_SEGMENT

语法:

SDO_LRS.OFFSET_GEOM_SEGMENT(

geom_segment IN SDO_GEOMETRY,

start_measure IN NUMBER,

end_measure IN NUMBER,

offset IN NUMBER,

tolerance IN NUMBER DEFAULT 1.0e-8

[, unit IN VARCHAR2]

) RETURN SDO_GEOMETRY;

or

SDO_LRS.OFFSET_GEOM_SEGMENT(

geom_segment IN SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY,

start_measure IN NUMBER,

end_measure IN NUMBER,

offset IN NUMBER

[, unit IN VARCHAR2]

) RETURN SDO_GEOMETRY;

功能:指定的线段内进行偏移

例子:

SELECT SDO_LRS.OFFSET_GEOM_SEGMENT(a.route_geometry, m.diminfo, 5, 10, 2)

FROM lrs_routes a, user_sdo_geom_metadata m

WHERE m.table_name = ‘LRS_ROUTES’

AND m.column_name = ‘ROUTE_GEOMETRY’

AND a.route_id = 1;

7、SDO_LRS.SPLIT_GEOM_SEGMENT(过程)

语法:

SDO_LRS.SPLIT_GEOM_SEGMENT(

geom_segment IN SDO_GEOMETRY,

split_measure IN NUMBER,

segment_1 OUT SDO_GEOMETRY,

segment_2 OUT SDO_GEOMETRY);

or

SDO_LRS.SPLIT_GEOM_SEGMENT(

geom_segment IN SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY,

split_measure IN NUMBER,

segment_1 OUT SDO_GEOMETRY,

segment_2 OUT SDO_GEOMETRY);

功能:将一个几何体分为两个

例子见1

8、SDO_LRS.RESET_MEASURE(过程)

语法:

SDO_LRS.RESET_MEASURE(

geom_segment IN OUT SDO_GEOMETRY

[, dim_array IN SDO_DIM_ARRAY]);

功能:将起始点到终止点的测量值都清空

例子:

— Reset geometric segment measures.

DECLARE

geom_segment SDO_GEOMETRY;

BEGIN

SELECT a.route_geometry into geom_segment FROM lrs_routes a

WHERE a.route_name = ‘Route1’;

SDO_LRS.RESET_MEASURE (geom_segment);

— Update and insert geometries into table, to display later.

UPDATE lrs_routes a SET a.route_geometry = geom_segment

WHERE a.route_id = 1;

END;

9、SDO_LRS.SET_PT_MEASURE

语法:

SDO_LRS.SET_PT_MEASURE(

geom_segment IN OUT SDO_GEOMETRY,

point IN SDO_GEOMETRY,

measure IN NUMBER) RETURN VARCHAR2;

or

SDO_LRS.SET_PT_MEASURE(

geom_segment IN OUT SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY,

point IN SDO_GEOMETRY,

pt_dim_array IN SDO_DIM_ARRAY,

measure IN NUMBER) RETURN VARCHAR2;

or

SDO_LRS.SET_PT_MEASURE(

point IN OUT SDO_GEOMETRY,

measure IN NUMBER) RETURN VARCHAR2;

or

SDO_LRS.SET_PT_MEASURE(

point IN OUT SDO_GEOMETRY,

dim_array IN SDO_DIM_ARRAY,

measure IN NUMBER) RETURN VARCHAR2;

功能:将测量值设为一个特定的点

— Set the measure value of point 8,10 to 20 (originally 22).

DECLARE

geom_segment SDO_GEOMETRY;

dim_array SDO_DIM_ARRAY;

result VARCHAR2(32);

BEGIN

SELECT a.route_geometry into geom_segment FROM lrs_routes a

WHERE a.route_name = ‘Route1’;

SELECT m.diminfo into dim_array from

user_sdo_geom_metadata m

WHERE m.table_name = ‘LRS_ROUTES’ AND m.column_name = ‘ROUTE_GEOMETRY’;

— Set the measure value of point 8,10 to 20 (originally 22).

result := SDO_LRS.SET_PT_MEASURE (geom_segment,

SDO_GEOMETRY(3301, NULL, NULL,

SDO_ELEM_INFO_ARRAY(1, 1, 1),

SDO_ORDINATE_ARRAY(8, 10, 22)),

20);

— Display the result.

DBMS_OUTPUT.PUT_LINE(‘Returned value = ‘ || result);

END;

10、SDO_LRS.REVERSE_MEASURE

11、SDO_LRS.TRANSLATE_MEASURE

12、SDO_LRS.REVERSE_GEOMETRY

Subprograms for Querying and Validating Geometric Segments

13、SDO_LRS.VALID_GEOM_SEGMENT

14、SDO_LRS.VALID_LRS_PT

15、SDO_LRS.VALID_MEASURE

16、SDO_LRS.CONNECTED_GEOM_SEGMENTS

17、SDO_LRS.GEOM_SEGMENT_LENGTH

18、SDO_LRS.GEOM_SEGMENT_START_PT

19、SDO_LRS.GEOM_SEGMENT_END_PT

20、SDO_LRS.GEOM_SEGMENT_START_MEASURE

21、SDO_LRS.GEOM_SEGMENT_END_MEASURE

22、SDO_LRS.GET_MEASURE

23、SDO_LRS.GET_NEXT_SHAPE_PT

24、SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE

25、SDO_LRS.GET_PREV_SHAPE_PT

26、SDO_LRS.GET_PREV_SHAPE_PT_MEASURE

27、SDO_LRS.IS_GEOM_SEGMENT_DEFINED

28、SDO_LRS.IS_MEASURE_DECREASING

29、SDO_LRS.IS_MEASURE_INCREASING

30、SDO_LRS.IS_SHAPE_PT_MEASURE

31、SDO_LRS.MEASURE_RANGE

32、SDO_LRS.MEASURE_TO_PERCENTAGE

33、SDO_LRS.PERCENTAGE_TO_MEASURE

34、SDO_LRS.LOCATE_PT

35、SDO_LRS.PROJECT_PT

36、SDO_LRS.FIND_LRS_DIM_POS

37、SDO_LRS.FIND_MEASURE

38、SDO_LRS.FIND_OFFSET

39、SDO_LRS.VALIDATE_LRS_GEOMETRY

Subprograms for Converting Geometric Segments

40、SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY

41、SDO_LRS.CONVERT_TO_LRS_GEOM

42、SDO_LRS.CONVERT_TO_LRS_LAYER

43、SDO_LRS.CONVERT_TO_STD_DIM_ARRAY

44、SDO_LRS.CONVERT_TO_STD_GEOM

45、SDO_LRS.CONVERT_TO_STD_LAYER

四、SDO_MIGRATE包

SDO_MIGRATE.TO_CURRENT

Format (Any Object-Relational Model Implementation to Current)

SDO_MIGRATE.TO_CURRENT(

tabname IN VARCHAR2

[, column_name IN VARCHAR2]);

or

SDO_MIGRATE.TO_CURRENT(

tabname IN VARCHAR2,

column_name IN VARCHAR2

[, commit_int IN NUMBER]);

Format (Single Object-Relational Model Geometry to Current)

SDO_MIGRATE.TO_CURRENT(

geom IN SDO_GEOMETRY,

dim IN SDO_DIM_ARRAY

) RETURN SDO_GEOMETRY;

Format (Any Relational Model Implementation to Current)

SDO_MIGRATE.TO_CURRENT(

layer IN VARCHAR2,

newtabname IN VARCHAR2,

gidcolumn IN VARCHAR2,

geocolname IN VARCHAR2,

layer_gtype IN VARCHAR2,

updateflag IN VARCHAR2);

EXECUTE SDO_MIGRATE.TO_CURRENT(‘ROADS’);