Ran the GeoDjango test suite on Oracle 11g and received the following errors:
======================================================================
FAIL: Testing GML output from the database using GeoManager.gml().
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\GeoDjango\Django-1.0.2-final\django\contrib\gis\tests\geoapp\tests.py", line 155, in test03b_gml
self.assertEqual(True, bool(gml_regex.match(ptown.gml)))
AssertionError: True != False
======================================================================
FAIL: Testing the `distance` GeoQuerySet method on projected coordinate systems.
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\GeoDjango\Django-1.0.2-final\django\contrib\gis\tests\distapp\tests.py", line 129, in test03a_distance_method
self.assertAlmostEqual(m_distances[i], c.distance.m, tol)
AssertionError: 147075.06981300001 != 44828.570935898977 within 2 places
======================================================================
FAIL: Testing the `distance_lt`, `distance_gt`, `distance_lte`, and `distance_gte` lookup types.
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\GeoDjango\Django-1.0.2-final\django\contrib\gis\tests\distapp\tests.py", line 200, in test04_distance_lookups
self.assertEqual(cities, ['Bellaire', 'Pearland', 'West University Place'])
AssertionError: [] != ['Bellaire', 'Pearland', 'West University Place']
The first failure is simply different precision values in the GML output, and is easily solved with a better regex in the test suite. The next two problems from the distance test suite, however, will require more investigative work.
On 10g (10.2) the spatial reference WKT for 2278 is:
Here's simplified SQL of what's going on in the
distapp
tests and just using two points on 10g: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:
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: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.