#9794: GeoDjango Distance Test Failures on Oracle 11g
---------------------------------+------------------------------------------
          Reporter:  jbronn      |         Owner:  jbronn                 
            Status:  assigned    |     Milestone:                         
         Component:  GIS         |       Version:  1.0                    
        Resolution:              |      Keywords:  gis oracle 11g distance
             Stage:  Unreviewed  |     Has_patch:  0                      
        Needs_docs:  0           |   Needs_tests:  0                      
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Changes (by jbronn):

  * status:  new => assigned

Comment:

 On 10g (10.2) the spatial reference WKT for 2278 is:
 {{{
 PROJCS["NAD83 / Texas South Central (ftUS)",
     GEOGCS["NAD83",
         DATUM["North American Datum 1983 (EPSG ID 6269)",
             SPHEROID["GRS 1980 (EPSG ID 7019)",6378137,298.257222101]],
         PRIMEM["Greenwich",0.000000],
         UNIT["Decimal Degree",0.01745329251994328]],
     PROJECTION["SPCS83 Texas South Central zone (US Survey feet) (EPSG OP
 15360)"],
 PARAMETER["Latitude_Of_Origin",27.83333333333333333333333333333333333333],
 PARAMETER["Central_Meridian",-98.99999999999999999999999999999999999987],
 PARAMETER["Standard_Parallel_1",30.28333333333333333333333333333333333333],
 PARAMETER["Standard_Parallel_2",28.38333333333333333333333333333333333333],
     PARAMETER["False_Easting",1968500],
     PARAMETER["False_Northing",13123333.33300000000000000000000000000001],
     UNIT["U.S. Foot",.3048006096012192024384048768097536195072]]
 }}}

 Here's simplified SQL of what's going on in the `distapp` tests and just
 using two points on 10g:

 {{{
 SQL> SELECT SDO_GEOM.SDO_DISTANCE(SDO_CS.TRANSFORM(SDO_GEOMETRY('POINT
 (-95.3704010173142930 29.7048674094754650)', 4326), 2278),
 SDO_GEOMETRY('POINT (3092499.2911236398000000 13821123.0329729000000000)',
 2278), 0.05) FROM DUAL;
 
SDO_GEOM.SDO_DISTANCE(SDO_CS.TRANSFORM(SDO_GEOMETRY('POINT(-95.37040101731429302
 
--------------------------------------------------------------------------------
 28041.9753
 }}}

 So the units come back as expected, that is in U.S. feet, and this is why
 all tests pass on 10g.

 However, on Oracle 11g (11.1), the spatial reference WKT for 2278 is:
 {{{
 PROJCS["NAD83 / Texas South Central (ftUS)",
     GEOGCS["NAD83",
         DATUM["North American Datum 1983 (EPSG ID 6269)",
             SPHEROID["GRS 1980 (EPSG ID 7019)",6378137,298.257222101]],
         PRIMEM["Greenwich",0.000000],
         UNIT["Decimal Degree",0.01745329251994328]],
     PROJECTION["Lambert Conformal Conic"],
 PARAMETER["Latitude_Of_Origin",27.83333333333333333333333333333333333333],
 PARAMETER["Central_Meridian",-98.99999999999999999999999999999999999987],
 PARAMETER["Standard_Parallel_1",30.28333333333333333333333333333333333333],
 PARAMETER["Standard_Parallel_2",28.38333333333333333333333333333333333333],
     PARAMETER["False_Easting",1968500],
     PARAMETER["False_Northing",13123333.33300000000000000000000000000001],
     UNIT["U.S. Foot",.3048006096012192024384048768097536195072]]
 }}}

 The only difference I can tell is in the `PROJECTION` element.  Besides
 this, it still appears to be a projected coordinate system (units are
 still in U.S. Feet), but Oracle seems to think it's actually in a geodetic
 coordinate system and thus returns the units in meters instead:
 {{{
 SQL> SELECT SDO_GEOM.SDO_DISTANCE(SDO_CS.TRANSFORM(SDO_GEOMETRY('POINT
 (-95.3704010173142930 29.7048674094754650)', 4326), 2278),
 SDO_GEOMETRY('POINT (3092499.2911236398000000 13821123.0329729000000000)',
 2278), 0.05) FROM DUAL;

 
SDO_GEOM.SDO_DISTANCE(SDO_CS.TRANSFORM(SDO_GEOMETRY('POINT(-95.37040101731429302
 
--------------------------------------------------------------------------------
 8547.21118
 }}}

 So at this point, either Oracle corrected something that was wrong in 10g
 or they've mislabeled/misidentified projected coordinate systems as
 geographic ones.  The answer is still correct, but not in the right units
 so I'm not quit sure what to do here.  At least we're not totally in the
 dark anymore as to why !GeoDjango "won't go to 11" with Oracle.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9794#comment:3>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to