0

I need to apply an ST_distance query to find distance from the given table. How should I tell my query to take points one after the other consecutively on its own or like if the teacher specifies to find the distance between point 3 and 5? I just know this.

It'll be great if the queries are simple cause I'm newbie at this. I'm used to Python but not SQL.

SELECT name,ST_AsText(geom)
FROM   testpoints
LIMIT  2;

select ST_Distance( ST_GeometryFromText('POINT(73.08435381390693 33.72475853055647)'), ST_GeometryFromText('POINT(73.09256019460882 33.73467209912755)') );

enter image description here

Vince
  • 20,017
  • 15
  • 45
  • 64
Ayman
  • 1
  • 3
    What did your teacher say when you asked him? – Berend Jan 01 '24 at 15:34
  • 4
    This is more of a SQL fundamentals question than a GIS one, probably better researched over in [dba.se]. Your search term is "self join" – Vince Jan 01 '24 at 18:20
  • @Berend my teacher has just asked to put simple spatial queries like finding distance between two points, and area of a polygon , buffer and so on.. Now, I was thinking to upgrade to like if I'm given this kind of .shp file , then how to calculate areas of specified points or how to apply a loop that it calculates all the given geometry points. – Ayman Jan 01 '24 at 18:58

0 Answers0