Docker for Geoprocessing: Difference between revisions
Brian Wilson (talk | contribs) mNo edit summary |
Brian Wilson (talk | contribs) mNo edit summary |
||
Line 17: | Line 17: | ||
* Python | * Python | ||
* Remote Development pack (includes Remote-Containers and Remote-SSH extensions) | * Remote Development pack (includes Remote-Containers and Remote-SSH extensions) | ||
=== Python in VSCode === | |||
At home I have to install a virtual environment, in a Terminal, I do '''python3 -m venv .venv''' | |||
and then '''pip install -r requirements.txt''' | |||
Then I can run the debugger on local projects. | |||
=== Python in Docker container in VSCode === | |||
Start with a project that works like '''git clone https://github.com/Microsoft/vscode-remote-try-python''' | |||
When you open the project folder in VScode it should now offer to restart in Docker. Click "Restart" and wait while it downloads images and starts. | |||
Then open a Terminal and you should see a prompt similar to this: '''vscode@c52318f7383c:/workspaces/vscode-remote-try-python$''' | |||
Now you can set a breakpoint in app.py for example and run with F5. "print" statements will output to the TERMINAL window. | |||
== The story so far == | == The story so far == |
Revision as of 18:24, 25 March 2020
I am trying to get Geoprocessing jobs to run inside Docker so that they are more portable and easier to reuse across different machines.
COVID19 and WFH
COVID19 hit so I had to get set up to work at home. I had already been using git so my code was up there.
On my home computer Murre which runs Windows 10, I needed to install
- Visual Studio Code for Windows with the extensions listed below
- Docker Desktop, for Windows
- git for windows because Visual Studio Code uses it
- cygwin so I'd have bash, maybe you don't care about bash and use Powershell instead?
What else? I'll add as I think of it.
VSCode extensions that I currently have installed
- Debugger for Chrome
- Docker
- Python
- Remote Development pack (includes Remote-Containers and Remote-SSH extensions)
Python in VSCode
At home I have to install a virtual environment, in a Terminal, I do python3 -m venv .venv and then pip install -r requirements.txt
Then I can run the debugger on local projects.
Python in Docker container in VSCode
Start with a project that works like git clone https://github.com/Microsoft/vscode-remote-try-python When you open the project folder in VScode it should now offer to restart in Docker. Click "Restart" and wait while it downloads images and starts. Then open a Terminal and you should see a prompt similar to this: vscode@c52318f7383c:/workspaces/vscode-remote-try-python$
Now you can set a breakpoint in app.py for example and run with F5. "print" statements will output to the TERMINAL window.
The story so far
The big picture is to create an elevation surface and then contours for Clatsop County from LiDAR data provided by DOGAMI.
DOWNLOADER
I created https://github.com/Wildsong/geoprocessing Wildsong/lidar_downloader] to download all the data for the county and got it working. This does no geoprocessing, it just grabs files from a remote server using a CSV full of URLs so it's not in a Docker (yet). Now I have data at home to work with.
DATA
I unpacked the zips here: /d/GIS/OR/DOGAMI/ClatsopCounty
MOSAICS
I am going to build VRT files using GDAL, so now I need the Docker. I've created a Github project called Wildsong/geoprocessing.