summaryrefslogtreecommitdiff
path: root/tests/gis_tests/geo3d/models.py
blob: a09c599b02568ddd11e3f25b85ab23d7a8c602ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from django.contrib.gis.db import models


class NamedModel(models.Model):
    name = models.CharField(max_length=30)

    class Meta:
        abstract = True

    def __str__(self):
        return self.name


class City3D(NamedModel):
    point = models.PointField(dim=3)
    pointg = models.PointField(dim=3, geography=True)

    class Meta:
        required_db_features = {"supports_3d_storage"}


class Interstate2D(NamedModel):
    line = models.LineStringField(srid=4269)


class Interstate3D(NamedModel):
    line = models.LineStringField(dim=3, srid=4269)

    class Meta:
        required_db_features = {"supports_3d_storage"}


class InterstateProj2D(NamedModel):
    line = models.LineStringField(srid=32140)


class InterstateProj3D(NamedModel):
    line = models.LineStringField(dim=3, srid=32140)

    class Meta:
        required_db_features = {"supports_3d_storage"}


class Polygon2D(NamedModel):
    poly = models.PolygonField(srid=32140)


class Polygon3D(NamedModel):
    poly = models.PolygonField(dim=3, srid=32140)

    class Meta:
        required_db_features = {"supports_3d_storage"}


class SimpleModel(models.Model):
    class Meta:
        abstract = True


class Point2D(SimpleModel):
    point = models.PointField(null=True)


class Point3D(SimpleModel):
    point = models.PointField(dim=3)

    class Meta:
        required_db_features = {"supports_3d_storage"}


class MultiPoint3D(SimpleModel):
    mpoint = models.MultiPointField(dim=3)

    class Meta:
        required_db_features = {"supports_3d_storage"}