Skip to content

Commit

Permalink
fixed calculations for dataset id for the api
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsarik committed Dec 7, 2017
1 parent ab78449 commit 4207c7d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
url(r'^datasets/', DataSetList.as_view({'get': 'list'})),
# url(r'^datasets/', DataSetList.as_view()),
url(r'^dataset/(?P<ds_id>[0-9]+)/$', DataSetDetail.as_view()),
# url(r'^dataset/', 'api.views.dataset', name='dataset'),

url(r'^shapefiles-list/$', ShapeFileList.as_view({'get': 'list'})),
url(r'^shapefile/(?P<sf_id>[0-9]+)/$', ShapeFileDetail.as_view()),
Expand Down
4 changes: 3 additions & 1 deletion src/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ def get(self, request, ds_id, format=None):
if request.auth:
try:
queryset = DataSet.objects.get(pk=ds_id)
serializer = DataSetsSerializer(queryset)
# serializer = DataSetsSerializer(queryset)
serializer = DataSetSerializer(queryset)
data = serializer.data
except DataSet.DoesNotExist:
return Response({'error': 'DataSet Does Not Exist'}, status=status.HTTP_400_BAD_REQUEST)
Expand Down Expand Up @@ -761,6 +762,7 @@ def post(self, request, ds_id, format=None):
# }

data = {
'POST': request.GET,
'file_name': file_name,
'fl': fl,
'EXT': ext,
Expand Down
14 changes: 7 additions & 7 deletions src/customers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,7 @@ def customer_section(request):

# get the lat/lon values for a GeoTIFF files
try:
# print '!!!!!!!!!! FILE TIF =============================== ', file_tif
print '!!!!!!!!!! FILE TIF =============================== ', file_tif

ds = gdal.Open(file_tif)
width = ds.RasterXSize
Expand Down Expand Up @@ -3553,13 +3553,13 @@ def customer_section(request):
cLat = 0
cLng = 0

# print '!!!!!!!!!! E centerY =============================== ', cLat
# print '!!!!!!!!!! E centerX =============================== ', cLng
print '!!!!!!!!!! E centerY =============================== ', cLat
print '!!!!!!!!!! E centerX =============================== ', cLng

# print '!!!!!!!!!! MIN Y LAT 1 =============================== ', eLat_1
# print '!!!!!!!!!! MIN X LNG 1 =============================== ', eLng_1
# print '!!!!!!!!!! MAX Y LAT 2 =============================== ', eLat_2
# print '!!!!!!!!!! MAX X LNG 2 =============================== ', eLng_2
print '!!!!!!!!!! MIN Y LAT 1 =============================== ', eLat_1
print '!!!!!!!!!! MIN X LNG 1 =============================== ', eLng_1
print '!!!!!!!!!! MAX Y LAT 2 =============================== ', eLat_2
print '!!!!!!!!!! MAX X LNG 2 =============================== ', eLng_2

# print '!!!!!!!!!!!!!!!!! data_set =============================== ', cip_choice.data_set.name
# print '!!!!!!!!!!!!!!!!! google_map_zoom =============================== ', google_map_zoom
Expand Down
5 changes: 5 additions & 0 deletions src/templates/customers/customer_section.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ <h4 class="margin-bottom-30" id="aoi_selected"><b>AOI selected:</b> <span>{{ sub
var select_aoi = '{{ select_aoi }}';


console.log('IMAGE URL: ', select_image);
// alert('IMAGE 2: '+select_image);
// alert('eLat_1: '+{{ eLat_1 }});
// alert('eLng_1: '+{{ eLng_1 }});
// alert('eLat_2: '+{{ eLat_2 }});
Expand Down Expand Up @@ -436,6 +438,9 @@ <h4 class="margin-bottom-30" id="aoi_selected"><b>AOI selected:</b> <span>{{ sub

console.log('GOOGLE_MAP_ZOOM after: ', curent_zoom);

console.log('GOOGLE_MAP CENTER: ', center_map);


console.log('GOOGLE_MAP eLat_1: ', {{ eLat_1 }});
console.log('GOOGLE_MAP eLng_1: ', {{ eLng_1 }});
console.log('GOOGLE_MAP eLat_2: ', {{ eLat_2 }});
Expand Down

0 comments on commit 4207c7d

Please sign in to comment.