Search This Blog

Sunday, 24 July 2016

Import/Export of map layers from CSV file with WKT geometry in OpenWebGIS and QGIS


Almost in every Geographic information system (GIS) there is an opportunity to create maps (vector map layers) from files in CSV format. So CSV (Comma-separated values) file stores tabular data, that looks like numbers and text, in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. In addition, the term "CSV" also denotes some closely related delimiter-separated formats that use different field delimiters. It is easy to add the data from such a file on a map, when it contains the information only about points and their attributes. In this case one field contains the longitude of the point, and in another field there is the latitude of the point.
For example the file with the information about the major world cities looks like this:

longitude,latitude,NAME,COUNTRY,POPULATION,CAPITAL
33.08604049999976,68.96354674999974,Murmansk,Russia,468000,N
40.646160130000375,64.52066803000004,Arkhangelsk,Russia,416000,N
30.453327180000375,59.95188904000009,Saint Petersburg,Russia,5825000,N
150.78001403999605,59.57099915000014,Magadan,Russia,152000,N
120.23000336000206,23.170000080000083,Tai-nan,Taiwan,656927,N
60.610130310000386,56.84654235999987,Yekaterinburg,Russia,1620000,N
43.9406700100003,56.28967667000006,Nizhniy Novgorod,Russia,2025000,N
-4.269947530000034,55.86280822999996,Glasgow,UK,1800000,N
120.23000336000206,23.170000080000083,Tai-nan,Taiwan,656927,N
61.39261246000016,55.14500045999982,Chelyabinsk,Russia,1325000,N
73.25028992000036,55.063304900000205,Omsk,Russia,1175000,N
82.94284821000016,55.03210067999992,Novosibirsk,Russia,1600000,N
56.09612655999974,54.82173537999994,Ufa,Russia,1100000,N
25.275966640000274,54.688568120000184,Vilnius,Lithuania,582000,Y
….
So according to the rules of every particular GIS, it is necessary to specify which fields are the fields with coordinates, then press "OK" button and here we get the map. We will tell how to do it with the help of QGIS and OpenWebGIS - Free and Open Source Geographic Information Systems.
In OpenWebGIS it is done as shown in Figure 1 and 2. To do it - you can select menu item "Layer->New point Layer from csv file". First it is necessary to select CSV file with the help of "Browse" button, then fields with longitude and latitude.
Figure 1 - Adding CSV file on the OpenWebGIS map

Sunday, 3 July 2016

One of the methods to create and use offline base maps for web based GIS, JavaScript example



In order to create a base map for web based and browser Geographic information system (GIS), which can be used in offline mode (i.e., when there is no Internet connectivity), the following methods may be used: