Introduction to Web Mapping
Last updated: 2019-05-19 20:15:35
0.1 What is web mapping?
A web map is an interactive display of geographic information, in the form of a web page, that you can use to tell stories and answer questions.
In the past, most digital geographic information was confined to specialized software on desktop PCs and could not be easily shared. With the advent of web mapping, geographical information can be shared, visualized and edited in the browser. The most important advantage to this is accessibility: a web map, just like any website, can be reached by anyone from any device that has an internet browser and an internet connection.
Web maps are interactive. The term interactive implies that the viewer can interact with the map. This can mean selecting different map data layers or features to view, zooming into a particular part of the map that you are interested in, inspecting feature properties, editing existing content or submitting new content, and so on.
Web maps are also said to be powered by the web, rather than just digital maps on the web. This means that the map is usually not self-contained; in other words, it depends on the internet. At least some of the content displayed on a web maps is usually loaded from other locations on the web, such as a tile server (Section 126.96.36.199).
|Visualization and journalism||Global Migration|
|Real-time information||Earth Weather||Figure .|
|Real-Time Transport Location|
|Real-Time Flight Locations|
|Stuff in Space|
|Global Forest Watch|
|Catalog and search||Earth Data Search|
|Computational tools||Google Maps|
|geojson.io||see Section 7.4.1|
|mapshaper||see Section 7.4.2|
|Reporting and collaboration||OpenStreetMap|
The availability of code-free, graphical interfaces for making sophisticated web maps remains an ongoing goal for the web mapping community. Several platforms now provide straightforward interactive interfaces for building and publishing web maps and web mapping applications:
A more customizable, programmatic approach for building web maps is available through scripting languages such as R and Python. Both languages have libraries that give the ability to build web maps, using few lines of code and incorporating data from the user environment:
0.4 Learning objectives
By the end of this book, you will be able to:
- Build and publish basic websites and web maps
- Connect you web map to a database to display large amounts of data
- Include client-side geoprocessing functionality in your web map
- Gain an understanding on how the web works, and a starting point for learning more
Throughout the book will make use of the following software components, which are freely available on the web:
- A plain text editor, such as:
- A modern web browser1:
- Web developer tools (built into Chrome and Firefox)
- A local web server (built into Python, other options are available)
While emphasizing open-source solutions, we will also demonstrate the commercial services GitHub and CARTO, selected for their simplicity. Free and open-source alternatives giving the same functionality will be mentioned for those willing explore more complicated options.
0.6 Background knowledge
The book can be used as primary text for a “Web Mapping” course in Geography departments, or by anyone who is interested in the topic.
Familiarity with basic concepts of geographic data and GIS (coordinate systems, projections, spatial layer file formats, etc.) is necessary for deeper understanding of some of the topics in the book. Readers who are not familiar with GIS can skip the theoretic considerations and still be able to follow the material from the technical point of view.
0.7 Online version
The online version of this book is freely available, with agreement from the publisher, at the following addresses:
In addition to the content of the printed version, the online version includes downloadable code and data files for all 90+ complete examples (Appendices B–C), as well as an additional Appendix with instructions for setting up an SQL API (see Section 9.2.2).
I thank the creators and contributors of the open-source tools used in this book, namely jQuery, Leaflet, Turf.js, Leaflet.heat and Leaflet.draw (Table .). I am also grateful to Yihui Xie, who’s
bookdown (Xie 2018, 2016) R package (R Core Team 2018) greatly facilitated the technical process of writing the book.
Figure 6.1 was prepared using R packages
sf (Pebesma 2018) and
rworldmap (South 2011). Figure 7.1 and the images inside Tables 7.2–7.6 were also prepared using package
sf. Figure 8.4 was prepared using R package
RColorBrewer (Neuwirth 2014). Figures 8.3 and 9.3 were prepared using QGIS (QGIS Development Team 2018). The sample database shown on Figure 9.1 was prepared using data from R package
nycflights13 (Wickham 2018).
Several figures in the book include icons from external sources: “computer”, “web page” and “car” icons by Freepik, “folder” and “database” icons by Smashicons, “gears” icon by Good Ware, from https://www.flaticon.com/, licensed by CC 3.0 BY.
Xie, Yihui. 2018. Bookdown: Authoring Books and Technical Documents with R Markdown. https://github.com/rstudio/bookdown.
Xie, Yihui. 2016. Bookdown: Authoring Books and Technical Documents with R Markdown. Boca Raton, Florida: Chapman; Hall/CRC. https://github.com/rstudio/bookdown.
R Core Team. 2018. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Pebesma, Edzer. 2018. “Simple Features for R: Standardized Support for Spatial Vector Data.” The R Journal. https://journal.r-project.org/archive/2018/RJ-2018-009/index.html.
South, Andy. 2011. “rworldmap: A New R package for Mapping Global Data.” The R Journal 3 (1): 35–43. http://journal.r-project.org/archive/2011-1/RJournal_2011-1_South.pdf.
Neuwirth, Erich. 2014. RColorBrewer: ColorBrewer Palettes. https://CRAN.R-project.org/package=RColorBrewer.
QGIS Development Team. 2018. QGIS Geographic Information System. Open Source Geospatial Foundation. http://qgis.osgeo.org.
Wickham, Hadley. 2018. Nycflights13: Flights That Departed Nyc in 2013. https://CRAN.R-project.org/package=nycflights13.
There is no clear definition of the term modern web browser, but older versions of Internet Explorer are, arguably, not considered as modern browsers and thus not recommended to illustrate web development, see also: https://teamtreehouse.com/community/what-is-a-modern-browser↩