How to Add Geometry to a Feature Using the INSERT Statement in PostGIS with QGIS | 21 |

Published: 26 May 2024
on channel: GIS Schools
296
12

Material for Practice: https://gisschools.com/course_details...

In this tutorial, learn how to insert geometries into a PostGIS database using SQL statements with QGIS. We explore the basics of inserting geometry data, which is stored in binary digits, and how it differs from GIS data that includes latitude and longitude references along with 3D values or different types like line, string, multi-line, and point. Discover various methods of inserting data into tables using queries.

Chapters:
0:00:32 - Introduction to Geometry Insertion with SQL Statements
0:00:58 - Converting Simple Text Format Data into Geometry
0:01:24 - Executing a Simple Point Geometry
0:02:21 - Inserting Line String Geometry
0:02:54 - Examining the Inserted Line String
0:03:28 - Creating Multi-Line String Geometry
0:03:54 - Verifying the Multi-Line String Insertion
0:04:24 - Using ST_MultiLine Function for Multi-Line String

-----------------------------------------------------
-------------------- queries -----------------
-----------------------------------------------------
-- Cast WKT to geometry
select 'POINT(72.64 29.66)'::geometry as geom into qlayer;
select 'LINESTRING(72.64 29.67, 72.65 29.68)'::geometry as geom into qlayer2;
select 'MULTILINESTRING((72.64 29.67, 72.65 29.68),(72.64 29.67, 72.65 29.68))'::geometry as geom;
select st_multi('LINESTRING(72.64 29.67, 72.65 29.68)'::geometry) as geom ;

-------------------------

-- PostGIS geometry constructor function

select st_GeometryFromText('POINT(72.64 29.66)',4326) as geom
ST_GeometryFromText
ST_GeomFromGeoJSON
ST_GeomFromGML
ST_GeomFromKML

----------------------------------

-Make Point-
SELECT ST_MakePoint(-71.1043443253471, 42.3150676015829);
SELECT ST_SetSRID(ST_MakePoint(-71.1043443253471, 42.3150676015829),4326);
SELECT st_multi(ST_SetSRID(ST_MakePoint(72.64, 29.66),4326))as geom into qlayer3;
INSERT INTO public.tbl_trees(type, name, geom)
VALUES ('Evergreen Trees', 'Hemlock', (st_multi(ST_SetSRID(ST_MakePoint(72.64, 29.66),4326))));
select * from tbl_trees order by gid;
delete from tbl_trees where gid = 178;



Complete Course : Learn Spatial Databases with PostGIS and QGIS

1) How to Install PostgreSQL | Learn Spatial Databases with PostGIS and QGIS
   • How to Install PostgreSQL | Learn Spa...  

2) How to Install PostGIS | Learn Spatial Databases with PostGIS and QGIS
   • How to Install PostGIS | Learn Spatia...  

3) How to Import/Export Shapefile into Databases with PostGIS Manager
   • How to Import/Export Shapefile into D...  

4) How to Import / Export Shapefile from QGIS DB Manager into PostGIS
   • How to Import / Export Shapefile from...  

5) Working with PostGIS By using pgAdmin and QGIS DB Manager
   • Working with PostGIS By using pgAdmin...  

6) PostgreSQL Backup and Restore Spatial Database with PGAdmin4
   • PostgreSQL Backup and Restore Spatial...  

7) Postgres: SQL SELECT Statement | PostGIS and QGIS | Eng Subtitles
   • Postgres: SQL SELECT Statement | Post...  

8) PostgreSQL: The WHERE clause | Learn Spatial DB with PostGIS and QGIS
   • PostgreSQL: The WHERE clause | Learn ...  

9) Aggregate Functions and GROUP BY | Learn Spatial DB with PostGIS, QGIS
   • Aggregate Functions and GROUP BY  | L...  

10) Multi Table Joins in PostgreSQL | Learn Spatial DB with PostGIS, QGIS
   • Multi Table Joins  in  PostgreSQL | L...  

11) The CASE Statement, DataType and Operators in Postgres | PostGIS, QGIS
   • The CASE Statement, DataType and Oper...  

12) Spatial Reference ID and Geometry Field in PostGIS | PostgreSQL, QGIS
   • Spatial Reference ID and Geometry Fie...  

13) Spatial Queries - Working with Geometries PostGIS | PostgreSQL | QGIS
   • Spatial Queries - Working with Geomet...  

14) Measurements Area, Length in PostGIS | Geography vs Geometry
   • Measurements  Area, Length in PostGIS...  

15) Find latitude, Longitude (X,Y) from Multi-Geometry in PostGIS
   • Find latitude, Longitude (X,Y) from M...  

16) How to Handel Spatial Relationships of GIS Objects in PostGIS | PostgreSQL
   • How to Handel Spatial Relationships o...  

17) Spatial Joins with Multi-Table in PostGIS | PostgreSQL
   • Spatial Joins with Multi-Table in Pos...  

18) Geometry Processing Functions and Spatial Joins in PostGIS | QGIS
   • Geometry Processing Functions and Spa...  

19) Step-by-Step: Create Spatial Tables & Add Geometry Columns in PostGIS with QGIS
   • Step-by-Step: Create Spatial Tables &...  

20) How to Create Spatial and Attribute Indexes in PostGIS with QGIS
   • How to Create Spatial and Attribute I...  

21) How to Add Geometry to a Feature Using the INSERT Statement in PostGIS with QGIS
   • How to Add Geometry to a Feature Usin...  


------------------------------------------
------------Contact Me:------
------------------------------------------
Email: [email protected]
Website: https://gisittools.com/
Website: https://gisschools.com/
Facebook:   / gisandittools  
instagram:   / sohailgoheer  


Welcome to my YouTube channel GIS Schools
Please Subscribe to my Chanel ‪@GISSchools‬


Watch video How to Add Geometry to a Feature Using the INSERT Statement in PostGIS with QGIS | 21 | online without registration, duration hours minute second in high quality. This video was added by user GIS Schools 26 May 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 296 once and liked it 12 people.