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 have some Ordnance Survey Address Base data files which have a .gml extension. I have imported them to GGIS as vector layers along with some mapping data but would like to explore them with PostgreSQL. I see that QGIS comes with SpatiaLite installed. Can I import the gml files into SpatiaLite or for that matter PostgreSQL?

I suspect the format and content of my question says more about what I don't know so any comments or even answers would be appreciated.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Yes. If you right click the layer in QGIS and select Save As the Save As dialog will give you a ton of formats you can save the file to, one of those is Spatialite. You can also use ogr2ogr to convert the file to pretty much any format you want.

http://www.gdal.org/ogr/

share|improve this answer
    
Thank you for that. Having just installed PostgreSQL as well can you tell me which of those formats best suits that please? –  Nigel Law Jan 12 '13 at 21:48
    
Personally I like shapefile, then I can use the shp2pgsql-gui tool to upload the data in to a PostGIS database. One caveat, if you have long field names they will be truncated when you convert to shapefile due to DBF's limitations. You can change their names back on Postgres with ALTER statements. –  HeyOverThere Jan 12 '13 at 21:57
1  
The main advantage of spatialite is that you can take the data easily from one computer to another, at least for backup reasons. A Postgis database is faster, so I use that for large datasets like Openstreetmap and for rendering with mapnik. –  Andre Joost Jan 14 '13 at 6:16
add comment

With the Qspatialite plugin you can import any loaded qgis-layer in spatalite, that way you can load multiple layers in your DB.

share|improve this answer
    
Many thanks for that. –  Nigel Law Jan 13 '13 at 16:06
    
For me this is the better option the using the Save As.. route as it will allow you to import more then one layer. –  Nathan W Jan 14 '13 at 5:54
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.