Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calculate Centroid of multiple Polygons in Locator

limorJun 22 2016 — edited Jun 23 2016

Hi,

I need some help with calculation the Centroid of multiple polygons.

I am using Oracle 11g Locator!

Table Building:

ID...CENTROID_GEOM
1 ...null
2...null
3...null

Table Thematic_Surface: (35 = ground polygon)

BUILDING_IDLOD2S2_MULTI_SURFACE_IDOBJECTCLASS_ID
1933
11134
11334
11534
11734
11935
12035

Table Surface_Geometry:

ROOT_IDGEOMETRY
19...
20...

My query looks like:

update building

set centroid_geom = (SDO_GEOM.SDO_CENTROID(c.geometry, 0.005)

  FROM building a, Thematic_Surface b, Surface_Geometry c, user_sdo_geom_metadata m

  WHERE a.ID = b.Building_ID

  AND b.Objectclass_ID = 35

  AND b.Lod2_Multi_Surface_ID = c.Root_ID

  AND c.Geometry IS NOT NULL);


It works only for buildings with one ground polygon!!!

The problem is as you can see in table building sometimes (not always) I have multiple ground surfaces.

Because of that I get the error message: " single-row subquery returns more than one row".

In spatial I guess you can use the SDO_AGGR_CENTROID function instead of SDO_GEOM.SDO_CENTROID!

But I am not allowed to use this function because I only have Locator extension.

So is there an alternative how to solve this in locator?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2016
Added on Jun 22 2016
6 comments
2,063 views