kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed contours, volume measurement, upgraded GRASS GIS to 7.8
rodzic
01bab2f901
commit
016398be10
|
@ -3,6 +3,7 @@ MAINTAINER Piero Toffanin <pt@masseranolabs.com>
|
|||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV PYTHONPATH $PYTHONPATH:/webodm
|
||||
ENV PROJ_LIB=/usr/share/proj
|
||||
|
||||
# Prepare directory
|
||||
RUN mkdir /webodm
|
||||
|
@ -18,7 +19,7 @@ RUN printf "deb http://ftp.us.debian.org/debian/ stable main contrib non-
|
|||
RUN printf "deb http://ftp.us.debian.org/debian/ testing main contrib non-free\ndeb-src http://ftp.us.debian.org/debian/ testing main contrib non-free" > /etc/apt/sources.list.d/testing.list
|
||||
|
||||
# Install Node.js GDAL, nginx, letsencrypt, psql
|
||||
RUN apt-get -qq update && apt-get -qq install -t testing -y binutils libproj-dev gdal-bin nginx certbot && apt-get -qq install -y gettext-base cron postgresql-client-9.6 grass-core
|
||||
RUN apt-get -qq update && apt-get -qq install -t testing -y binutils libproj-dev gdal-bin nginx certbot grass-core && apt-get -qq install -y gettext-base cron postgresql-client-9.6
|
||||
|
||||
# Install pip reqs
|
||||
ADD requirements.txt /webodm/
|
||||
|
|
|
@ -29,7 +29,7 @@ class TaskContoursGenerate(TaskView):
|
|||
else:
|
||||
raise GrassEngineException('{} is not a valid layer.'.format(layer))
|
||||
|
||||
context = grass.create_context({'auto_cleanup' : False})
|
||||
context = grass.create_context({'auto_cleanup' : False, 'location': 'epsg:3857'})
|
||||
epsg = int(request.data.get('epsg', '3857'))
|
||||
interval = float(request.data.get('interval', 1))
|
||||
format = request.data.get('format', 'GPKG')
|
||||
|
@ -43,8 +43,6 @@ class TaskContoursGenerate(TaskView):
|
|||
context.add_param('format', format)
|
||||
context.add_param('simplify', simplify)
|
||||
context.add_param('epsg', epsg)
|
||||
#context.set_location('epsg:' + str(epsg))
|
||||
context.set_location(dem)
|
||||
|
||||
celery_task_id = execute_grass_script.delay(os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
|
@ -63,12 +61,12 @@ class TaskContoursCheck(TaskView):
|
|||
else:
|
||||
result = res.get()
|
||||
if result.get('error', None) is not None:
|
||||
cleanup_grass_context(result['context'])
|
||||
#cleanup_grass_context(result['context'])
|
||||
return Response({'ready': True, 'error': result['error']})
|
||||
|
||||
contours_file = result.get('output')
|
||||
if not contours_file or not os.path.exists(contours_file):
|
||||
cleanup_grass_context(result['context'])
|
||||
#cleanup_grass_context(result['context'])
|
||||
return Response({'ready': True, 'error': 'Contours file could not be generated. This might be a bug.'})
|
||||
|
||||
request.session['contours_' + celery_task_id] = contours_file
|
||||
|
|
|
@ -24,6 +24,7 @@ fi
|
|||
MIN_CONTOUR_LENGTH=5
|
||||
|
||||
r.external input="${dem_file}" output=dem --overwrite
|
||||
g.region raster=dem
|
||||
r.contour input=dem output=contours step=${interval} --overwrite
|
||||
v.generalize --overwrite input=contours output=contours_smooth method=douglas threshold=${simplify}
|
||||
v.generalize --overwrite input=contours_smooth output=contours_simplified method=chaiken threshold=1
|
||||
|
|
|
@ -25,7 +25,7 @@ class TaskElevationMapGenerate(TaskView):
|
|||
return Response({'error': 'No DTM layer is available. You need one to set the ground as reference.'}, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
try:
|
||||
context = grass.create_context({'auto_cleanup' : False})
|
||||
context = grass.create_context({'auto_cleanup' : False, 'location': 'epsg:3857'})
|
||||
dsm = os.path.abspath(task.get_asset_download_path("dsm.tif"))
|
||||
dtm = os.path.abspath(task.get_asset_download_path("dtm.tif")) if reference.lower() == 'ground' else None
|
||||
epsg = int(request.data.get('epsg', '3857'))
|
||||
|
|
|
@ -143,4 +143,4 @@ def execute_grass_script(script, serialized_context = {}):
|
|||
ctx = grass.create_context(serialized_context)
|
||||
return {'output': ctx.execute(script), 'context': ctx.serialize()}
|
||||
except GrassEngineException as e:
|
||||
return {'error': str(e)}
|
||||
return {'error': str(e), 'context': ctx.serialize()}
|
Ładowanie…
Reference in New Issue