Showing results for 
Search instead for 
Do you mean 

Reading the points from AGGR_MBR using a query

by Technical Evangelist on ‎03-03-2016 10:16 AM - edited on ‎04-07-2016 06:24 AM by Moderator (383 Views)

Question

Using SDO_AGGR_MBR (select (sdo_aggr_mbr(g3e_geometry)) mymbr from gisadmin.pricond_ln g where exists (select 1 from gisadmin.b$connectivity_n cn where g3e_fno in (306, 236) and circuit1='A1' and cn.g3e_fid=g.g3e_fid))  to retrieve the MBR of my electric circuit.  It works fine/fast and returns a 3d line with 2 points (with z=0).

 What is the easiest way for me to retrieve the ordinates in a NUMBER format?  I don’t want to use the SDO_UTIL.TO_WKTGEOMETRY, as it only handles 2D geometries and I would need to convert the geometry.

Answer

SELECT MBR.X,MBR.Y FROM TABLE(select SDO_UTIL.GETVERTICES(SDO_AGGR_MBR(GEOMETRY)) FROM LINES WHERE PID=1) MBR;

           X                            Y
---------------------------------------
8932.83513        500.234546

 

Combine your original query with Oracle's GetVertices and then embed this in a table function to extract the X and the Y.

Contributors