Skip to content

Commit

Permalink
- Fix bbox projection
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Oct 3, 2018
1 parent 4a3c8d1 commit 5ca88c5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ geonode\.tests\.bdd\.e2e\.test_login/
*.log

/celerybeat.pid
/celerybeat-schedule
Binary file modified celerybeat-schedule
Binary file not shown.
3 changes: 2 additions & 1 deletion geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def decimal_encode(bbox):
if isinstance(o, decimal.Decimal):
o = (str(o) for o in [o])
_bbox.append(o)
return _bbox
# Must be in the form : [x0, x1, y0, y1
return [_bbox[0], _bbox[2], _bbox[1], _bbox[3]]

def sld_definition(style):
from urllib import quote
Expand Down
3 changes: 2 additions & 1 deletion geonode/maps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ def decimal_encode(bbox):
if isinstance(o, decimal.Decimal):
o = (str(o) for o in [o])
_bbox.append(o)
return _bbox
# Must be in the form : [x0, x1, y0, y1
return [_bbox[0], _bbox[2], _bbox[1], _bbox[3]]

def sld_definition(style):
from urllib import quote
Expand Down
17 changes: 8 additions & 9 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,16 +1385,15 @@
# 'schedule': crontab(hour=16, day_of_week=5),
# },
# }
DELAYED_SECURITY_SIGNALS = ast.literal_eval(os.environ.get('DELAYED_SECURITY_SIGNALS', 'True'))
if DELAYED_SECURITY_SIGNALS:
CELERY_ENABLE_UTC = True
CELERY_TIMEZONE = TIME_ZONE
CELERY_BEAT_SCHEDULE = {
'send-summary-every-hour': {
'task': 'geonode.security.tasks.synch_guardian',
'schedule': crontab(minute='*/10'),
}
DELAYED_SECURITY_SIGNALS = ast.literal_eval(os.environ.get('DELAYED_SECURITY_SIGNALS', 'False'))
CELERY_ENABLE_UTC = True
CELERY_TIMEZONE = TIME_ZONE
CELERY_BEAT_SCHEDULE = {
'send-summary-every-hour': {
'task': 'geonode.security.tasks.synch_guardian',
'schedule': crontab(minute='*/10'),
}
}

# Half a day is enough
CELERY_TASK_RESULT_EXPIRES = 43200
Expand Down
5 changes: 4 additions & 1 deletion geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ def _v(coord, x, source_srid=4326, target_srid=3857):
srid=source_srid)
poly = GEOSGeometry(wkt, srid=source_srid)
poly.transform(target_srid)
return tuple([str(x) for x in poly.extent]) + ("EPSG:%s" % poly.srid,)
projected_bbox = [str(x) for x in poly.extent]
# Must be in the form : [x0, x1, y0, y1, EPSG:<target_srid>)
return tuple([projected_bbox[0], projected_bbox[2], projected_bbox[1], projected_bbox[3]]) + \
("EPSG:%s" % poly.srid,)
except BaseException:
tb = traceback.format_exc()
logger.debug(tb)
Expand Down

0 comments on commit 5ca88c5

Please sign in to comment.