From 9b95208d42fd03e219a4cea646ad98c76f4246a2 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Wed, 10 Aug 2016 08:52:34 -0400 Subject: [PATCH 1/2] Fixed Windows error running Let's Encrypt --- just | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/just b/just index 8c41c33..4037688 100755 --- a/just +++ b/just @@ -895,23 +895,23 @@ while (( $# > 0 )); do shift 1 ;; le-cert) # Runs let's encrypt, registering a certificate against $1 - ${DOCKER_EXEC} ${VIP_DOCKER_HTTPD_CONTAINER_NAME} /opt/vip/wrap \ + ${DOCKER_EXEC} ${VIP_DOCKER_HTTPD_CONTAINER_NAME} ${WIN}/opt/vip/wrap \ ./conf/monkey_certbot certonly -n --apache \ - --domains=$1 --apache-server-root=/usr/local/apache2 \ - --apache-handle-sites /usr/local/apache2/conf \ + --domains=$1 --apache-server-root=${WIN}/usr/local/apache2 \ + --apache-handle-sites ${WIN}/usr/local/apache2/conf \ --agree-tos --email ${VIP_ADMIN_EMAIL} \ - --apache-challenge-location /tmp + --apache-challenge-location ${WIN}/tmp #I don't know WHY I need to do this, but oh well... ${DOCKER_EXEC} ${VIP_DOCKER_HTTPD_CONTAINER_NAME} \ - chmod -R 755 ${VIP_HTTPD_SSL_DIR_DOCK} + chmod -R 755 ${WIN}${VIP_HTTPD_SSL_DIR_DOCK} shift 1 ;; le-renew) #Renews let's encrypt certificate - ${DOCKER_EXEC} ${VIP_DOCKER_HTTPD_CONTAINER_NAME} /opt/vip/wrap \ + ${DOCKER_EXEC} ${VIP_DOCKER_HTTPD_CONTAINER_NAME} ${WIN}/opt/vip/wrap \ ./conf/monkey_certbot renew -n --apache #I don't know WHY I need to do this, but oh well... ${DOCKER_EXEC} ${VIP_DOCKER_HTTPD_CONTAINER_NAME} \ - chmod -R 755 ${VIP_HTTPD_SSL_DIR_DOCK} + chmod -R 755 ${WIN}${VIP_HTTPD_SSL_DIR_DOCK} ;; help) # Please see 'help' to see what this command does echo "List of possible J.U.S.T. commands:" From 793fc16f11928aae82c0a558e53efb2432f05c95 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Wed, 10 Aug 2016 09:26:52 -0400 Subject: [PATCH 2/2] Added get_site_geometry --- voxel_globe/event_trigger/urls.py | 1 + voxel_globe/event_trigger/views.py | 34 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/voxel_globe/event_trigger/urls.py b/voxel_globe/event_trigger/urls.py index 748021f..df5726b 100644 --- a/voxel_globe/event_trigger/urls.py +++ b/voxel_globe/event_trigger/urls.py @@ -6,6 +6,7 @@ url(r'^create_event_trigger$', views.create_event_trigger, name='create_event_trigger'), url(r'^update_geometry_polygon$', views.update_geometry_polygon , name='update_geometry_polygon'), url(r'^get_event_geometry$', views.get_event_geometry, name='get_event_geometry'), + url(r'^get_site_geometry$', views.get_site_geometry, name='get_site_geometry'), url(r'^run_event_trigger$', views.run_event_trigger, name='run_event_trigger'), url(r'^eventTriggerCreator/$', views.eventTriggerCreator, name='eventTriggerCreator'), ) \ No newline at end of file diff --git a/voxel_globe/event_trigger/views.py b/voxel_globe/event_trigger/views.py index 94292bd..b185c20 100644 --- a/voxel_globe/event_trigger/views.py +++ b/voxel_globe/event_trigger/views.py @@ -100,6 +100,40 @@ def get_event_geometry(request): return HttpResponse(json.dumps(points)) +def get_site_geometry(request): + import json + from django.shortcuts import HttpResponse + import voxel_globe.meta.models as models + import brl_init + import vpgl_adaptor_boxm2_batch as vpgl_adaptor + + image_id = int(request.GET['image_id']) + site_id = int(request.GET['site_id']) + + image = models.Image.objects.get(id=image_id) + site = models.SattelSite.objects.get(id=site_id) + camera = image.camera_set.filter(cameraset=site.camera_set).select_subclasses('rpccamera')[0] + vxl_camera = vpgl_adaptor.load_rational_camera_from_txt(camera.rpc_path) + + x1 = site.bbox_min[0] + y1 = site.bbox_min[1] + x2 = site.bbox_max[0] + y2 = site.bbox_max[1] + z = site.bbox_min[2] + + points = [] + coords = [[x1,y1,z], + [x1,y2,z], + [x2,y2,z], + [x2,y1,z], + [x1,y1,z]] + + for coord in coords: + points.append(vpgl_adaptor.project_point(vxl_camera, *coord)) + + return HttpResponse(json.dumps(points)) + + def create_event_trigger(request): import voxel_globe.meta.models as models from django.contrib.gis.geos import Point, Polygon