tudelft3d / matahn

Download tool for AHN2 that delivers a LAZ file with the points inside a bounding box drawn by the user.
http://3dsm.bk.tudelft.nl/matahn
GNU General Public License v3.0
2 stars 2 forks source link

problem getting result from celery task #6

Closed squeakus closed 8 years ago

squeakus commented 8 years ago

Hi, After converting my points to EPSG:3857 I tried getting the matahn code working to download the point cloud. Unfortunately after I draw the box and select fetch it returns an internal server error.

Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I can see in the server window that when I draw the box it correctly estimates the points but then crashes once the download button is clicked:

"GET /_getPointCountEstimate?left=10484022.348629&bottom=3462167.8965783&right=10484084.453715&top=3462201.3377782 HTTP/1.1" 200 - 127.0.0.1 - - [02/Nov/2015 19:48:29] "GET /_submit?left=10484022.348629&bottom=3462167.8965783&right=10484084.453715&top=3462201.3377782&classification=g&email=jonathanbyrn%40gmail.com HTTP/1.1" 200 - 127.0.0.1 - - [02/Nov/2015 19:48:29] "GET /tasks/630d8716-043b-41dc-afca-eac26d1e1651 HTTP/1.1" 500 - lasinfo report for /home/jonathan/tmp/630d8716-043b-41dc-afca-eac26d1e1651.laz

It successfully generates the report and the las file in the tmp folder but seems to have problems sending it to the user. I have checked the matahn variables and they seem okay: LASINFO_BINARY = '/home/jonathan/Applications/LAStools/bin/lasinfo' LASMERGE_BINARY ='/home/jonathan/Applications/LAStools/bin/lasmerge' TASKS_FOLDER = '/home/jonathan/tmp/'

Assuming it was some sort of permission issue I tried fixing it with: sudo chown -R www-data:www-data tmp

but no luck. Any idea what might be causing it?

Ylannl commented 8 years ago

So it crashes when you access the url /tasks/download/630d8716-043b-41dc-afca-eac26d1e1651 ?

squeakus commented 8 years ago

Yes, The files are being created in the TASKS_FOLDER folder but it doesnt seem to be able to access them.

On 3 November 2015 at 13:40, Ravi Peters notifications@github.com wrote:

So it crashes when you access the url /tasks/download/630d8716-043b-41dc-afca-eac26d1e1651 ?

— Reply to this email directly or view it on GitHub.

Ylannl commented 8 years ago

Have you set DEBUG = True in the config file?

If not in DEBUG mode, file downloading should be handled by a web server. I use nginx, which is configured to directly serve the laz files when requested through that url. See http://nginx.org/en/docs/beginners_guide.html#static

squeakus commented 8 years ago

Hi Ravi, Just to be clear, up to this point we have been using the internal flask development server and that server cannot handle files so instead we need a proper server to handle everything. Is that correct?

I am currently more familiar with apache so I am going to follow the instructions for serving up the matahn site by installing mod_wsgi: http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/#installing-mod-wsgi Do you think this will work?

Finally the matahn files are installed in /usr/local/lib/python2.7/dist-packages. Should I serve the files from there or should I move them to /var/www?

Apologies for all the questions but I am new to this sort of web development and haven't got a clear mental picture of how all the components fit together. regards Jonathan

On 3 November 2015 at 14:02, Ravi Peters notifications@github.com wrote:

Have you set DEBUG = True in the config file?

If not in DEBUG mode, file downloading should be handled by a web server. I use nginx, which is configured to directly serve the laz files when requested through that url. See http://nginx.org/en/docs/beginners_guide.html#static

— Reply to this email directly or view it on GitHub https://github.com/tudelft3d/matahn/issues/6#issuecomment-153363344.

Ylannl commented 8 years ago

Apache should be fine. I suppose you don't have to move the matahn files as long as you can import them. But I'ld recommend using a virtualenv just for matahn as mentioned in your link.