遇到oracle spatail的面数据在 arcmap无法展示,可以通过属性定位图形看到高亮的选择集,清除高亮空白。
一般都是由于数据有错误导致的。数据库中验证下数据合法性
select sdo_geom.validate_geometry(t.geom,0.00001),t.afg_fid from AREA t;
可以看到部分数据返回错误码13356和13349.
对于13356是有重复点数据
update AREA t set t.geom = sdo_util.RECTIFY_GEOMETRY(t.geom,0.00001) where t.fid= 8348;
13349属于自相交的图形,修复后2003类型变为2007
update AREA t set t.geom = sdo_util.RECTIFY_GEOMETRY(t.geom,0.00001) where t.fid= 72946;
修复成功之后重新创建空间索引,报错其中有提示层的srid和几何形状srid不一致
select * from user_sdo_index_info t where t.table_name = 'AREA';
select * from user_sdo_geom_metadata t where t.table_name = 'AREA';
create index sidx_area on area(geom) indextype is mdsys.spatial_index;
查看user_sdo_geom_metadata元数据srid为自定义的值比如99,但是area表中存在有srid为空的数据
先删除索引,然后更新数据的空间索引
declare
-- Local variables here
geo sdo_geometry;
cursor pointer is select t.geom,t.fid from area t;
p pointer%rowtype;
begin
-- Test statements here
for p in pointer loop
geo:= p.geom;
if geo.SDO_SRID is null then
geo.SDO_SRID := 99;
update area t set t.geom = geo where t.fid = p.fid;
end if;
end loop;
end;
执行成功后再创建空间索引,然后在arcmap查看数据可以预览成功。