opengeospatial/ogc-geosparql

Distance between Connected Point

Opened this issue · 3 comments

Dear All,

I would like to know if it is possible to measure the distance among points connected by straight lines with a given distance in the line, and not simply doing an arithmetic measurement of distance?.

My use case is to measure distance among cities (points), but using the streets that connect cities to measure the distance among them, and not the euclidean distance.

Luis Ramos

situx commented

Dear Luis,

I think you have the following options to solve your problem with GeoSPARQL:

  1. Use M geometries: e.g. you could define a LINESTRING M (1.0 1.0 0.0, 2.0 2.0 3.0) where the third coordinate defines the measurement you track alongside your road. (I think you implied that by saying distance among points)
    This option does not work as of GeoSPARQL 1.1 because we do not have functions to return M coordinates or a function to return the first and last coordinates of a LineString. So using GeoSPARQL 1.1, your solution would need to be outside of GeoSPARQL.
    However, these functions are proposed for GeoSPARQL 1.2 and will be committed in this Pull Request #407

  2. Your second option might be to utilize the geof:length function with a customized unit. This function returns the length of a LineString (connecting your cities?). However, this function will use the unit of the coordinate reference system as a basis and then try to convert the length measured to your preferred unit. This means I am not sure if that is applicable to your case.

I hope that helps understanding the options and future perspectives.

Dear Situx,

thanks so much for your answer, I will try those options.

Thanks so much.

Best regards

Luis Ramos