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.

Example usage: I have a spatialite layer which contain my fiber optic cable routes. In that layer there is a column named 'Cable types' with coded integer data: 1 for aerial cable, 2 for underground cable... Now I want to send the spatialite database to a colleague. Is there anyway to preserve the meaning (description) of cable types without having to send the QGIS style file for that layer?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

A couple of options:

  1. Create a non-spatial table called Cable Type in the spatailite database to store the interger and the value.
  2. Do 1. but create a view that joins the two tables together so your colleague gets the cable type name rather then the integer.
share|improve this answer
    
Thanks for your answer but my colleague is not a specialist in GIS or database user, so I want it to be simplest possible for him and others to retrieve that data. In this case, I think it would be best if I can embed into the layer metadata (my colleague just have to select metadata tag in the layer properties). Do you know any way that is as simple as the one I thought of? –  Cao Minh Tu Apr 8 '12 at 15:14

I don't think you need to bother with style files. If all of the project data is in a Spatialite database all you should need to do is send your colleague the database together with your QGIS project file (*.qgs). When your colleague opens the *.qgs file in QGIS the project should load, showing exactly the view that you saved, with the styles, labelling and so on, intact. For this to work, before you save the project you need to ensure that the *.sqlite file and the *.qgs file are in the same directory and that you save the project using relative addressing (I think this is the default nowadays).

Proof of concept (140 MB):

http//:confound.me.uk/maps/su.zip

Nick.

share|improve this answer
    
Hi Nick, I think I will employ 2 of your techniques: 1. 1st one in your previous answer - that to remind myself in case I forget after some time and the project file may be corrupted 2. your second answer - for a quick and easy solution for my colleague. Thank you for your answers - that helps alot. –  Cao Minh Tu Apr 16 '12 at 10:30
    
1st point is from the answer of Nathan W, 2nd point is from your (nhopton) answer. Sorry for my mistake! –  Cao Minh Tu Apr 17 '12 at 3:45

Why not just add an extra column, call UPDATE on the table for each integer value to set that column's value to some text matching the table, and then ship the result.

share|improve this answer

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.