Exemplo n.º 1
0
class Parcel(models.Model):
    name = models.CharField(max_length=30)
    city = models.ForeignKey(City)
    center1 = models.PointField()
    # Throwing a curveball w/`db_column` here.
    center2 = models.PointField(srid=2276, db_column='mycenter')
    border1 = models.PolygonField()
    border2 = models.PolygonField(srid=2276)
    objects = models.GeoManager()

    def __unicode__(self):
        return self.name
Exemplo n.º 2
0
class City(models.Model):
    name = models.CharField(max_length=30)
    point = models.PointField()
    objects = models.GeoManager()

    def __unicode__(self):
        return self.name
class City(models.Model):
    name = models.CharField(max_length=25)
    population = models.IntegerField()
    density = models.DecimalField(max_digits=7, decimal_places=1)
    dt = models.DateField()
    point = models.PointField()
    objects = models.GeoManager()
class SouthTexasCity(models.Model):
    "City model on projected coordinate system for South Texas."
    name = models.CharField(max_length=30)
    point = models.PointField(srid=32140)
    objects = models.GeoManager()

    def __unicode__(self):
        return self.name
class AustraliaCity(models.Model):
    "City model for Australia, using WGS84."
    name = models.CharField(max_length=30)
    point = models.PointField()
    objects = models.GeoManager()

    def __unicode__(self):
        return self.name
class SouthTexasCityFt(models.Model):
    "Same City model as above, but U.S. survey feet are the units."
    name = models.CharField(max_length=30)
    point = models.PointField(srid=2278)
    objects = models.GeoManager()

    def __unicode__(self):
        return self.name
Exemplo n.º 7
0
 class MinusOneSRID(models.Model):
     geom = models.PointField(srid=-1)  # Minus one SRID.
     objects = models.GeoManager()
Exemplo n.º 8
0
class Location(models.Model):
    point = models.PointField()
    objects = models.GeoManager()

    def __unicode__(self):
        return self.point.wkt
class Invalid(models.Model):
    point = models.PointField()
Exemplo n.º 10
0
class Point3D(models.Model):
    point = models.PointField(dim=3)
    objects = models.GeoManager()
Exemplo n.º 11
0
class Point2D(models.Model):
    point = models.PointField()
    objects = models.GeoManager()