qgis2web:
the code
behind webmaps
without code

@tomchadwin

What do you need to know about me?

I am not a
geographer

I don't know how to pronounce "datum"

I am
not a

GIS Officer

I've never opened ArcGIS

I am
not a

developer

I've looked up "polymorphism" four times, and I still can't remember what it means

I do like the
web

Well, bits of it

I do like
maps

Career taken me here by chance - this job and the last

I do not
like
bad
software

I do not like bad software at all. I really don't like bad software.

I work
for a
National Park

The work I do is technical, but the beneficiary of my work (or "victim") is a cause in which I believe.

15 years ago, government told us to make webmaps

...and they paid us a lot of money to do so. When I joined Durham City Council: IEG, Pendleton points. Pendleton points make Pendleton prizes. What do Pendleton points make? The abolition of Durham City Council.

We had MapInfo...

Anybody here remember MapInfo?

...and lots
of PDFs

Seriously. Lots.

National
Parks
work together

...occasionally

They bought
MapXtreme...

Anybody here remember MapXtreme? Notice my use of the pronoun "they", not "we".

...at vast
expense

They bought it before I started work there, so it wasn't my fault

But the money
ran out...

Either the Tories thought we had finished Implementing eGovernment, or they didn't want to pay for it any more, because financial catastrophe. Bankers.

so we tried...

open
source

I could go on at very, very great length about open-source versus proprietary, but you've all chosen to come to an open source conference, so I'll leave preaching to the converted where it belongs. Twitter.

A brilliant monolithic web GIS, combining server application, viewer, and editing environment. Cross-platform, API bindings for multiple languages (.NET, Java, PHP). Wonderful. But, full-stack, so not everyone's cup of tea, so...



Built for NPs by contractors. Nearly wonderful, but missed the mark in crucial ways:
  • form-based
  • difficult to maintain (eg GeoServer and PostGIS data out of sync, command-line ogr2ogr)
  • we had no knowledge of technologies
  • told by developer not to upgrade the component parts
  • written for us, and while devs intention was to get others to use it, only ever really used by us, therefore:
    • no wider use
    • no support
    • no growth
    • no momentum
    • no community

Started to replace MapInfo - completely at NNPA - never looked back. Probably the best open-source software I've ever come across. No web export, but supports plugins, including:

qgis2leaf

Export your QGIS project to Leaflet. Written by Riccardo Klinger (Geolicious, digital-geography.com). I contributed a lot to get it to do what we needed (eg WFS layers, British National Grid). Problem was...

Riccardo and I were both beginners... (HT: xkcd.com)

qgis-ol3

Victor Olaya (author of QGIS Processing). With preview window, layer groups. Well coded.


qgis2web

Paolo Cavallini (QGIS PSC) proposed, Riccardo and Victor agreed, I took it on.

qgis2web makes webmaps by extracting information from QGIS and writing it out as HTML, CSS, and JS.

What did I have to learn?

QGIS API

Programmatic access to the functions of a program. I had experience of working with other APIs (MGOS, Livelink CMS), but QGIS has the best I've come across

Never used it, but I'd heard of it...

HT: xkcd.com

Had coded little bits of JS for years, and some bigger bits and pieces (EGMS parser, standards-compliant web-based rich-text editor). By the way, JS != jQuery.


OpenLayers 3

Much slicker than our old OL2

Simpler, leaner. All fo this I knew in advance I had to start learning. But there's more...

Initially baffled, as had never heard of it. When I heard "Nokia Qt", my first thoughts were:

That was a great phone

Although 100% not a tea drinker, I did code a full-screen Flash website for Typhoo about 16-17 years ago. It had sound files of my accomplished chicken impression.

Had to find out how working on open-source code works. I am no expert - not that difficult, and wonderfully flexible.

Had to learn how to read a stack trace, which had always rather mystified me (see GeoServer's Tolstoy-like ones which scroll off into the distance like the Star Wars opening credits). Speaking of stack traces...

Sometimes it doesn't work. Because of small user-base, and tiny developer-base, sometimes these errors crept into releases. Not good.

Travis to the rescue! Automated testing - continuous integration. The silver bullet for improving on the quality of software.

Automatically tests every Github commit and PR against QGIS LTR, current, and nightly. But the tests you write might miss certain combinations of options a user might select in the software, so...

t
Code coverage: The logical conclusion of CI

Must try harder: list of tests still needed is in the README
Nature-based flood risk management projects
Jubilee in Rome
Committee to elect Ben Carson for Republican presidential nominee
Montreal sewage dumping scandal
Rewilding in Croatia - brown bears

Why do
all this?

Hopefully it's useful to some people, but also...

It's fun!

Getting code to work is fun. Getting code to work with other software via an API is really satisfying. Joining multiple APIs is incredibly satisfying.

What are the rewards?

Speaking personally
The praise of the praiseworthy is above all rewards

It's used for something important: Projet Espace OpenStreetMap Francophone - Ivory Coast and Benin, with OpenStreetMappers from:

  • Togo
  • Burkina-Faso
  • Mali
  • Niger
  • Senegal

Thanks to
everyone

  • QGIS, Leaflet, OpenLayers
  • Riccardo Klinger, Victor Olaya, Luca Casagrande
  • Contributors: Matt Walker from Astun here today, Akbar Gumbira, Ed Boesenberg
  • QGIS dev list/Gitter: Matthias Kuhn, Nathan Woodrow, Nyall Dawson
  • National Parks, including my own, and Matt Travis here today from Dartmoor
  • Users/bugspotters
  • FOSS4GUK
  • You, not least for your patience

Thank you

Questions?