mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-29 00:35:45 +08:00
Implemented geofencing logic for student_status and study_groups with landmark labels
This commit is contained in:
parent
7938c3ceef
commit
a67ea5cd8a
9 changed files with 85 additions and 27 deletions
|
@ -8,7 +8,7 @@ from django.dispatch import receiver
|
|||
|
||||
class Landmark(models.Model):
|
||||
name = models.CharField(max_length=64)
|
||||
location = gis_models.PolygonField()
|
||||
location = gis_models.PolygonField(srid=4326)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
@ -178,7 +178,7 @@ def populate_landmarks(sender, **kwargs):
|
|||
'POLYGON ((124.655534 8.485857, 124.655629 8.485588, 124.655795 8.485647, 124.655755 8.485757, 124.656271 8.485946, 124.656212 8.486104, 124.655534 8.485857))',
|
||||
srid=SRID
|
||||
)
|
||||
)
|
||||
)
|
||||
Landmark.objects.get_or_create(
|
||||
name='Science Complex',
|
||||
location=GEOSGeometry(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue