Hi,
I have uploaded a more developed class to handle sdo_geometry.  It now 
handles the more straightforward cases for all types of geometry, except 
geometry collection, which is in progress.  Next step is to cover the 
remainder of the cases (e.g. rectangles and circles within polygons, curved 
segments, linestrings and polygons with a mix of straight and curved edges 
etc.).

I am also looking at testing against a test table with a variety of 
geometries in it.  Does anyone think there would be any licensing issues in 
using the geometries defined in the Oracle documentation?  Or would it be 
safer to create my own?

A further task is to try writing data to the cx_Oracle object, which 
doesn't look to be too difficult, but I haven't tried it yet.

See https://code.djangoproject.com/ticket/21273 (apologies for the typos).

Vincent

On Friday, October 25, 2013 5:33:21 PM UTC+1, [email protected] wrote:
>
> Hi,
> I have uploaded an initial class to handle sdo_geometry.  It is a work in 
> progress, but is generating WKT for POINT & POLYGON geometry.  It needs to 
> be expanded and cleaned up.
>
> See https://code.djangoproject.com/ticket/21273
> Vincent
>
> On Wednesday, October 16, 2013 5:02:01 PM UTC+1, [email protected] wrote:
>>
>> 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/b7aa6081-2d4b-4274-8902-017d392afbda%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to