
Free Geographic Information Solutions QGIS and NextGIS

One has only to start working with geographic information systems (GIS), as they come to understand their indispensability in the work of any leader or employee of an organization dealing with geographically distributed data.
A year ago, before me there was a task to map several hundreds of objects scattered around the municipal district on the map for joint work. Therefore, I initially looked for a web service that allows me to display my data on a map on the Internet, but later changed my approach - it turned out that the useful features of visualizing data on a map increase by an order of magnitude if you use web services in conjunction with desktop solutions.
Then I took our time to deepen the subject and study the market, analyzed various paid and free GIS, and found out that familiar surveyors and specialists working in the field of urban development prefer GIS "InGEO" (the same AutoCAD, only tailored for creating information urban development support systems). Another part of GIS users install MapInfo on their computers.
But it turned out that less sophisticated comrades were happy with the free (Open Source) QGIS solution, which they said covered the needs of a wide range of specialists, from economic security managers and directors of construction companies to surveyors. Moreover, it closes no worse in relation to the above-mentioned commercial GIS than LibreOffice the needs of Microsoft Word users - the question is exclusively a habit.
So QGIS was my personal discovery of the year. And if at first I reacted with suspicion to my friend’s assertion that QGIS was quickly replacing expensive professional GIS, now I believe that such a statement has the right to life.
The screenshot below shows an example of the data processed by us in QGIS and posted on the free cloud-based web service NextGIS.com for collaboration. NextGIS.com we will meet below.

Over time, information in the GIS accumulates, it becomes possible with the click of a button to display combinations of map layers with a seemingly unrelated topic and make discoveries that were not previously obvious.
Pleasant surprises from studying QGIS and NextGIS continue to this day. It's time to share the experience.
Geographic Information System QGIS
→ Link to the
QGIS project is a free, open-source desktop geographic information system. With its help, you can create, edit, visualize, analyze and publish geospatial information in Windows, Mac, Linux, BSD (and soon on Android). The system is well documented in Russian, plus it has an extensive Russian-speaking community of users and developers.
The functionality of QGIS is determined by the large number of installable extensions downloaded through the "Manage Modules" menu. You can find modules for a wide variety of tasks, from geocoding to simplifying geometry, integration with cartographic web services and 3D-modeling of the landscape.
The purpose of this article is to give a general idea of the capabilities of QGIS. One way or another to put into practice - I suggest google and immediately try along the course of the article. The application interface is friendly and understandable for a beginner, especially if you have an idea of the general principles of GIS work, which this article is devoted to in many ways.
Project File and QGIS Layer Files
The main objects that a user works with in a GIS are layers. A regular layer is a table, each line of which corresponds to one object on the map. In contrast to Microsoft Excel-style tables familiar to everyone, in addition to attribute data, such as, for example, the name of the property, tenant, address, area, etc., the QGIS table has a column, hidden by default, with the so-called "geometry" object - spatial data that allows you to display on the map the object described in the corresponding row of this table.

Depending on the type of layer, the objects that can be spread out on the map are raster objects (images, for example, pieces of satellite images) or vector data that are described by the coordinates of the vertices. There are three main types of vector objects:
- points;
- lines, including broken lines;
- polygons (closed lines of areal objects).
It is important for the QGIS user to understand exactly where the tables are stored whose rows contain spatial data. In the application, we form a project in which we create new ones, or in which we drag previously created or publicly accessible tables. This can be table files in various formats, database tables created by QGIS or other applications, public and private web services.
In the simplest version, the user creates his layers in table files with the extension ".shp" (from the English. Shape - shape, appearance) - the native QGIS format. One layer (table) is contained in one .shp file. If you need to transfer cartographic information to someone for further work, then you can send one “.shp” file, although in many cases it is more advisable to pack it into an archive and transfer the entire project folder.
As already mentioned, a separate field in the layer table is allocated for geometry storage. If it is not in the source (file, database, external application), then QGIS will help to create it. This means that, for example, you can attach a file with counterparty addresses in CSV format uploaded from Microsoft Excel to the project, create geometry fields in it or convert it into a full “.shp” layer to display these addresses on the map.

