Re: Fetching Coordinates by using SDO_UTIL.GETVERTICES

Jani Tiainen <[email protected]> Wed, 17 Aug 2016 14:58:07 +0300
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <[email protected]>
Hi,

Is there a reason you use GETVERTICES-utility instead of reading 
geometry directly in Python?

cx_Oracle have had that feature for a good while.

On 16.08.2016 13:33, Moritz Liebelt wrote:
> Hi,
>
> I want to fetch coordinates from my Oracle database (11g Locator). I 
> will try it with the intern function SDO_UTIL.GETVERTICES().
>
> *My sql query looks like:*
> /"""SELECT a.id <http://a.id> , t.x, t.y, t.z, d.Classname FROM   
> building a, THEMATIC_SURFACE b, SURFACE_GEOMETRY c, 
> TABLE(SDO_UTIL.GETVERTICES(c.geometry))t, OBJECTCLASS d  WHERE 
>  a.grid_id_500 = 2728 AND a.id <http://a.id> = b.BUILDING_ID AND 
> b.LOD2_MULTI_SURFACE_ID = c.ROOT_ID AND c.GEOMETRY IS NOT NULL AND 
> b.OBJECTCLASS_ID = d.ID""")/
> /
> /
> Afterwards I create the json:
>
> /
> for id,x,y,z, classname in cursor:
> result.append({
>                 "building_nr":id,"geometry": {
> "type":"polygon","coordinates":[x,y,z],}, "polygon_typ":classname,})
> /
> /
> /
> *//But of course I get only one Point:*
>
> [{'building_nr': 1314867, 'geometry': {'type': 'polygon', 
> 'coordinates': [(3500936.67, 5394350.72, 439.17400000000004)]}, 
> 'polygon_typ': 'BuildingWallSurface'}, ...
>
> The problem is I get only one point geometry.
>
> But for example there exists 5 points for this wall surface. I need 
> all points with the same building_nr (id)!
>
> Can I iterate over x,y,z ?
>
>
>
> -- 
> *Moritz Liebelt, B. Sc.*
>
> Murgstraße 19
> 76437 Rastatt
> E-Mail: moritz.liebelt-gM/[email protected] 
> <mailto:moritz.liebelt-gM/[email protected]>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users

-- 
Jani Tiainen

------------------------------------------------------------------------------

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users