in Education by
I'm using a lat/long SRID in my PostGIS database (-4326). I would like to find the nearest points to a given point in an efficient manner. I tried doing an ORDER BY ST_Distance(point, ST_GeomFromText(?,-4326)) which gives me ok results in the lower 48 states, but up in Alaska it gives me garbage. Is there a way to do real distance calculations in PostGIS, or am I going to have to give a reasonable sized buffer and then calculate the great circle distances and sort the results in the code afterwards? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You are looking for ST_distance_sphere(point,point) or st_distance_spheroid(point,point). See: http://postgis.refractions.net/documentation/manual-1.3/ch06.html#distance_sphere http://postgis.refractions.net/documentation/manual-1.3/ch06.html#distance_spheroid This is normally referred to a geodesic or geodetic distance... while the two terms have slightly different meanings, they tend to be used interchangably. Alternatively, you can project the data and use the standard st_distance function... this is only practical over short distances (using UTM or state plane) or if all distances are relative to a one or two points (equidistant projections).

Related questions

0 votes
    I'm trying to convert a ply to a polyhedron stored in postgis. In this example I have a cube ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    Is it necessary that the Secretary-General should be a citizen of the great powers/the big five? Please answer the above question....
asked Aug 10, 2022 in Education by JackTerrance
0 votes
    State whether the following statement are true or false with reasons. Corporate Social Responsibility (CSR) has ... today. Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    State whether the following statement are true or false with reasons. The Non-Aligned Movement had great significance. Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    Can someone please tell me some tips to make a great minimal reproducible r example? And How can I paste data ... should I include? Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    perimeter of circle in c program without argument with return type Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
0 votes
0 votes
    Calculate the capacitance of a material in air with area 20 units and distance between plates is ... by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 11, 2021 in Education by JackTerrance
0 votes
    The time for repositioning the arm is called the ________ and it increases with the distance that the arm ... Storage in section Storage and File Structures of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
...