Vector data formats include GeoPackage, GML, GeoJSON, GPX, KML,
Comma Separated Values, ESRI formats (Shapefile, Geodatabase...),
MapInfo and MicroStation file formats, AutoCAD DWG/DXF,
GRASS and many more...
Read the complete list of supported vector formats.
Raster data formats include GeoTIFF, JPEG, ASCII Gridded XYZ,
MBTiles, R or Idrisi rasters, GDAL Virtual, SRTM, Sentinel Data,
ERDAS IMAGINE, ArcInfo Binary Grid, ArcInfo ASCII Grid, and
many more...
Read the complete list of supported raster formats.
Use Open with Data Source Manager... to directly open and configure the
data source in the Data Source Manager using the URI of your data source.
This simplifies the process of adding a layer from the Browser
by allowing you to set specific opening options for the data source.
It is currently available for vector (including the dedicated GeoPackage entry), raster,
and SpatiaLite data sources.
Press Open to load the selected file into Data
Source Manager dialog.
Depending on the selected layer type, additional Options
(encoding, geometry type, table filtering, file locking, data formatting ...)
are available for configuring.
These options are described in detail in the specific GDAL
vector
or raster driver documentation.
At the top of the options, a text with hyperlink will directly lead to the documentation
of the appopriate driver for the selected file format.
Press Add to load the file in QGIS and display them in the map view.
When adding vector datasets containing multiple layers, the
Select Items to Add dialog will appear. In this dialog, you can
choose the specific layers from your dataset that you want to add.
Also, under Options you can choose to:
Add layers to a group
Show system and internal tables
Show empty vector layers.
图 11.7 shows QGIS after loading the alaska.shp file.
Cloud storage such as AWSS3, GoogleCloudStorage, MicrosoftAzureBlob, MicrosoftAzureDataLakeStorage, AlibabaOSSCloud, and
OpenStackSwiftStorage supports direct control over VSI Credential Options
when adding OGR vector or GDAL raster layers.
You need to fill in the Bucket or container and the
Object key first. After that, you can add the necessary Credential Options.
When adding OGR vector or GDAL raster layers from the cloud based protocols,
you can also set additional Credential options for that specific driver and bucket.
When credential options are found in a layer's URI, they will also be automatically set.
This allows different layers to use different credentials.
QGIS tries to detect the field types automatically (unless
Detect field types is not checked) by examining
the content of an optional sidecar CSVT file (see GeoCSV specification)
and by scanning the whole file to make sure that all values can actually
be converted without errors, the fall-back field type is text.
Input the location of the Source drawing, i.e. the DWG/DXF drawing
file to import.
指定图形文件中数据的坐标参照系。
Input the location of the Target package, i.e. the GeoPackage file
that will store the data. If an existing file is provided, then it will be
overwritten.
Choose how to import blocks with the dedicated combobox:
Expand Block Geometries: imports the blocks in the drawing file as normal elements.
Expand Block Geometries and Add Insert Points: imports the blocks in the drawing file as normal elements and adds the insertion point as a point layer.
Add Only Insert Points: adds the blocks insertion point as a point layer.
选中 使用曲线 将导入的图层提升为 曲线 几何图形类型。
Use the Import button to import the drawing into the destination
GeoPackage file.
The GeoPackage database will be automatically populated with the
drawing file content.
Depending on the size of the file, this can take some time.
The first time you use a PostGIS data source, you must create a connection
to a database that contains the data.
Press the appropriate button as exposed above, opening the PostgreSQL tab
of the Data Source Manager dialog.
To access the connection manager, click on the New button
to display the Create a New PostGIS Connection dialog.
SSL mode: SSL encryption setup.
The following options are available:
优先 (默认): 我不关心加密,但如果服务器支持,希望支付加密的开销。
需要: 我希望我的数据被加密并接受开销。相信网络会确保始终连接到我想要的服务器。
检验证书颁发机构: 我希望我的数据加密并接受开销。希望确保连接到我信任的服务器。
完全检验: 我希望我的数据加密并接受开销。我想确保连接到我信任的服务器,并且是由我指定的服务器。
允许: 我不关心安全性,但如果服务器坚持加密,我会支付加密的开销。
禁用: 我不关心安全性,也不想为加密支付开销。
Session role: used to set the current user identifier of the current session.
This is useful to automatically give the ownership of a new object (table, view, function)
to the session_role group and thus share ownership and associated rights with all members
of the session_role group.
Read more about session role.
Use estimated table metadata: When initializing layers,
various queries may be needed to establish the characteristics of the geometries
stored in the database table.
When this option is checked, these queries examine only a sample of the rows
and use the table statistics, rather than the entire table.
This can drastically speed up operations on large datasets,
but may result in incorrect characterization of layers
(e.g. the feature count of filtered layers will not be accurately determined)
and may even cause strange behaviour if columns that are supposed to be unique
actually are not.
There are two services in the above example: water_service
and wastewater_service. You can use these to connect from QGIS,
pgAdmin, etc. by specifying only the name of the service you want to
connect to (without the enclosing brackets).
If you want to use the service with psql, you can do psqlservice=water_service.
You can specify the location of the service file by creating a
PGSERVICEFILE environment variable (e.g. run the
exportPGSERVICEFILE=/home/web/.pg_service.conf
command under your *nix OS to temporarily set the PGSERVICEFILE variable).
The spatial features in Oracle Spatial aid users in managing geographic and
location data in a native type within an Oracle database.
The connection dialog proposes:
Schema: Allows to specify a single schema to limit a connection to.
When set, only tables from the matching schema will be included in the browser panel
and data source select for the connection.
This can be used to limit the database work required to populate tables
for a connection pointing to a large database store.
To create a new MS SQL Server connection, you need to provide some of the
following information in the Connection Details dialog:
Connection name
Provider/DSN
Host
Login information. You can choose
to Save your credentials.
Navigate to the Database Details section and click the
List Databases button to view the available datasets.
Select datasets that you want, then press OK.
Optionally, you can also perform a Test Connection.
Once you click OK the Create a New MS SQL Server Connection dialog
will close and in the Data Source Manager press Connect,
select a layer and then click Add.
Optionally, you can activate the following options:
Only look in the geometry_columns metadata table.
Use layer extent from geometry_columns table,
this checkbox is dependent on the first one; it remains disabled unless
the first option is checked.
Use primary key from geometry_columns table
Also list table with no geometry: tables without a
geometry column attached will also be shown in the available table list.
Use estimated table parameters: only estimated table
metadata will be used. This avoids a slow table scan, but may result in
incorrect layer properties such as layer extent.
Skip invalid geometry handling: all handling of records
with invalid geometry will be disabled. This speeds up the provider, however,
if any invalid geometries are present in a table then the result is unpredictable
and may include missing records. Only check this option if you are certain that
all geometries present in the database are valid, and any newly added geometries
or tables will also be valid.
Use only a Subset of Schemas will allow you to filter
schemas for MS SQL connection. If enabled, only checked schemas will be displayed.
You can right-click to Check or Uncheck any schema
in the list.
Use estimated table metadata: If checked, estimated
table metadata will be used if available. For large tables, this avoids slow
table loads and potentially expensive computations, but may result in
incorrect layer properties such as layer extent. The fast extent estimation
is available starting with QRC1/2024 and SP8 in HANA Cloud and HANA On-Premise
respectively.
同时列出没有几何图形的表: 如果勾选,QGIS还会搜索不包含空间列的表和视图。
小技巧
连接到 SAP HANA 云
如果要连接到 SAP HANA 云实例,必须将 端口号 设置为 443 并勾选 启用 TLS/SSL 加密 。
By default, QGIS can retrieve layers metadata from the connections or data providers that allow metadata storage
(more details on saving metadata to the database).
The Metadata search panel allows to browse the layers by their metadata
and add them to the project (either with a double-click or the Add button).
The list can be filtered:
by text, watching a set of metadata properties (identifier, title, abstract)
by spatial extent, using the current project extent or the map canvas extent
You can load vector tiles directly from a Style URL.
The data source is automatically parsed from the style, and URLs with multiple sources are supported.
That makes Source URL optional.
the Source URL: of the type http://example.com/{z}/{x}/{y}.pbf for generic
services and http://example.com/arcgis/rest/services/Layer/VectorTileServer
for ArcGIS based services.
The service must provide tiles in .pbf format.
XYZ Tile services can be added via the XYZ tab
of the Data Source Manager dialog or the contextual menu of the
XYZ Tiles entry in the Browser panel.
By default, QGIS provides some default and ready-to-use XYZ Tiles services:
Configurations can be saved to .XML file (Save Connections)
through the XYZ entry in Data Source Manager dialog
or its contextual menu in the Browser panel.
Likewise, they can be added from a file (Load Connections).
It is also possible to add XYZ tiles to a project without necessarily storing
its connection settings in you user profile (e.g. for a dataset you may need once).
In the Data Source Manager ► XYZ tab, edit any properties
in the Connection Details group.
The Name field above should turn into Custom.
Press Add to load the layer in the project.
It will be named by default XYZLayer.
QGIS supports connections to cloud services like Alibaba Cloud OSS, Amazon S3, Google Cloud Storage,
Microsoft Azure Blob Storage, Microsoft Azure Data Lake Storage, and OpenStack Swift Object Storage.
You can load vector and raster data from these services into QGIS.
Set up a new Cloud connection in the Browser panel by right-clicking
on the Cloud entry and selecting New Connection. You will see a drop-down list of
available cloud services.
Select the service you want to connect to and fill in the required fields: