Hi,
I have opened a ticket on a method that seems to work to provide read only 
access to spatial (sdo_geometry) fields in an oracle database using oracle 
xe. See https://code.djangoproject.com/ticket/21273

In short, we can use the__getattribute__ method of the CLOB field returned 
by cx_Oracle to access the SDO_GEOMETRY object and to generate WKT, like 
this:

>>> g_ewkt = "SRID:%s:POINT(%f %f)" % 
>>> (str(int(g.__getattribute__('SDO_SRID'))), 
>>> g.__getattribute__('SDO_POINT').X, g.__getattribute__('SDO_POINT').Y)
>>> g_ewkt
'SRID:82086:POINT(162913.389524 340748.357977)'

The Oracle documentation explains in detail how the object works, so accessing 
a range of geometry types (if not all types) as wkt appears to be feasible.

I'd be grateful on pointers or assistance (or would be happy to help someone 
who has more familiarity with django.contrib.gis) to move this on.

I understand from comments on the wiki and in the docs that this may be of use 
to a range of users, if only as a way to transfer legacy data to postgres 
(which is my use case).

Thanks
Vincent 


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9cd84960-1fa2-4832-b5aa-35cec451a753%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to