Practical GIS
Gabor Farkas
- 428 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Practical GIS
Gabor Farkas
About This Book
Learn the basics of Geographic Information Systems by solving real-world problems with powerful open source toolsAbout This Book⢠This easy-to-follow guide allows you to manage and analyze geographic data with ease using open source tools⢠Publish your geographical data online⢠Learn the basics of geoinformatics in a practical way by solving problemsWho This Book Is ForThe book is for IT professionals who have little or no knowledge of GIS. It's also useful for those who are new to the GIS field who don't want to spend a lot of money buying licenses of commercial tools and training.What You Will Learn⢠Collect GIS data for your needs⢠Store the data in a PostGIS database⢠Exploit the data using the power of the GIS queries⢠Analyze the data with basic and more advanced GIS tools⢠Publish your data and share it with others⢠Build a web map with your published dataIn DetailThe most commonly used GIS tools automate tasks that were historically done manuallyâcompiling new maps by overlaying one on top of the other or physically cutting maps into pieces representing specific study areas, changing their projection, and getting meaningful results from the various layers by applying mathematical functions and operations. This book is an easy-to-follow guide to use the most matured open source GIS tools for these tasks.We'll start by setting up the environment for the tools we use in the book. Then you will learn how to work with QGIS in order to generate useful spatial data. You will get to know the basics of queries, data management, and geoprocessing.After that, you will start to practice your knowledge on real-world examples. We will solve various types of geospatial analyses with various methods. We will start with basic GIS problems by imitating the work of an enthusiastic real estate agent, and continue with more advanced, but typical tasks by solving a decision problem.Finally, you will find out how to publish your data (and results) on the web. We will publish our data with QGIS Server and GeoServer, and create a basic web map with the API of the lightweight Leaflet web mapping library.Style and approachThe book guides you step by step through each of the core concepts of the GIS toolkit, building an overall picture of its capabilities. This guide approaches the topic systematically, allowing you to build upon what you learned in previous chapters. By the end of this book, you'll have an understanding of the aspects of building a GIS system and will be able to take that knowledge with you to whatever project calls for it.
Frequently asked questions
Information
Creating a Web Map
- The basic JavaScript syntax
- Using the Leaflet API
- Displaying styled maps as images
- Using raw vector data
Understanding the client side of the Web
- HTML: Hypertext Markup Language is the standardized form of transferring visual elements from web servers to web clients. They are XML-based documents that describe each visual element between tags. Although HTML is XML-based, a valid HTML document is not necessarily a valid XML document. For example, the HTML standard does not make self-closing single tags mandatory. If we write <br> in a HTML document, it is a valid HTML; however, we have to write <br/> to get a valid HTML and XML document.
- CSS: Cascading Style Sheets is the standardized way to describe the custom styling of HTML elements. Every web client has a default set of styling options that are applied to HTML elements with no custom styles. If the web client gets custom rules in the form of CSS declaration blocks, it overrides the default styling with them.
- JavaScript: We can also use custom scripts written in JavaScript in order to send executable code to the client. The client interprets and runs the code contained in the JavaScript file, enhancing the user experience by making the web page more dynamic. It is very useful to automate smaller tasks without wasting the server's resources. For example, interactive web maps are created with web mapping libraries. Web mapping libraries are essentially collections of JavaScript functions creating interactive maps based on some parameters we provide.
Creating a web page
- On most Linux distributions, the web server's root folder is located somewhere in /var/www. On Red-Hat-based distributions (for example, Fedora, CentOS), it is in /var/www/httpd.
- On macOS systems, it is either located in /Library/WebServer/Documents or /usr/htdocs.
- On Windows, it is located in C:\OSGeo4W\apache\htdocs, assuming Apache was installed with the OSGeo4W installer and the default path.
- Make sure you have write permission to Apache's root folder.
- Create a new file called map.html.
- Open the file with a text or a code editor. A good code editor with syntax highlighting can gradually help correct typing errors. More advanced editors (for example, Atom, Visual Studio Code) can even spot some syntax errors.
Writing HTML code
- <html>: The root element of every HTML document grouping the whole content.
- <head>: The group of important elements that are not visualized but alter the default behavior of the web page in some way.
- <body>: The group of visual elements rendered by the web client.
- <title>: The title of the page. It goes inside the <head> element.
- <meta>: The various kinds of metadata of the web page. Very useful to explicitly set the character encoding of the web page.
- <link>: A reference to an external resource, usually a stylesheet.
- <script>: Inline JavaScript code or a reference to an external resource containing valid JavaScript code.
- <h1>: A first-level header emphasized with a large font size.
- <p>: A paragraph of plain text.
- <div>: A division without much purpose on its own. When it contains other elements, it groups them together. This way, visually coherent parts of the website (e.g. ...