- QGIS:Becoming a GIS Power User
- Anita Graser Ben Mearns Alex Mandel Víctor Olaya Ferrero Alexander Bruy
- 338字
- 2021-07-09 19:32:36
Adding data to spatial databases
In Chapter 2, Viewing Spatial Data, we saw how to view data from spatial databases. Of course, we also want to be able to add data to our databases. This is where the DB Manager plugin comes in handy. DB Manager is installed by default, and you can find it in the Database menu (if DB Manager is not visible in the Database menu, you might need to activate it in Plugin Manager).
The Tree panel on the left-hand side of the DB Manager dialog lists all available database connections that have been configured so far. Since we have added a connection to the test-2.3.sqlite
SpatiaLite database in Chapter 2, Viewing Spatial Data, this connection is listed in DB Manager, as shown in the next screenshot.
To add new data to this database, we just need to select the connection from the list of available connections and then go to Table | Import layer/file. This will open the Import vector layer dialog, where we can configure the import settings, such as the name of the Table we want to create as well as additional options, including the input data CRS (the Source SRID option) and table CRS (the Target SRID option). By enabling these CRS options, we can reproject data while importing it. In the example shown in the following screenshot, we import urban areas from a Shapefile and reproject the data from EPSG:4326
(WGS84) to EPSG:32632
(WGS 84 / UTM zone 32N), since this is the CRS used by the already existing tables:

Tip
A handy shortcut for importing data into databases is by directly dragging and dropping files from the main window Browser panel to a database listed in DB Manager. This even works for multiple selected files at once (hold down Ctrl on Windows/Ubuntu or cmd on Mac to select more than one file in the Browser panel). When you drop the files onto the desired database, an Import vector layer dialog will appear, where you can configure the import.
- Oracle從入門到精通(第3版)
- Kibana Essentials
- Learning PostgreSQL
- 新手學Visual C# 2008程序設計
- Practical Windows Forensics
- Cassandra Data Modeling and Analysis
- Yocto for Raspberry Pi
- C++對象模型詳解
- Spring核心技術和案例實戰
- PySide 6/PyQt 6快速開發與實戰
- Spring MVC+MyBatis開發從入門到項目實踐(超值版)
- Android嵌入式系統程序開發:基于Cortex-A8(第2版)
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)
- Mastering OpenStack
- 程序員的英語