Svarbu
Vertimas yra bendruomenės pastangos, prie kurių jūs galite prisijungti. Šis puslapis šiuo metu išverstas 74.44%.
24.1.3. Duomenų bazės
24.1.3.1. Eksportuoti į PostgreSQL
Eksportuoja vektorinį sluoksnį į PostgreSQL duomenų bazę, sukuriant naują lenttelę. Jei lentelė tokiu pavadinimu jau yra, ją galima išimti prie kuriant naują. Prieš vykdant šį veiksmą turi būti sukurta jungtis tarp QGIS ir PostgreSQL duomenų bazės (žr. Creating a stored Connection).
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Importuojamas sluoksnis |
|
[vektorius: bet koks] |
Į duomenų bazę pridedamas vektorinis sluoksnis |
Duomenų bazė (jungties pavadinimas) |
|
[tekstas] |
Duomenų bazės jungties pavadinimas (ne duomenų bazės pavadinimas). Iškrentančiame sąraše bus rodomos esamos jungtys. |
Schema (schemos pavadinimas) Pasirinktinis |
|
[tekstas] Numatyta: ‚public‘ |
Pavadinimas schemos, kurioje reikia laikyti duomenis. Tai gali būti nauja arba jau esama schema. |
Lentelė, į kurią importuojama (palikite tuščią, jei norite naudoti sluoksnio pavadinimą) Pasirinktinis |
|
[tekstas] Numatytas: ‚‘ |
Nustato importuojamo vektorinio failo lentelės pavadinimą. Jei niekas nenurodyta, bus naudojamas sluoksnio pavadinimas. |
Pirminio rakto laukas Pasirinktinis |
|
[tablefield: any] |
Nustato pirminio rakto lauką pagal esamą vektorinio sluoksnio lauką. Stulpelis su unikaliomis reikšmėmis gali būti naudojamas kaip duomenų bazės Pirminis raktas. |
Geometrijos stulpelis |
|
[tekstas] Numatytas: ‚geom‘ |
Nustato naujos PostGIS lentelės geometrijos stulpelio pavadinimą. Šiame stulpelyje saugoma geoobjektų geometrijos informacija. |
Koduotė Pasirinktinis |
|
[tekstas] Numatyta: ‚UTF-8‘ |
Nustato išvesties sluoksnio koduotę |
Perrašyti |
|
[boolean] Numatytas: Taip |
Jei nurodyta lentelė jau yra, nustačius šios parinkties reikšmę |
Kurti erdvinį indeksą |
|
[boolean] Numatytas: Taip |
Nurodo kurti erdvinį indeksą ar ne |
Keisti laukų pavadinimus į mažąsias raides |
|
[boolean] Numatytas: Taip |
Keičia įvesties vektorinio sluoksnio laukų pavadinimus į mažąsias raides |
Išmesti tekstinių laukų ilgio apribojimus |
|
[boolean] Numatytas: ne |
Ar reikia išmesti tekstinių laukų ilgio apribojimus |
Kurti vienos dalies geometrijas vietoje kelių dalių |
|
[boolean] Numatytas: ne |
Ar išvesties sluoksnio geoobjektai turėtų būti vienos dalies vietoj kelių dalių. Pagal nutylėjimą išlaikoma esama geometrijų informacija. |
Išvestys
Algoritmas neturi išvesties.
Pythono kodas
Algoritmo ID: qgis:importintopostgis
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.
24.1.3.2. Export to SpatiaLite
Exports a vector layer to a SpatiaLite database. Prior to this a connection between QGIS and the SpatiaLite database has to be created (see eg SpatiaLite Layers).
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Importuojamas sluoksnis |
|
[vektorius: bet koks] |
Į duomenų bazę pridedamas vektorinis sluoksnis |
File database |
|
[vektorius: bet koks] |
The SQLite/SpatiaLite database file to connect to |
Lentelė, į kurią importuojama (palikite tuščią, jei norite naudoti sluoksnio pavadinimą) Pasirinktinis |
|
[tekstas] Numatytas: ‚‘ |
Defines the table name for the imported vector file. If nothing is specified, the layer name will be used. |
Pirminio rakto laukas Pasirinktinis |
|
[tablefield: any] |
Use a field in the input vector layer as the primary key |
Geometrijos stulpelis |
|
[tekstas] Numatytas: ‚geom‘ |
Defines the name of the geometry column in the new SpatiaLite table. Geometry information for the features is stored in this column. |
Koduotė Pasirinktinis |
|
[tekstas] Numatyta: ‚UTF-8‘ |
Nustato išvesties sluoksnio koduotę |
Perrašyti |
|
[boolean] Numatytas: Taip |
If the specified table exists, setting this option to
|
Kurti erdvinį indeksą |
|
[boolean] Numatytas: Taip |
Nurodo kurti erdvinį indeksą ar ne |
Keisti laukų pavadinimus į mažąsias raides |
|
[boolean] Numatytas: Taip |
Convert the field names of the input vector layer to lowercase |
Išmesti tekstinių laukų ilgio apribojimus |
|
[boolean] Numatytas: ne |
Ar reikia išmesti tekstinių laukų ilgio apribojimus |
Kurti vienos dalies geometrijas vietoje kelių dalių |
|
[boolean] Numatytas: ne |
Ar išvesties sluoksnio geoobjektai turėtų būti vienos dalies vietoj kelių dalių. Pagal nutylėjimą išlaikoma esama geometrijų informacija. |
Išvestys
Algoritmas neturi išvesties.
Pythono kodas
Algorithm ID: qgis:importintospatialite
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.
24.1.3.3. Package layers
Adds layers to a GeoPackage.
If the GeoPackage exists and Overwrite existing GeoPackage
is checked, it will be overwritten (removed and recreated).
If the GeoPackage exists and Overwrite existing GeoPackage
is not checked, the layer will be appended.
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Įvesties sluoksniai |
|
[vektorius: bet koks] [sąrašas] |
The (vector) layers to import into the GeoPackage.
Raster layers are not supported. If a raster layer is
added, a
|
Overwrite existing GeoPackage |
|
[boolean] Numatytas: ne |
If the specified GeoPackage exists, setting this option to
|
Save layer styles into GeoPackage |
|
[boolean] Numatytas: Taip |
Save the layer styles |
Save layer metadata into GeoPackage |
|
[boolean] Numatytas: Taip |
If checked, copies the source layer metadata into the GeoPackage so it becomes the default metadata for the layer. |
Save only selected features |
|
[boolean] Numatytas: ne |
If a layer has a selection, setting this option to |
Export related layers following relations defined in the project |
|
[boolean] Numatytas: ne |
If an input layer has relations set in the project,
setting this option to |
Destination GeoPackage |
|
[file] Numatytas: |
Specify where to store the GeoPackage file. One of
|
Išvestys
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Layers within new package |
|
[string] [list] |
The list of layers added to the GeoPackage. |
Pythono kodas
Algorithm ID: native:package
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.
24.1.3.4. PostgreSQL execute and load SQL
Allows a SQL database query to be performed on a PostgreSQL database connected to QGIS and loads the result. The algorithm won’t create a new layer: it is designed to run queries on the layer itself.
Pavyzdys
Set all the values of an existing field to a fixed value. The SQL query string will be:
UPDATE your_table SET field_to_update=20;
In the example above, the values of the field
field_to_update
of the tableyour_table
will be all set to20
.Create a new
area
column and calculate the area of each feature with theST_AREA
PostGIS function.-- Create the new column "area" on the table your_table" ALTER TABLE your_table ADD COLUMN area double precision; -- Update the "area" column and calculate the area of each feature: UPDATE your_table SET area=ST_AREA(geom);
Taip pat žiūrėkite
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Duomenų bazė (jungties pavadinimas) |
|
[tekstas] |
The database connection (not the database name). Existing connections will be shown in the combobox. |
SQL query |
|
[tekstas] |
Defines the SQL query, for example
|
Unique ID field name |
|
[tekstas] Default: id |
Sets the primary key field (a column in the result table) |
Geometry field name Pasirinktinis |
|
[tekstas] Numatytas: ‚geom‘ |
Name of the geometry column (a column in the result table) |
Išvestys
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
SQL layer |
|
[vektorius: bet koks] |
The resulting vector layer to be loaded into QGIS. |
Pythono kodas
Algorithm ID: qgis:postgisexecuteandloadsql
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.
24.1.3.5. PostgreSQL execute SQL
Allows a SQL database query to be performed on a PostgreSQL database connected to QGIS. The algorithm won’t create a new layer: it is designed to run queries on the layer itself.
Pavyzdys
Set all the values of an existing field to a fixed value. The SQL query string will be:
UPDATE your_table SET field_to_update=20;
In the example above, the values of the field
field_to_update
of the tableyour_table
will be all set to20
.Create a new
area
column and calculate the area of each feature with theST_AREA
PostGIS function.-- Create the new column "area" on the table your_table" ALTER TABLE your_table ADD COLUMN area double precision; -- Update the "area" column and calculate the area of each feature: UPDATE your_table SET area=ST_AREA(geom);
Taip pat žiūrėkite
PostgreSQL execute and load SQL, Execute SQL, SpatiaLite execute SQL
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Duomenų bazė (jungties pavadinimas) |
|
[tekstas] |
The database connection (not the database name). Existing connections will be shown in the combobox. |
SQL query |
|
[tekstas] |
Defines the SQL query, for example
|
Išvestys
No output is created. The SQL query is executed in place.
Pythono kodas
Algorithm ID: native:postgisexecutesql
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.
24.1.3.6. SpatiaLite execute SQL
Allows a SQL database query to be performed on a SpatiaLite database. The database is determined by an input layer or file. The algorithm won’t create a new layer: it is designed to run queries on the layer itself.
Taip pat žiūrėkite
PostgreSQL execute SQL, Execute SQL
For some SQL query examples see PostGIS SQL Query Examples.
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Database layer (or file) |
|
[file] |
The SQLite/SpatiaLite database file to connect to |
SQL query |
|
[tekstas] Numatytas: ‚‘ |
Defines the SQL query, for example
|
Išvestys
No output is created. The SQL query is executed in place.
Pythono kodas
Algorithm ID: native:spatialiteexecutesql
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.
24.1.3.7. SpatiaLite execute SQL (registered DB)
Allows a SQL database query to be performed on a SpatiaLite database connected to QGIS. The algorithm won’t create a new layer: it is designed to run queries on the layer itself.
Taip pat žiūrėkite
PostgreSQL execute SQL, Execute SQL
For some SQL query examples see PostGIS SQL Query Examples.
Parametrai
Užrašas |
Pavadinimas |
Tipas |
Aprašymas |
---|---|---|---|
Database |
|
[sąrašas] Default: not set |
Select a SQLite/SpatiaLite database connected to the current session |
SQL query |
|
[tekstas] Numatytas: ‚‘ |
Defines the SQL query, for example
|
Išvestys
No output is created. The SQL query is executed in place.
Pythono kodas
Algorithm ID: native:spatialiteexecutesqlregistered
import processing
processing.run("algorithm_id", {parameter_dictionary})
algoritmo id rodomas, kai užvedate pelę virš algoritmo apdorojimo įrankinėje. parametrų žodynas teikia parametrų pavadinimus ir reikšmes. Daugiau informacijos apie tai, kaip vykdyti apdorojimo algoritmus Pythono konsolėje rasite skyriuje Using processing algorithms from the console.