Centroid & Buffer sql statements
395799Jun 11 2003 — edited Jun 12 2003Hi all,
I have two issues that I need help on:
1) I want to perform the following spatial analysis task:
Having two layers (tables), one with parcels (call it PARCELS) and one with an area of interest (call it AREA1) I want to select those PARCELS that their center (center of gravity) is in the area of AREA1 layer.
I tried to use the Geometry Function SDO_GEOM.SDO_CENTROID but I didn't manage to make it work.
Can you help, suggesting the appropriate sql statement to perform this query?
-----------------------------------------------------------------------------------------
2) I performed the following query to create buffer zones around the parks in a WPARKS layer.
create table WPARKSBUF as
select SDO_GEOM.SDO_BUFFER(wp.shape,m.diminfo,150) shape
from WPARKS wp, USER_SDO_GEOM_METADATA m
where m.TABLE_NAME='WPARKS' and m.COLUMN_NAME='SHAPE';
The result of the table is right, as I can see from SPATIAL INDEX ADVISOR but when I visualize it in ArcCatalog (previewing) only some of the buffer polygons are drawn and then a fail to draw message comes up.
The only way to overcome this problem was to perform the following query just after the creation of the first table:
create table WPARKSBUF2 as
select sdo_aggr_union(
mdsys.sdoaggrtype(c.shape, 0.0005))shape
from WPARKSBUF c;
Can anyone tell me why I can't get it work only with the first query ? (I have performed again buffer sql statements and I haven't encounter such problems)