-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added envvars for ports; Added geojson calculated in DB
- Loading branch information
1 parent
0aa85dd
commit c534f6a
Showing
8 changed files
with
125 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.contrib.gis.db.models import functions | ||
from django.db import models | ||
|
||
|
||
class AsGeoJSON(functions.AsGeoJSON): | ||
output_field = models.TextField() | ||
|
||
def __init__(self, expression, bbox=False, crs=False, precision=8, **extra): | ||
expressions = [expression] | ||
if precision is not None: | ||
expressions.append(self._handle_param(precision, "precision", int)) | ||
options = 0 | ||
if crs and bbox: | ||
options = 3 | ||
elif bbox: | ||
options = 1 | ||
elif crs: | ||
options = 2 | ||
expressions.append(options) | ||
super().__init__(*expressions, **extra) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.