Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm just getting started in GIS and am interested in using it to create maps of mountain biking trails in my area and nearby. I've been learning QGIS and have made enough progress to generate a decent map. So far I've been storing my layers in Shapefiles, which seems to be working okay.

This past weekend I started looking at PostGIS and have it up and running and managed to import my trail shapefiles and connect QGIS to PostGIS.

I'm now wondering what the pros and cons of using a database versus files would be. I have some thoughts already, but am curious what enlightening opinions others may have.

Pros of Database

  • One table for all my trails, regardless of park, allows me to have a consistent set of columns for the information.
  • Easier to query/export my data to multiple formats
  • Multiple clients/tools allow for easier viewing and editing of data
  • Easier editing of table structure (compared to QGIS table editing)

Cons of Database

  • Standing up/maintaining a database adds complexity to my setup.
  • I have a desktop and a laptop I do my GIS work on and using DropBox allows me to easily sync files between the two machines. This likely won't be possible (or as transparent) using PostGIS as using DropBox with files.
  • Easier to backup/restore files than a database.
share|improve this question
1  
If map will be read only and stay under 2gb, stick with shape files. If you plan on having multiple simultaneous edits and it being a bigger than 2gb dataset, go with postgis. –  CaptDragon Jan 3 '12 at 16:48
add comment

5 Answers

up vote 11 down vote accepted

I suggest you to add Spatialite to your list. It has the benefits of being file based (as a shapefile, or an .mdb database) and supports most of the usual spatial operators and tpyes, that you can find in PostGIS too. Spatialite is based on Sqlite, so you will manage a single file, that you can easily move and share.

share|improve this answer
    
I will take a look since, from your description, it seems to offer the best of both worlds. –  Brian Kelly Jan 5 '12 at 4:29
add comment

I'd say the biggest Pro on a PostGIS database is, that you can work with the whole function set PostGIS gives you.

All the Cons in your list, are all very easy fixable. You can run Postgis on ONE server and use your laptop and desktop as a client. The backup question as well, you can generate dump files or what-so-ever to have a good and valueable backup! ;)

share|improve this answer
    
I like to use my laptop on train rides though, so I don't have any internet connectivity at that time. –  Brian Kelly Jan 3 '12 at 12:25
add comment

Another big plus for PostGIS is that with spatial databases you can keep one copy of the spatial data and create views that link to your non-spatial data via a unique id.

Then you can create subsets of your full data by creating views that select from it - so you can do single-state tables as views of a full country table. SOmething like:

create view txcounties as select * from counties where state = 'TX'

Also nobody seems to have mentioned the speed of spatial operations for PostGIS. Suppose you want to see what the nearest waterfall was to your bike trails, given a table of lines of trails and a table of points of interest including waterfalls. That's the kind of query that PostGIS can do really quickly since it keeps spatial indexes on the spatial tables. You can probably do it with the native tools in Qgis but it might be quite a bit slower.

Obviously for a fun little application like yours these things are probably not a good reason to get into the complexity of a spatial database, but it might explain why these 'enterprisey' features are essential for bigger projects.

share|improve this answer
    
I read the free chapter of "PostGIS in Action" which led me to the same conclusion as you - very powerful stuff but likely overkill (right now) for what I want to be doing with it. –  Brian Kelly Jan 5 '12 at 4:28
add comment

Another advantage of DB vs. flat files is versioning, crucial for multiuser data-entry GIS.

There's a beta plugin for PostGIS and GeoGit, cf. this question.

share|improve this answer
    
I'm working solo, so I updated the question to reflect that. Your point is valid though. –  Brian Kelly Jan 5 '12 at 15:06
add comment

There is a limitation in Shape file (max 2gb).. so if your map size is not going beyond this limit.. you can use the shape file without any db setup....

share|improve this answer
    
That's a good point (but please note that the 2 GB limit applies equally and separately to the features in the .shp file and to the attributes in the .dbf file). However, the question invites comparisons between the shapefile solution and the DB solution. How do the shapefile file size limitations compare to similar limitations, if any, in the database files? –  whuber Jan 3 '12 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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