Clustering GPS points based on distance between points?

24 ビュー (過去 30 日間)
DuckDuck
DuckDuck 2014 年 11 月 11 日
コメント済み: Paola Ceccon 2017 年 9 月 14 日
Hello everyone!
Can some one of you how can i cluster GPS points. Let say i have a ploted on a map some GPS points and i want to cluster them based on the distance between each other.
  1 件のコメント
Paola Ceccon
Paola Ceccon 2017 年 9 月 14 日
Hi, Have you resolve this problem? I have the same... I would appreciate your help

サインインしてコメントする。

回答 (2 件)

Chad Greene
Chad Greene 2014 年 11 月 11 日
If your data are in lat/lon coordinates, you'll need to convert them to some reasonable x/y coordinates, then you can use ipdm to calculate the distance from each point to every other point. Or you could identify centers of clusters and use hypot to calculate the distance between each point and each cluster center.
Either way, make sure you convert lat/lon to x/y because a degree of latitude does not equal a degree of longitude, so hypot(delta_lat,delta_lon) would not make much sense at all.

Sean de Wolski
Sean de Wolski 2014 年 11 月 11 日
Given a Geopoint P, which has an elevation property (in some unit) you can calculate the distance between the points using a referenceEllipsoid such as the wgs84 one:
% Build an ellipsoid with feet
wgs84 = wgs84Ellipsoid('ft');
% Distance in components
[dx, dy, dz] = ecefOffset(wgs84,...
P.Latitude(1:end-1), P.Longitude(1:end-1), P.ElevationFt(1:end-1),...
P.Latitude(2:end), P.Longitude(2:end), P.ElevationFt(2:end));
% Distance
dists = hypot(hypot(dx,dy),dz);
Note that the elevation and ellipsoid are both in feet for this example.
From here, if you want to cluster, you can use any standard method whether it's just a histogram or kmeans etc.
  2 件のコメント
DuckDuck
DuckDuck 2014 年 11 月 15 日
Ok , i created the distance matrix between all points, using the distance and deg2km functions in matlab. But how do i cluster them based on position?
Sean de Wolski
Sean de Wolski 2014 年 11 月 17 日
I'd start here:
Actually, I'd probably start with kmeans because it's quick and easy.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCluster Analysis and Anomaly Detection についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by