Fetching Coordinates by using SDO_UTIL.GETVERTICES

Moritz Liebelt <moritz.liebelt-gM/[email protected]> Tue, 16 Aug 2016 12:33:28 +0200
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAGsDTb2vnxayYK5gmTX_ZqE6b6TM72+FJ3EqWuRSfoQ+VkEASQ@mail.gmail.com>
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]

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

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