11

I usually build static topographic maps, which are mostly printed. I'm often using OSM and rasterfiles (mainly different DEMs). The areas I'm mapping seldom exceeds 20.000 km². I'm using exclusively open source software like QGIS, SAGA and GRASS.

I know the problems with shapefiles, but they are easy to handle. And Im not very familiar with postgis or SpatiaLite. I tried postgis, but got a lot of problems handling it, SpatiaLite seem to me more easy.

What do you think: Should I stay with shapefiles or switch over to databases like SpatiaLite or postgis. Whats the advantages and disadvantages in my case?

6
  • is it for local (mainly to use in GIS software) or for serving over internet in hosted map? Commented Jan 22, 2014 at 20:25
  • What type of issues did you run into with PostGIS? Commented Jan 22, 2014 at 20:26
  • It is mainly for local run. I loaded OSM to postgis and used it in QGIS. Thats all I did with postgis till now.
    – MartinMap
    Commented Jan 22, 2014 at 20:34
  • 3
    Databases are more efficient in terms of stability and performance, also you can run complex SQL queries on them. Personally I use shapefiles only as exchange format. In your case I would try to use spatialite cos it doesn't require database server installation
    – megadrofan
    Commented Jan 22, 2014 at 20:41
  • 1
    Sooner or later you hit use case where you need to get layer which only contains some spatial relationship or column value. PostGis is only one which scales from one user to pretty much anything. I think Postgis as tool not just db. Commented Jan 23, 2014 at 9:17

3 Answers 3

16

If the only reason you're contemplating adopting a new system is "'cause there's a shiny new system", don't do it. Until and unless you actually run into problems with the limitations of shapefiles, or want to take advantage of some specific features of postgis/spatialite/whatever, there's no need to change. Keep designing and producing maps.

Sooner or later the problems with shapefiles will come to a head, and that is the time to address them. The new shiny system will be even newer and shinier then.

It still a good idea to keep an eye on what's happening "over there", and take it for a spin from time to time, but don't invest in changing your whole production workflow until there are specific concrete advantages for doing so. Otherwise it's all too easy to spend months (years!) tinkering with the car in the garage and not actually going for a drive anywhere.

15

Spatialite could be interesting because it is fast for local use. You can load it directly into the RAM of your machine and it is only one file, so it is really portable and shareable. You can create R-tree indexes on geometry.

Just like PostGIS, Spatialite follows OGC standards and much of its functions are similar to PostGIS's and usable in SQL. It is also "[...]an alternative format to ESRI Shapefiles, which have several legacy issues (such as storage types and lengths of column names, etc.) " (PostGIS wiki).

The rasterlite plugin is also very performant to manage raster data using pyramids and image compression. (rasterlite official user manual)

PostGIS is also a good option, everything you need is there. It would be a better option if your data would be edited by many users simultanously or if you want to host large dataset such OSM. By the way, osm2pgsql is a reliable tool to import OSM data into PostGIS.

Advantages (among others) to use DB is that you can use SQL for queries and create spatial indexes. Futhermore, it is relatively easy to migrate layers between Spatialite, PostGIS and Shapefile format so you can easily use a mix of the three.

UPDATE 2019: I would prefer using GeoPackage over Spatialite for a standalone GIS SQLite database

1
  • 1
    Agree with the 2019 update just added. GeoPackage (gpkg) is now well-supported natively in QGIS, and brings the database benefits outlined in these answers years ago without the overhead.
    – Houska
    Commented Dec 11, 2019 at 13:25
5

The main advantage of Spatialite is that it comes as just one file, which you can easily share and backup. Postgis needs much more effort to port the data from one computer to another.

Shapefiles have their limitations on column names, but can easily handle non-EPSG projections. Editing of larger amounts of data gets painful with simple shapefiles, so thats why I switch to spatialite as soon as possible.

I use Postgis for OSM data because it can take huge loads of data without killing QGIS as frontend, and it responds quickly. The polygon handling of osm2pgsql is far better than all osm-to-spatialite importers I have seen so far.

So, effectivley I use all three of them.

2
  • I'm intrigued with the note about shapefiles easily handling custom projections; this could be especially important. Does this mean postgis and sqlite do not handle non-EPSG coordinate systems? Commented Mar 10, 2014 at 21:08
  • They do, but you have to add a custom CRS with an additional self-created SRID in advance. I'm not sure if that works easily when you exchange data with others.
    – AndreJ
    Commented Mar 11, 2014 at 5:20

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.