QGIS allows you to attach layer table files to a project in a variety of formats, for example, MapInfo, ArcGIS, or even CSV, but as a rule, after I attach them, I immediately convert them to QGIS (.shp) format, as this creates additional features, especially regarding styling . Sometimes attached layer files have incorrect text encoding. In this case, the correct one can be selected in the layer properties.
Since the files are not imported, but are attached to the project, the changes that are made to the table rows will be saved to these same files. That is, they will become visible in all applications using this table, and vice versa.
What is a little confusing to a beginner? The layers loaded into the project are by default protected from writing and cannot be edited; you cannot apply new objects to them, move them, change attributes, or add fields to the table. For all this, select the desired layer and click the edit button. After that, the corresponding other buttons and options will become available.
Do not forget that your edits apply to the selected layer, and if you switch to another, the previous one will remain in edit mode, but you won’t be able to map the new object until you select the edited layer again. It is unnecessary to remind you that you must periodically save changes to the edited layer (or the entire project) so as not to lose them.

Styles
Tables with data and the rules for displaying them on the map (styles) are stored and processed by QGIS separately. What tables we understood, now we need to understand what styles are.
A style is set for each table. The simplest thing that describes the style is the colors, markers and images used to display table objects on the map, the formatting and location of the labels and the table fields from which these labels are formed, the scale at which the layer or labels are displayed. In particular, using the style, you can easily make the design of a layer on a map dependent on any fields of this or related tables. For example, display debtors and creditors on the card with different symbols.

In addition, you can configure the actions that are performed, for example, when you click on the marker of an object on the map. If you want to click on the map to go to the object’s page in a closed corporate network or run a certain application to process the object - no problem.
Using layers from public sources
There are special web services WMS and WFS which are designed to transmit cartographic information. The user uses a special HTTP link through which the user's client (QGIS) requests data. The server sends data and they are displayed on the user's monitor. In some cases, this data can be edited and returned to the server.
The fundamental difference between the WMS and WFS protocols is as follows:
- WMS - transmits cartographic information in the form of ready-made images (rasters) attached to coordinates.
- WFS - allows you to request and if you have permission to edit vector spatial data on the map, such as roads, coastlines, land, etc.
There are many useful public services for providing map information in the form of layers (usually WMS), accessible via a web link and asking for our QGIS projects. Many of these services are available from the QGIS Quick Map Services module.
After installing the module, open the “Download Services” tab in its settings and click the “Get Data Sources” button. You will have access to the public cadastral map, photo plans from Google and Yandex, licensed clean and, in my opinion, the most detailed of the available OpenStreetMap maps (aka OSM), as well as dozens of useful layers that can be placed in your project.

In addition, some services provide useful information for automatic analysis. For example, from OSM you can get all regional and federal roads on a map with numbers, types of roads, coverage, etc.
Geocoding
Geocoding is a wonderful invention. If you have at hand a table in Excel with the addresses of 10,000 objects (for example, a list of contractors), why not analyze them on the map too.
To do this, in QGIS we convert the table from the CSV file to the .shp layer (“RuGeocoder” module). In this case, the layer table will receive a hidden column with geometry (coordinates of points), but for now it will be empty.
Now, using the same module, we use the geocoding procedure, specify the layer table and its field with addresses, select the service provider. My choice is Yandex, because it manages addresses in Russian better than anyone.
So, we start the geocoding procedure, wait an average of a second for each of the processed objects and get all of them scattered on the map.

