Django

Code

Show
Ignore:
Timestamp:
07/05/08 11:59:51 (6 months ago)
Author:
jbronn
Message:

gis: Fixed #7579; no longer attempt to transform input geometries if GeometryField has its SRID set to -1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/tests/geoapp/models.py

    r6886 r7840  
    2828    objects = models.GeoManager() 
    2929    def __unicode__(self): return self.name 
     30 
     31class MinusOneSRID(models.Model): 
     32    geom = models.PointField(srid=-1) # Minus one SRID. 
     33    objects = models.GeoManager() 
  • django/branches/gis/django/contrib/gis/tests/geoapp/tests.py

    r7836 r7840  
    11import os, unittest 
    2 from models import Country, City, State, Feature 
     2from models import Country, City, State, Feature, MinusOneSRID 
    33from django.contrib.gis import gdal 
    44from django.contrib.gis.db.backend import SpatialBackend 
     
    302302        self.assertAlmostEqual(wgs_pnt.x, sa.point.x, 6) 
    303303        self.assertAlmostEqual(wgs_pnt.y, sa.point.y, 6) 
     304 
     305        # If the GeometryField SRID is -1, then we shouldn't perform any 
     306        # transformation if the SRID of the input geometry is different. 
     307        m1 = MinusOneSRID(geom=Point(17, 23, srid=4326)) 
     308        m1.save() 
     309        self.assertEqual(-1, m1.geom.srid) 
    304310 
    305311    # Oracle does not support NULL geometries in its spatial index for