GeoMoose
Overview
I am setting up a demo copy of GeoMoose so that I can see how it works internally. It has two parts, a mapserver and a javascript client.
The official project is now in github, https://github.com/geomoose There are several repos. See their get started docs at http://geomoose.org
Docker based GeoMoose wasted my time
GeoMoose 3 ("gm3") uses Docker (in the Linux example anyway) to set up a copy of mapserver. It includes a build step that takes too long IMO! I copied the Dockerfile into this github repo and hooked it up to autobuild on Docker Hub.
Grrr. It does not build! On my third try now.
I ran the build locally to debug it. There was a missing library. This was the process.
- It threw an error referencing a log file that's buried inside the temporary docker container.
- I looked up the name of the crashed container with: docker ps -a
- I created a snapshot of the (crashed) container. docker commit the_container_name_or_id snappy
- I started the snapshot with a shell and looked at the file: docker run -it snappy bash
- I searched for the library: cat /usr/local/src/mapserver/build/CMakeFiles/CMakeError.log
- I added the library to the Dockerfile that I found by searching for it: apt-cache search pthreads
- I built it locally to make sure it would complete: docker build -t gm3 .
...and it still fails
If it worked I would do this:
- I checked the changes into github so that the automated build would happen. git commit -a -m 'added missing library' && git push
- I waited 30 minutes for it to autobuild. This build is big and slow.
- While waiting I removed the no-longer-needed local images and containers.
- I proceeded henceforth with the rest of this page.
Once I fix the build process, you should be able to start it running for testing with this:
docker run -p 8000:80 --name geomoose_demo brian32768/geomoose:latest
While it is running I can see it (sorry, not currently providing public access) at http://maps.wildsong.biz:8000/ You might want to try try http://localhost:8000/
This docker image is far from optimal, it's too big and complex and I suspect it could be built on either the official or camptocamp base images. It looks like I should PROBABLY be using docker-compose and running several separate containers to provide services but as I said, this is just a demo, so I am not trying to 'fix' it right now!
Windows based GM3 has no server
Following the instructions appears to only start the Javascript compoent of GM3.
Finally, trying the MS4W version works
Since both of those approaches were failures... https://geomoose.github.io/gm3/ms4w-quickstart/index.html
This one fails too, because the download links are broken. I dug around and found the files. Download files from here: https://geomoose.org/downloads/ I grabbed newest versions of these files: gm3-demo-data and gm3-examples
I'm doing my testing on an old laptop so I am expecting snail-like response times from Apache+MapServer. If I set my expectations low then I can only be pleasantly surprised if I am wrong. Based on the time (15:44) and the installer progress bar I won't find out today.
Hey there, I am pleasantly surprised! Installation took only 15 minutes. I can see that GeoMoose is in fact present and accounted for. Demo data is installed and the app works! My first guess appears to have been correct, they apparently do prioritize the MS4W version.
Finally I have something to look at...
MS4W version configuration
There is an Apache 2.x server, and it has a config file that routes to http://localhost/gm3 There are a couple files that show up in the home page that link to that page.
The actual code is in the apps/gm3 folder. Lots of other apps are installed in there by ms4w. You can see them referenced on the home page too (http://localhost) under "features".
There are three folders in apps/gm3/htdocs, desktop/, geomoose/, and mobile/. Desktop and mobile are the clients. The geomoose folder appears to be a copy of the github repo.
So that means 98% of this project is the client, and the heavy lifting on the server is done by MapServer.
How does buffering work?
Where I started all this was by questioning how geoprocessing (specifically feature select + buffer) is done in Geomoose...
How to add your own maps and data ????
The demo image also pulls demo data in from the official Geomoose repo so that you are ready to go. In real life, you should use a separate docker volume to hold your data. This means you put everything in a directory on the server and then tell Docker to make that directory available to the Geomoose container. I will tell you how to do that later.