class MapRegion(models.Model):
    region_name = models.CharField(max_length=200)
    current_cases = models.IntegerField(default=0)
    geom = PolygonField()

    def __str__(self):
        return self.region_name
Example #2
0
class PermanentParcel(models.Model):
    name = models.CharField(verbose_name="Nombre de la parcela",
                            max_length=50)  # todo parcel_name?
    # todo add responsable relaciona a User
    # todo add institución relaciona a User
    province = models.CharField(verbose_name="Provincia",
                                choices=(('Misiones', 'Misiones'), ),
                                max_length=10)
    municipality = models.CharField(
        verbose_name="Municipio",
        max_length=50)  # TODO add 75 municipio como choices
    locality = models.CharField(verbose_name="Localidad", max_length=50)
    obs = models.TextField(verbose_name="Obervaciones")  # todo blank=True
    latitude = models.FloatField(
        verbose_name='latitud',
        validators=[validate_lat],
        blank=True,
        help_text="informar en formato en grados decimales WGS84 - epsg4326")
    longitude = models.FloatField(
        verbose_name='longitud',
        validators=[validate_lon],
        blank=True,
        help_text="informar en formato en grados decimales WGS84 - epsg4326")
    geom = PolygonField(blank=True)

    @property
    def geom_point(self):
        return Point((self.longitude, self.latitude))

    def __str__(self):
        return f'{self.name}, {self.municipality} - {self.locality}'

    class Meta:
        verbose_name_plural = 'Parcelas Permanentes'
        verbose_name = 'Parcela Permanente'
Example #3
0
class Area(Timestampable, Taggable, models.Model):
    """Places of any kind."""

    name = models.CharField(_('name'),
                            max_length=128,
                            help_text=_('Area name'))

    identifier = models.CharField(_('identifier'),
                                  blank=True,
                                  null=True,
                                  max_length=128,
                                  help_text='Area identifier')

    parent = models.ForeignKey('Area',
                               blank=True,
                               null=True,
                               help_text='Area parent')

    geometry = PolygonField(blank=True,
                            null=True,
                            help_text='Polygon field for area')

    calssification = models.CharField(
        _('classification'),
        blank=True,
        null=True,
        max_length=128,
        help_text='Area classification (Unit/Region)')

    def __str__(self):
        return self.name
Example #4
0
class provider(models.Model):
    Service_Areas = PolygonField(default={})
    name = models.CharField(max_length=100, blank=True, default='')
    email = models.CharField(max_length=30, blank=True, default='')
    phone = models.CharField(max_length=15, blank=True, default='')
    Language = models.CharField(max_length=20, blank=True, default='')
    Currency = models.CharField(max_length=20, blank=True, default='')
Example #5
0
class Settlements(gismodels.Model):

    name = models.CharField("Название населенного пункта", max_length=50)
    alarm = models.SmallIntegerField("Угроза вначале")
    alarm_end = models.SmallIntegerField("Угроза вконце")
    bereg = models.CharField("Берег", max_length=20)
    start = models.DecimalField("Расстояние по реке Ясельда - начало, км",
                                max_digits=6,
                                decimal_places=2)
    start_brovka = models.DecimalField("Отметка бровки Ясельды - начало, м БС",
                                       max_digits=6,
                                       decimal_places=2)
    start_alarm = models.DecimalField("Отметка опасности - начало, м БС",
                                      max_digits=6,
                                      decimal_places=2)
    end = models.DecimalField("Расстояние по реке Ясельда - конец, км",
                              max_digits=6,
                              decimal_places=2)
    end_brovka = models.DecimalField("Отметка бровки Ясельды - конец, м БС",
                                     max_digits=6,
                                     decimal_places=2)
    end_alarm = models.DecimalField("Отметка опасности - конец, м БС",
                                    max_digits=6,
                                    decimal_places=2)
    description = models.CharField("Описание риска", max_length=60)

    geom = PolygonField()

    @property
    def popupContent(self):
        return self.alarm, self.name, self.description

    def __unicode__(self):
        return u" %s %s " % (self.name, self.description)
Example #6
0
class Neighborhood(models.Model):
    ''' DC neighborhood areas, 5 constant '''
    name = models.CharField(max_length=15)
    geom = PolygonField()
    slug = models.SlugField(max_length=20, unique=True)

    def __str__(self):
        return self.name
Example #7
0
class Polygon(models.Model):
    geom = PolygonField(models.Model)
    description = models.TextField(default="mock description")

    @property
    def popup_content(self):
        return '<p>{}</p>'.format(
            self.description)
Example #8
0
class Building(models.Model):

    propertyname = models.CharField(max_length=256)
    title = models.CharField(max_length=256)
    description = models.TextField()
    geom = PolygonField()

    def __unicode__(self):
        return self.title
Example #9
0
class ParcelSpot(models.Model):

    title = models.CharField(max_length=256)
    description = models.TextField()
    price = []
    date = []
    geom = PolygonField()

    def __str__(self):
        return self.title
Example #10
0
class FieldPlot(models.Model):

    title = models.CharField(max_length=256)
    description = models.TextField()
    geom = PolygonField()

    def __unicode__(self):
        return self.title

    @property
    def picture_url(self):
        return self.picture.url
Example #11
0
class MushroomSpot(models.Model):

    title = models.CharField(max_length=256)
    description = models.TextField()
    picture = models.ImageField()
    geom = PolygonField()

    def __str__(self):
        return self.title

    @property
    def picture_url(self):
        return self.picture.url
Example #12
0
class SelectArea(models.Model):
    name = models.CharField(max_length=64, unique=True)
    geom = PolygonField()
    feature_type = models.ForeignKey(FeatureType,
                                     on_delete=models.CASCADE,
                                     related_name="areas")

    @property
    def SiteType(self):
        return '{}'.format(self.feature_type)

    def __str__(self):
        return f"{self.name}"
Example #13
0
class ObjectSpot(models.Model):

    title = models.CharField(max_length=256)
    description = models.TextField()
    type = models.CharField(max_length=16)
    picture = models.ImageField(upload_to=settings.IMAGE_DIR)
    geom = PolygonField()

    def __unicode__(self):
        return self.title

    @property
    def picture_url(self):
        return self.picture.url
Example #14
0
class Polygons(models.Model):
    

    polygon_id      = models.AutoField(primary_key=True)
    user            = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) 
    Name            = models.CharField(max_length=120, null=False, blank= False )
    Price           = models.DecimalField(max_digits=10, decimal_places=2)
    Polygon         = PolygonField()
    
    def __str__(self):
        return str(self.user.email)
    @property
    def owner(self):
        return self.user
Example #15
0
class Polygon(models.Model):
    quest = models.ForeignKey(Quest, on_delete=models.CASCADE)
    title = models.CharField(max_length=256)
    level = models.IntegerField(default="1")
    description = models.TextField()
    picture = models.CharField(max_length=100, default="")
    color = models.CharField(max_length=20, default="#ff7800")
    geom = PolygonField()

    def __str__(self):
        return self.title

    @property
    def picture_url(self):
        return self.picture
Example #16
0
class Area(models.Model):
    name = models.TextField()
    geom = PolygonField()

    description = models.TextField()
    color = models.TextField()
    picture = models.ImageField()

    def __str__(self):
        return self.name

    @property
    def popupContent(self):
        return '<p>{}</p><img src="{}" />'.format(self.description,
                                                  self.picture.url)

    @property
    def colors(self):
        return self.color
Example #17
0
class Polygon(GeoJSONShape, style_cls=PolygonStyle):
    geom = PolygonField()