Coordinate systems
It is useful to understand that there are various coordinate systems. There are hundreds of them.
At school, we studied only geographical (WGS-84), representing a point on the map in the form of degrees, minutes, seconds of latitude and longitude. However, in geographic information systems, geographical coordinates are stored in degrees and their decimal fractions, and minutes and seconds are not used (for example, a description of a point with coordinates 45 ° 34′55 ″ north latitude and 15 ° 30′0 ″ west longitude will look like this: 45.581944 ° , -15.5 °).
It is not uncommon for you to get layers from external sources whose geometry fields use one of the rectangular coordinate systems. Rectangular systems are actively used by surveyors and designers - these are the so-called local coordinate systems (MSC). Rectangular coordinate systems assume that the earth is flat and all measurements along the abscissa and ordinates are carried out from a specific zero point in kilometers from it.
Why are there so many of them? The fact is that the assumption of a flat planet does not allow the use of one local coordinate system throughout the Earth, since after a few hundred kilometers the error becomes noticeable. But they are indispensable in the case when high accuracy is required in an area limited to several degrees of latitude and longitude. So in the Moscow region, surveyors use the MSK-50 systems of zone 1 or 2.
QGIS allows you to select a coordinate system for each layer. That is, in one project there can be layers with different coordinate systems, and they can easily be converted from one system to another - just save the layer in a shp file or database, choosing a new system as a parameter. In addition, in QGIS, you can configure the coordinate system into which all project layers will be translated when they are displayed on the screen, as well as the systems that will be installed by default for new projects and layers in the current project.
Information about the coordinate system is stored along with the table in the QGIS shp file, and by transferring the layer file to someone along with it, you transfer the corresponding settings. In other sources of layers included in the project, information about the coordinate system may not be available. Therefore, if you received a layer from someone with information that for some reason is not displayed on the map, do the following - open the table of objects of this layer, select any line and press the button for switching to the object. If the screen displays Africa or the oceans, then the QGIS coordinate system is not recognized correctly. Check with those from whom the source (file) is received, in which coordinate system the data is stored, and set it for the layer in QGIS.

If the necessary coordinate system is not in QGIS, then you can enter it yourself (Custom coordinate system). To do this, you need to know the settings line. Google to help you - try using a query with the name of the system you are looking for plus, for example, “QGIS user coordinate system”.
Why else might this be needed? Users of the public cadastral map are well aware of the problem of shifting cadastral layers relative to the satellite substrate. It is confusing, it makes it difficult to visually assess the boundaries of land. We see a similar picture when adding a layer of the public cadastral map in QGIS along with Yandex or Google images.
To correct the situation, I created in QGIS my own custom coordinate system with the following parameters, selected empirically, and set it for the cadastral map layers:
+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=-11.0 +y_0=-6 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs
As a result, the problem is removed.
A little aerobatics
The first one. An interesting option is the storage of spatial information in a database. If there is a Microsoft SQL, Oracle or Postgres database in which, for example, there is a table with a list of contractors with their addresses or a table with a list of equipment scattered across the territory, then this table (query) is useful to hook into QGIS.
You just need to add a geometry field, and QGIS will help with this. Do not forget to set the rights to edit the table in the database to the user accessing it from QGIS. The information entered into QGIS will be stored in the database, and when modified by third-party management applications, it will immediately be displayed in QGIS.
The second one.If you don’t want to give direct access to changes in the database or another data source (for example, a CSV file), but you want to quickly receive information on the map, then there is an effective way for this.
For example, we have information about the tenants of our property in the 1C database, we want to show the tenants on the map, highlight the different colors of the debtors on the rent, and display their debt amount or some schedule with a tendency to pay off.
It is necessary, exactly as we do with ordinary layers, to attach database tables with information of interest to us (for example, about the dynamics of debt, debtor, real estate, etc.) in the QGIS project with read rights. Since the attached tables initially do not have geometry, and we do not give QGIS the ability to create and modify it, then, of course, it is necessary to somehow provide the GIS with missing information about the location of the property.
To do this, create a .shp layer, place objects on it, entering in one of the attributes unique numbers corresponding to the identifiers of these objects in 1C. That is, in both tables there should be fields with the same identifying data by which they can be related. Configure the appropriate links in the properties of the .shp layer. As a result, we do not change the 1C data from QGIS, but their change from the 1C side immediately affects the display of objects and related information on the map in QGIS. It remains to configure the properties of the map layer for a beautiful display of information and enjoy the result in real time.

The third. You can display data on a map in QGIS not only with points, lines and polygons with inscriptions, but also with diagrams that are generated automatically based on the presented data.
Fourth.You can get analytics from QGIS in the form of tables and summary data calculated taking into account geospatial information. For example, having a table of settlements with the number of inhabitants in each and a table of roads from OSM, quickly calculate the population living more than 3 kilometers from regional and federal roads.
NextGIS.com
Another discovery of the year for me was the NextGIS.com cloud product. The young Russian NextGIS team is actively involved in the development of QGIS. This can be verified by the number of modules available for production in QGIS. In 2016, they launched the mentioned cartographic web service and are constantly expanding its capabilities.
→ Link to the project Project
sources are available on github . So if you want to deploy a web service yourself - no problem. However, the conditions that NextGIS team offers to access their cloud undoubtedly deserve the attention of even the most demanding users.
Create your own web GIS in the NextGIS cloud for free. You will receive a domain name in the format yourname.nextgis.comand you can use all the goodies they provide with almost no limits. The very thing is to begin to get acquainted with the solution and use it in practice. The main limitation of a free subscription is the inability to restrict read access to information. Anyone can see what is posted by you.

