Monday, 14 May 2018

database - Postgis convert long lat from 2 different locations into line and calculate the distance in meters


The name of my table is odk_duct.duct_monitoring1_core and the select statement below is what i want to see the distance. The table has 2 longitudes and 2 latitudes.


select 
"_URI" as id,
"_SUBMISSION_DATE" as date,

initcap("INFO_TEAM_NAME") as team_name,
initcap("INFO_SUPERVISOR_NAME") as supervisor_name,
"INFO_LOCATION" as location,
"RPT_FTR_POINT1_LAT" as first_point_lat,
"RPT_FTR_POINT1_LNG" as first_point_long,
"RPT_FTR_POINT2_LAT" as second_point_lat,
"RPT_FTR_POINT2_LNG" second_point_long,
"RPT_FTR_WIDTH" as width_cleared,
formid
FROM odk_duct.duct_monitoring1_core


I want to know the distance between point 1 and point 2 in meters using PostGIS query.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...