Monday, 18 July 2016

Resetting database coordinate reference system in QGIS Midvatten plugin?


When I started building a database in Midvatten I followed the tutorial:


https://github.com/jkall/qgis-midvatten-plugin/wiki/Tutorial


This tutorial suggests for setting up a new database:


"When prompted, select CRS 4326 (WGS84)"


As I was new to GIS I had not realised that this instruction was specific only to the demonstration data set that can be download to use with the tutorial and there might be reasons why I might choose another CRS.


I am now more up to speed with the question of Geographical versus Projected CRSs, (largely due to http://lyzidiamond.com/posts/4326-vs-3857) and now realise that I should have chosen EPSG 3857 rather than EPSG 4326.



The main reason is the warning in the Midvatten wiki for section plots:


"Please note! This feature assumes that projected coordinate reference systems are used (it will not work with tutorial data where CRS=EPSG 4326). It is also highly recommended to use the same Coordinate Reference System (CRS) for both the project and all involved layers."


I also now wish to use layers from the Openlayers plugin with my data set which also uses EPSG 3857.


I don't mind deleting and reloading the point observations data and stratigraphy data but as I have substantially changed the data domains it would take a significant amount of time to rebuild these.


Do I have to rebuild my database from scratch or is there a way of changing the CRS after the database has been created?



Answer



The easiest method is probably to export to a new spatial database:


https://github.com/jkall/qgis-midvatten-plugin/wiki/3.-Export-data#export-data-from-your-database-into-a-new-spatialite-database


However, you might need to remove the line for this export (It's needed when creating a new database though):


self.insert_datadomains(set_locale)


from midvatten/tools/create_db.py. Else it might block your altered zz-tables. This is a bug which I realized just now.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...