Already with a free subscription, you can create any number of web maps with arbitrary settings, layout and styles of the layers you loaded, as well as view, analyze maps on a working computer and, complete with NextGIS Mobile, collect data in the field, placing them immediately in the cloud . You can embed maps in websites or watch on the service.
Paid subscription reduces restrictions, including the number of users editing layers (initially one user), the differentiation of their rights. You can show some layers to everyone, and restrict access rights to others. Plus, you can use your own domain name, for example, gis.moycompany.ru and get a variety of pre-configured substrates (there is only an OpenStreetMap card in a free subscription).
According to the company representative, the conditions of subscription are changing. You need to focus on the information posted on the service website at nextgis.ru/pricing. Previously, the paid tariff was uniform and amounted to 3,000 rubles per month. Now a paid subscription costs from 600 rubles. They promise that for the same 3000 rubles. per month, the client will receive a full and current set of software and services, as before.
QGIS and NextGIS.com Integration
I will dwell on a few not obvious principles of QGIS and NextGIS.com integration. When working in QGIS, you create layers and their styles in your projects, as already discussed above. Now, in order to place the created layer on the web map, we have several ways. First, consider a long way to understand NextGIS Web ideology. To place a layer you need:
- go into QGIS in the layer properties and from them save the style in a file;
- save the layer file in the coordinate system WGS 84 (EPSG: 3857).
Then, having two files (layer styles with .qml extension and layer tables with .shp extension), you need:
- Log in to your account on your website in the NextGIS.com cloud,
- create a new layer through the option "Create resource - Vector layer" and in the "Vector layer" tab, upload a file with the extension .shp.

After saving the resource in its settings, it will be possible to load layer style files. For each data layer, you can save several different style files that will display the data on the web map in different ways.
Finally, it is time to place the layer on the map. To do this, open the home page of your site. Among the listed objects of the main resource group, there will be at least one existing web map. Go into its settings and select the “Layers” tab. Click “Add layer” and look for your layer in the table that opens and below it the style in which you want its data to be displayed on the Web map. Click "Save" and "Web Map - Open." The layer in front of you on the map - turn it on to display.

