Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
class Zipcode(NamedModel):
    code = models.CharField(max_length=10)
    poly = models.PolygonField(geography=True)
Exemplo n.º 4
0
class SouthTexasZipcode(NamedModel):
    "Model for a few South Texas ZIP codes."
    poly = models.PolygonField(srid=32140, null=gisfield_may_be_null)
Exemplo n.º 5
0
class CensusZipcode(NamedModel):
    "Model for a few South Texas ZIP codes (in original Census NAD83)."
    poly = models.PolygonField(srid=4269)
Exemplo n.º 6
0
class MultiFields(NamedModel):
    city = models.ForeignKey(City, models.CASCADE)
    point = models.PointField()
    poly = models.PolygonField()
Exemplo n.º 7
0
class State(NamedModel):
    poly = models.PolygonField(
        null=gisfield_may_be_null)  # Allowing NULL geometries here.

    class Meta:
        app_label = 'geoapp'
Exemplo n.º 8
0
class Polygon3D(NamedModel):
    poly = models.PolygonField(dim=3, srid=32140)
Exemplo n.º 9
0
class Polygon2D(NamedModel):
    poly = models.PolygonField(srid=32140)
Exemplo n.º 10
0
class CountyFeat(NamedModel):
    poly = models.PolygonField(srid=4269)