class Parcel(SimpleModel): name = models.CharField(max_length=30) city = models.ForeignKey(City, models.CASCADE) 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) def __str__(self): return self.name
class OracleSpatialRefSys(models.Model, SpatialRefSysMixin): "Maps to the Oracle MDSYS.CS_SRS table." cs_name = models.CharField(max_length=68) srid = models.IntegerField(primary_key=True) auth_srid = models.IntegerField() auth_name = models.CharField(max_length=256) wktext = models.CharField(max_length=2046) # Optional geometry representing the bounds of this coordinate # system. By default, all are NULL in the table. cs_bounds = models.PolygonField(null=True) class Meta: app_label = 'gis' db_table = 'CS_SRS' managed = False @property def wkt(self): return self.wktext
class Zipcode(NamedModel): code = models.CharField(max_length=10) poly = models.PolygonField(geography=True)
class SouthTexasZipcode(NamedModel): "Model for a few South Texas ZIP codes." poly = models.PolygonField(srid=32140, null=gisfield_may_be_null)
class CensusZipcode(NamedModel): "Model for a few South Texas ZIP codes (in original Census NAD83)." poly = models.PolygonField(srid=4269)
class MultiFields(NamedModel): city = models.ForeignKey(City, models.CASCADE) point = models.PointField() poly = models.PolygonField()
class State(NamedModel): poly = models.PolygonField( null=gisfield_may_be_null) # Allowing NULL geometries here. class Meta: app_label = 'geoapp'
class Polygon3D(NamedModel): poly = models.PolygonField(dim=3, srid=32140)
class Polygon2D(NamedModel): poly = models.PolygonField(srid=32140)
class CountyFeat(NamedModel): poly = models.PolygonField(srid=4269)