Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the common query sql in PostGIS?

Shulou Source: shulou.com Published: 2022-06-01 18:30:06 10月03日 Update

This article mainly shows you the "commonly used query sql in PostGIS what are", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is commonly used in PostGIS query sql" this article.

PostGIS is a widely used spatial extension of open source database Postgresql. Using PostGIS plug-in, you can easily organize and manage spatial data in the database. At the same time, PostGIS also has many spatial processing and analysis functions, which can easily complete the processing of data layers in the database. At present, many open source and commercial software can support direct connection to Postgresql databases with PostGIS spatial expansion. Edit and modify the data in the database, and publish the spatial layer data directly.

Postgresql connection tool, there is an open source pgadmin, charge Navicat, please install it yourself, configure the connection, and execute the sql statement.

Here are some commonly used sql query statements:

Use Navicat to open the query interface, enter sql statements, postgresql plus space expansion, query, need to write some ready-made space functions, sql statements can be executed in each client, the knowledge of sql statements can be learned from online query

Open the query interface of the sql statement

Query the spatial information of the layer into commonly used wkt strings. The function used is st_astext (spatial field). For more information about wkt, please see: https://en.wikipedia.org/wiki/Well-known_text

The central point of the spatial information in the query layer is converted into a wkt string. The function is st_centroid (spatial field), and the results of the query can also be exported.

Query the length of the centerline layer in the data table. The function used is st_length (spatial field), and the result is in meters.

The website of the reference function of postgis is: http://postgis.net/docs/manual-2.4/, which enumerates all the functions, uses the database, facilitates batch processing of layer data, and can carry out common spatial analysis operations.

The above is all the contents of the article "query what sql is commonly used in PostGIS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Queries data spaces functions commonly used databases statements commonly used queries content fields knowledge articles processing learning information characters strings plug-ins interfaces results Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi MySQL Microsoft Huawei