Log in

No account? Create an account

OpenWebGIS is online Geographic Information System

Previous Entry Share Next Entry
OpenWebGIS: system structure and how to start similar projects? Part one.

Recently, I have been asked about the creation of OpenWebGIS, the essence of which can be summarized as follows: Describe how OpenWebGIS was created and how I can make myself the similar system to suit my challenges?
Several days ago I was asked four more specific questions, I hope their author will not mind if I get them here:

  1. Which programs were applied for the service work? Were they all listed in the section "About us"? Or was something else used?;

  2. Were the maps downloaded or simply taken from a third-party service?

  3. Is there a step by step instruction of how to create your own project or the like (what adjustments are needed to create a geoserver, sample code of the main page, as well as the most important thing – what is the purpose of putting together the elements listed in the "About"?)

  4. Can you advise some reading for a novice web cartographer?

In a planned series of articles I will try to answer these questions. Here is the first article, or rather the first prologue, which briefly provides answers to four questions mentioned above.

I must say that I am not a teacher and the system of OpenWebGIS is not an example of an ideal GIS. At the beginning it was done by guess-work and using trial and error method and perhaps only now this development process has come to a more systematic work. Therefore, any constructive criticism is really welcome. I will write only on the basis of my own experience and understanding, without insisting on the fact that it is the one and only right and proper way.
So the points are:

  1. In addition to the above items the PHP language and a web server Apache was also used, but there is a need in it only if your system turns to some third-party resources without CORS technology (the amount of resources with CORS is probably no more than 10% of the total number of existing on the Internet) and if for example you want to carry out the monitoring of user activity and for any other purposes. My other system similar to OpenWebGIS worked successfully for some period of time within a large network without Apache and PHP, and it even worked so for some time after the opening of an access via the Internet.

  2. Several maps first of all the basic ones (cities and rivers), those that are added by default as layers when openning the page of OpenWebGIS, I took from open sources in the form of shapefiles and put it in the appropriate folder on the server. I would like to clarify the terminology: I usually call the base substrate (underlay) a map, such as Google maps, and everything that is applied or added on top –is called a layer. Later, as needed, the administrator or other users upload layers as shape files or GML and CSV - there are special menu items in the interface of OpenWebGIS. The loading is carried out by the following technology: XMLHttpRequest (XMLHTTP, XHR) - API, ​​available in scripting languages of browsers, such as JavaScript. XMLHttpRequest uses HTTP or HTTPS requests directly to the Web server and loads the server data response directly in the calling script.

OpenLayers provides a wrapper (function) to work with this technology: OpenLayers.Request.PUT.
For example, for loading a shapefile:
var request = OpenLayers.Request.PUT ({
url: urlStr,
async: false,
data: fileZIP,
headers: {
  'Content-Type': 'application / zip',
'WWW-Authenticate': 'Basic realm = "Authentication System"'
  callback: alert ("it's OK")

File shape packed in zip was downloaded, now there is a need to create a geoserver layer (Layer):
var request = OpenLayers.Request.PUT ({
url: urlStr.split ('file.shp? configure = all') [0] + "featuretypes /" + fileZIP.name.split ('.') [0]
async: false,
data: '<featureType> <name>' + fileZIP.name.split ('.') [0] + '</ name> <srs> EPSG: 4326 </ srs> <enabled> true </ enabled> </ featureType> ',
headers: {
  "Content-Type": "application / xml"
success: function (e) {},
failure: function (e) {}
All this is mainly concerned with vector (WFS) layers, i.e. those for which the user can change the legend and change the data itself, for example to add new points, polygons, lines on a map and to store them on the server, or do not save them but just upload in GML, CSV, KML, JSON file.
The example map of OpenWebGIS with vector layers you can see here: http://opengis.dlinkddns.com/gis/opengis_eng.html?openwebgis=LhrYVHYTEgxHsaVGb8m3on87vWi1RNCZ5rKC. There the ancient Roman roads and ports in Italy and surrounding areas are shown. If the name of the target layer
is selected in the drop-down list - 'Editable layer', then when you put the cursor to the element of interest in the selected layer, it will change its color, and you can click the left button on it and get the information about that object.
The layers in WMS format can be taken from other servers, third-party resources (WFS, by the way, as well can be taken from other sites, but they are much smaller in number than the sources of WMS and for now that is all about it). For this purpose in OpenWebGIS there is a special module, its work can be seen in this video in English https://www.youtube.com/watch?v=UC2oH86RTog. In this case, you will probably need Apache and PHP. When working with WMS layers all information is usually taken from other sites, though in OpenWebGIS there is an option of saving a third-party WMS layer on the server of OpenWebGIS, but in this case the link is stored but not the information itself. For example here: http://opengis.dlinkddns.com/gis/opengis_eng.html?openwebgis=hwg03E6P9kdicuSVvMqW2FDmOK8FdpNAvMto, you can see a small meteorological service based on OpenWebGIS. There are many layers but none of them will be saved on the server of OpenWebGIS.

Another way to work with geographic data is loading on the map the files GML, CSV, KML, JSON, GPX from your computer via the menu item 'Layers> New layer from....'. In this case the information is uploaded to the server and so it does not come from other servers, and is just stored in the memory of your browser.
You work with it analyzing, making calculations, creating new attributes, elements, etc. and then using the 'Export layers to ...' you get on your computer a new file, which you can upload to the server, work in another program, send to friends, etc.

Thus a summary on the second question is: the layers (maps), depending on the task and the users` needs can be both on the server of OpenWebGIS and elsewhere.
                3. Now there isn’t the step by step description of OpenWebGIS creating, there are only pieces of the various stages of other projects discussed at various forums, which I used to suit my needs. The most useful for me in this respect are the following forums: http://stackoverflow.com/questions/tagged/geoserver, http://osgeo-org.1560.x6.nabble.com/OSGeo-Software-and-Data-Projects-f3741872.html, http://gis-lab.info/forum/index.php.
The geoserver, as the core of the entire system does not require special settings. The main aim is to create in it the workspace and store for the layers of the project, it will be the starting point for programming using javascript various actions (access to the layers, changing them, etc.). And if you want to differentiate access rights for different users, it is necessary to configure a geoserver security interface.
Now a few words about the project structure:

  • a.Geoserver is an open server written in Java for the network location of spatial data and its processing. It is the core of OpenWebGIS, I think that is clear, for more detail there will be future articles;

  • b.OpenLayers is an open source library, written in JavaScript, for creating maps on the base of program interface (API).

  • c.PostGIS is an extension of object-relational database management system of PostgreSQL, for geographic data storing in the database – it is used to store the layers in formats: GML, CSV, which are downloaded by users via the menu item Import GML, CSV file to the server database;

  • d.Proj4js is a library of methods for transforming between different geographic coordinate systems - a good thing when working with vector information, you can do nothing with WMS using this library;

The connections between OpenWebGIS components are shown in the scheme below:


             4 What else can you read? I advise you to look here: http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP000150.html

“Fundamentals of Geographical Information Systems, 4th Edition”

Michael N. DeMers.



And yet I have really found it helpful to look for the answers to some specific questions arising in the course of work, with the help of Yandex in the Russian segment of the Internet and Google in the English-speaking one. It helped me to such an extent that I rarely had to ask something on various programmer forums, many problems have already been discussed and there are solutions for the most questions in various ways.