Really a long way, isn't it? But there is a route that solves all this and much more directly from QGIS in a few keystrokes, and which I use.
NextGIS Connect Module for QGIS
Install the NextGIS Connect module through the QGIS "Manage Modules" menu. The NextGIS Resources widget appears in the interface. In its settings, create a connection by entering your account information, including the address of your website (in the format “http: //mysite.nextgis.com”), the user name “administrator” and the password received during registration. Instead of entering a username and password, you can use a guest account, but with it you cannot upload data from QGIS to a website - you can only receive information from the website. After registration, all your resources on the cloud service will be displayed on the screen.

Now, there are two ways to place QGIS layers on a web map.
The first is to download the entire QGIS project with one button. It will be raised in the cloud as a separate folder with all layers and a new web map. Directly from the window, you can go to it and see how your data looks in the browser, share the link with friends, colleagues, embed the map on any site.
But when downloading updated data in this way, we are faced with an unpleasant fact - a new downloaded project will use the new URLs of its resources, including web maps, which we managed to share with friends and colleagues.
Therefore, there is a second way more elegant, designed to work with already created web cards. To do this, we raise from QGIS to NextGIS.com cloud one new or changed layer:
- delete the layers in the NextGIS Connect window that we want to raise updated;
- select the final resource folder in the NextGIS Connect window;
- select the layer in QGIS with the right mouse button and select “NextGIS Connect - Import Selected Layer” in the context menu. The selected layer is copied to the cloud along with its style;
- repeat the steps for all layers that we want to update on the web map;
- select in the NextGIS Connect window the map on which we are going to place the layer and go to it by right-clicking on the menu "Open in WebGIS";
- in the window that opens, the web map resource on the site, click the "Change" button, select the "Layers" tab and click the "Add layer" button. Find the loaded layers and add styles to the map, placed under each of them. Click "Save."
Please note that if you have not logged into the site with your account, then although you have passed the specified route, saving data will cause an error.
Done, on the link “Web map - Open” you will see a map with the same URL and a combination of old and updated layers.
Raster layers
The usefulness of custom raster layers as map substrates when working in QGIS is not immediately obvious, since there is a Quick Map Services extension module that adds layers of public web maps, for example Yandex-Satellite or cadastral map, to a project in a couple of clicks.
But over time, the need for them appears in the following cases if:
- the map needs a more detailed than publicly available photographic plan of an individual object or territory that you have available
- you work on the road, with unstable Internet access, or if you are annoyed by the long loading of public pictures every time you move the screen;
- you use the free version of NextGIS.com, and the only OpenStreetMap underlay on your web maps does not suit you.
In the second and third cases, the open desktop SAS.Planet application will help you. Download it to your computer from the site . Outline the territory that you want to rob into the raster layer, select "Operations with the selected area" in the menu, open the "Glue" tab and set the selected settings (for example, as in the figure). Using the “Start” button on your computer, geo-referenced raster images will be generated that can be downloaded as a raster layer in QGIS or as a resource in NextGIS.com.

What you need to pay attention to:
- The preferred file format for storing raster data is GeoTIFF with JPEG compression. It takes up little space, the only one is uploaded to NextGIS.com and may contain tiles - small multi-scale images that open quickly and efficiently on a web map when moving the screen. All tiles are stored by default in one file, but this monster does not need to be downloaded to your computer each time, strictly necessary pieces-tiles will be selected from it. However, if the file is still too large for you or for uploading to a web map service, then it can be divided into parts as shown (2x2 pieces, 4 files) in the above settings.
- In a QGIS project, a raster layer can be placed by simply dragging and dropping. And if you need to stitch together several parts, then you can use the so-called “virtual layer” or just collect all the raster layers into a group.
- The maximum scale for Yandex-Satellite is 18. 17 is sufficient for many tasks, and the file with tiles is reduced significantly.
- When gluing in SAS.Planet, only tiles of the specified scale are placed in the GeoTIFF file, and after attaching the raster layer to the QGIS project, it is recommended to select the Pyramids option in the layer properties. High-resolution rasters can slow down navigation in QGIS. Creating copies of low-resolution data (pyramids) can significantly increase the speed, since QGIS will automatically select the optimal resolution depending on the current scale. Create smaller pyramids.
NextGIS Mobile
If you have to work in the field, there is a desire to quickly receive information on the way from the card, while collecting data and quickly sharing with others, then it is useful to use the free NextGIS Mobile application for a smartphone or tablet. With it, you can receive and process geographically distributed information from various sources, including from NextGIS.com layers and third-party databases, load from QGIS, modify, draw objects and create new layers, return them to QGIS. And everything is tied to your own location. A nice opportunity to save your own motion tracks in layers.
For the mass collection of information, it is quite simple to create your own forms, convenient for use by untrained employees from the application on your phone or tablet.

Instead of a conclusion
There are many more ways to work with the solutions mentioned above. For example, layers can be hosted on some free or proprietary PostgreSQL database server, work with them in QGIS and other applications, for example LibreOffice, Microsoft Access or Microsoft Excel, and on NextGIS.com once you configure the layer to display on the web map. As a result, all data changes in QGIS or in Microsoft Excel will immediately be displayed on the web map.
You can attach documents and photos to the layer’s objects in the cloud. Their viewing is convenient and visual. True, if you have to periodically replace this layer with a new one from QGIS, then with the deleted version all the beauty you filled with will disappear. An alternative is to work in the cloud not by replacing layers from QGIS (through the NextGIS Connect module or manually), but indirectly, for example, again, through a once configured layer that receives information from the Postgres database.
In any case, the combination of QGIS, NextGIS.com and NextGIS Mobile is a flexible and useful tool available to everyone. The transition to work with GIS to solve applied problems with geographically distributed data is a fascinating task and efforts to study the subject are paid off by the opportunities that we thereby discover.
In conclusion, to illustrate the materials of the article, I propose this short video.