Answers for "how to calculate distance between 2 points in knex postgis"

0

how to calculate distance between 2 points in knex postgis

const db = app.get('knex');


	// const distance = await db.raw(
	// 	`SELECT ST_Distance(
	//   ST_Transform('SRID=4326;POINT(${originCoords})'::geometry, 3857),
	//   ST_Transform('SRID=4326;LINESTRING(${destinationCoords})'::geometry, 3857)
	//  );
	// `,
	// );
Posted by: Guest on April-15-2021

Code answers related to "how to calculate distance between 2 points in knex postgis"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language