3

I'm building a web system from scratch (based on openlayers). All layers in map will be my own (raster and vectors). I want to show polygons/points on map and when user click on them he gets info or list of links of files to download (and need to have the ability using some kind of back office to update new vector layers). I can set up wms server (geoserver or ms4w). I'm not sure If all layers should be shown as wms or the vectors (which are created in qgis) should be kml files (or something else) and how/where to save the vectors information , in db or on the shp file.

Any recommendation on best practice or guidance for such task will be welcome

2 Answers 2

2

Actually,I think this question covers what you need so well that is deserves an entire answer.

See Options for displaying PostGIS vectors in OpenLayers

It provides an easy interface for uploading shapefiles, managing them, getting the data to a usable network format for use in most APIs, and in particular, OpenLayers.

GeoServer's website

1

On client side I would use vector layers, because they are more versatile than raster layers.

One of the biggest issues of vector layers is that the client can collapse when the number of shown features is too big. Fortunately, OpenLayers has tools to cope with problems like this, like the cluster strategy.

On the server side, I would use shapefiles if I was the only person doing the backoffice work that you mentioned; in this scenario there would be no need to set up an spatial database like PostGIS, a non-trivial task (KISS principle). Another spatial database that you can find interesting is SpatialLite.

In case internationalization is a must, shapefiles might not be a suitable format. Should this be the case, you can try ArcGIS' file geodatabase (FGBD). It seems that Quantum GIS supports FGDB via GDAL.

EDITION: I complete my answer after some criticism in some of the comments.

While vector layers might consume more bandwidth than raster layers, this issue is addressable. First, in case the vector data is retrieved using WFS, there is no obligation to use GML; the client can get the data in the less verbose GeoJSON format. On the other hand, the vector data returned by the WFS server usually includes attributes, which are not needed to render the feature. Any decent WFS server can be configured to not send such attributes, thus getting savings in bandwidth usage.

Another mentioned issue was that vector layers produce maps that are slow to render. In regard to rendering, the difference between raster and vector layers is where this task is done: raster layers are rendered by the server and vector layers are rendered by the client. While old web browsers could not be very good at rendering vector layers, the current version of the main ones - Chrome, Firefox and Internet Explorer... - do it much better because the improvements introduced in their JavaScript engines. On the mobile arena, the computing power of these devices have dramatically improved during last years; in fact, is not unsual that smartphones have multicore processors.

About the issue of an too big number of features on client side, it can be said that WFS allows limiting the maximum number of returned features. In case features are made of a too big number of points, Douglas-Peucker simplification can be calculated.

And last, about the superior versatility of the vector layers I mentioned, in the section of OpenLayers examples there are some examples that users can find useful, like resizing, rotating or selecting features, to mention some.

5
  • 1
    You can use GeoJSON to send vectors to the client, it is lightweight, supports many feature types. I would definitely recommend it for large feature collections over KML. Additionally, PostGIS can create GeoJSON on the fly (though it isn't trivially either). Spatialite is would be good for small projects that wont need processing. But your will need to provide middleware to get it to a usable state for OpenLayers. See gis.stackexchange.com/questions/1190/…
    – RomaH
    Nov 24, 2012 at 2:54
  • 1
    I definitely wouldn't recommend using vector layers for the client side by default. They tend to be heavy, consume a lot of bandwidth, and make the map slow to use and render if present in sufficient quantity. Layers should be WMS layers by default, and only required layers should be vector layers. Nov 24, 2012 at 5:07
  • so to be clear , I use GeoJSON to read polygons from shape file directly ? I have no experience in Postgres but a lot with MS SQL , Can I use that ? When reading using GeoJSON , Which Layer type I use ? Vectors? And how I shope the file list inside when polygons are clicked ? Using popups?
    – Alophind
    Nov 24, 2012 at 5:15
  • Forgive me here perhaps I don't understand the WMS protocol as well as I thought. To my knowledge ther is only vector or raster data. But wouldn't vector layers be WAY less network overhead then any raster image, to a point of course. A raster you have to send each pixel across the network while vector you only have to send defining points. The filling of the space between is done client-side.
    – RomaH
    Nov 24, 2012 at 17:53
  • @Eran I think you can do GIS work on MSSQL but they seem late to the game on some stuff (surprise, sorry I have a bias on MS, ha) and last I looked you need very specific versions to even get GIS capabilities. GeoJSON is one of many vector layer formats, you just have to use the one that is best for you needs. Attaching popups is done with scripting on your web mapping API.
    – RomaH
    Nov 24, 2012 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.