PostGIS Spatial Topological Relationship Spatial Analysis Tutorial

In the last article, we talked about the conversion functions of some gis data formats in postgis. In this article, we will talk about spatial analysis and spatial topology related knowledge.

First of all, we use several commonly used functions for analysis and cases:

1. st_intersects(geom,geom) returns whether two graphics intersect. It is used for the intersection relationship in the spatial topology relationship . Note that these two parameters can be any type of graphics, which can be a point and a line, a point and another point, a line and another line, a line and a surface, which means whether any two graphics intersect in space . Intersect returns true, disjoint returns false

Still the same as the previous article, we use the shape of Hangzhou as an example,

select st_intersects((select geom from public.杭州市 h where id=2),
(select geom  from public.杭州市 h where id=4));

got the answer:

 This function is the most commonly used function for server-side spatial analysis, which can realize, for example, whether a point is inside a certain area:

select st_intersects('SRID=4326;POINT(120.23684 30.184585)'::geometry,(select  geom  from public.杭州市 h where id=4));

おすすめ

転載: blog.csdn.net/lz5211314121/article/details/129492265