[postgis-users] wrong distance calculation

Ahmet Temiz ahmettemiz88 at gmail.com
Wed Mar 18 11:55:43 PDT 2015


hello

I am trying to calculate the distance from the schools to active faults and
their lengths.
 But then I tried to validate the some results and noticed that spatial
query gave
longer distances than checked values (in QGIS).

I used this sql fragment:


~~~~~~~~~~~~~
SELECT sOk.adi as adi,sFay.gid as faygid,sOk.gid as
OkGid,sOk.bolgeno,sFay.fayadi,sOk.il,
              sOk.ilce,sOk.jeo,
              ST_Length(geography(sFay.the_geom))::numeric(10,2) as FayBoyu
, sOk.the_geom as the_geom ,
              ST_Distance(                                         *****
              geography(sOk.the_geom),
              geography(sFay.the_geom)
              ) ::numeric(10,2) AS distance
        FROM sOkul_DepZon as sOk
        JOIN sdirifay_4326 as sFay
        ON ST_DWithin(
              geography(sOk.the_geom),
              geography(sFay.the_geom),
              120000) and  (sFay.faytipi~'1' or sFay.faytipi~'2')



~~~~~~~~~~~~~

​Can you tell me what the likely mistakes are ?

Ahmet Temiz

regards​

-- 
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı


________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150318/cf598878/attachment.html>


More information about the postgis-users mailing list