gdouble
mp_int2lat(gint lat)
{
-
+return 0;
}
-gint
+gulong
calculate_idistance(gint lat1, gint lon1, gint lat2, gint lon2)
{
return lrint(sqrt((double)((lat1-lat2)*(lat1-lat2)+(lon1-lon2)*(lon1-lon2))));
/**
* Quick distance for comparing, skips the final square root
*/
-gint
+gulong
calculate_idistance_cmp(gint lat1, gint lon1, gint lat2, gint lon2)
{
return ((lat1-lat2)*(lat1-lat2)+(lon1-lon2)*(lon1-lon2));
gint32 lon2mp_int(gdouble lon);
gint32 lat2mp_int(gdouble lat);
gdouble calculate_distance(gdouble lat1, gdouble lon1, gdouble lat2, gdouble lon2);
-gint calculate_idistance(gint lat1, gint lon1, gint lat2, gint lon2);
+gulong calculate_idistance(gint lat1, gint lon1, gint lat2, gint lon2);
+gulong calculate_idistance_cmp(gint lat1, gint lon1, gint lat2, gint lon2);
#endif
osm_way *street;
osm_place *primary;
osm_place *secondary;
- gdouble valid;
+ gboolean changed;
+ gboolean valid;
gint lat;
gint lon;
};
#include "mapper-types.h"
#include "map.h"
#include "file.h"
+#include "latlon.h"
void route_find_nearest_point();
void cancel_autoroute(gboolean temporary);
if (curr->unity) {
unit2latlon(curr->unitx, curr->unity, lat2,
lon2);
- sum +=
- calculate_distance(lat1, lon1, lat2, lon2);
+ sum += calculate_distance(lat1, lon1, lat2, lon2);
lat1 = lat2;
lon1 = lon2;
}
if (curr->unity) {
unit2latlon(curr->unitx, curr->unity, lat2,
lon2);
- sum +=
- calculate_distance(lat1, lon1, lat2, lon2);
+ sum += calculate_distance(lat1, lon1, lat2, lon2);
lat1 = lat2;
lon1 = lon2;
}
#include "file.h"
#include "track.h"
+#include "latlon.h"
#include "path.h"
struct sql_select_stmt {
for (curr = _track.tail; curr > point; --curr) {
if (curr->unity) {
unit2latlon(curr->unitx, curr->unity, lat2, lon2);
- g_printf("B:[%f %f %f %f (%f)]\n", lat1, lon1, lat2,
- lon2, sum);
sum += calculate_distance(lat1, lon1, lat2, lon2);
lat1 = lat2;
lon1 = lon2;
break;
}
gtk_widget_destroy(dialog);
+return TRUE;
}