Loading...
Loading...
PostGIS-focused SQL tips, tricks and gotchas. Use when in need of dealing with geospatial data in Postgres.
npx skill4agent add postgis/postgis postgis-skill--st_segmentizeST_Segmentizegeomgeogincludingselect postgis_full_version();sum(case when A then 1 else 0 end)count() filter (where A)row_number() ... = 1order by + limit 1distinct onlateralexists(select 1 from ...)exists(select from ...)tags ->> 'key' = 'value'tags @> '{"key": "value"}order bygeometry(multilinestring, 4326)geometrygeographyST_MultiST_SetSRIDST_UnaryUnion(ST_Collect(geom))ST_Union(geom)ST_Buffer(geom, 0)ST_MakeValid(geom)select min(ST_Distance(..))select ST_Distance() ... order by a <-> b limit 1order by ST_Distance(c.geog, t.geog)order by c.geog <-> t.geogST_UnaryUnionST_MakeValidST_SetSRIDST_GeomFromGeoJSONEWKTSRID=4326;POINT(...EWKBST_TransformST_IntersectsST_Simplify(geom, 0)ST_ClusterKMeansmax_radiusST_AsEWKBST_AsWKBST_HexagonST_HexagonGridh3ST_QuantizeCoordinates