#21273: Add read only support for Oracle XE to django.contrib.gis
--------------------------------------+------------------------------------
     Reporter:  vinhussey             |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  GIS                   |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  1
  Needs tests:  1                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by shai):

 Hi Vincent,

 I am far from being a !GeoDjango expert; in fact, I only started looking
 into it recently. I usually handle Oracle issues, but I don't use Oracle
 XE currently, and am not sure exactly how much spatial functionality is
 available on XE. I took a look at your latest code, and I have some
 comments.

 First of all, the general scope of the work: As far as I could see, what
 you have added is a class for interpreting the SDO_GEOMETRY type; do you
 intend to also support other operations, such as geometric queries? Are
 they supported on XE? If not, the best integration into Django seems to be
 a custom field type.

 Second, technical details:

 The most glaring point in your code is the explicit use of
 `__getattribute__`: This is a "magic method" in Python, it implements
 attribute access. You should be able to replace every occurrence of
 `self.geometry.__getattribute__('NAME')` with `self.geometry.NAME`, for
 every `NAME`.

 The second is -- instead of trying to generate the WKT yourself, it seems
 better to use GEOS objects -- WKT generation is already implemented there,
 as long as a ton of other functionality. The GEOS objects are explained
 [https://docs.djangoproject.com/en/1.6/ref/contrib/gis/geos/ here].

 So -- the right thing to achieve, apparently, is a custom field, which
 inherits `TextField` and interprets the object it gets as a GEOS object. I
 haven't looked into the !GeoDjango (Oracle backend) code, but perhaps you
 can extract some code from there which will help you; I'd be a little
 surprised if SDO_GEOMETRY objects themselves are much different between
 Oracle XE and Standard.

 Hope this helps,
 Shai.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21273#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.d8ff3333e745bc4c74dd0ddfbb025cd7%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to