1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Compare commits

..

No commits in common. "6d450023b01958afe0bf0b99603885c03d73ed25" and "33b9354212be401e28796a96895498d92b5aeda2" have entirely different histories.

4 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,4 @@
version: 13.31.{build}
version: 13.30.{build}
configuration:
- Release

View File

@ -3,7 +3,7 @@ unix:!macx:!android {
} else {
TARGET = GPXSee
}
VERSION = 13.31
VERSION = 13.30
QT += core \

View File

@ -37,7 +37,7 @@ Unicode true
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "13.31"
!define VERSION "13.30"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -20,19 +20,18 @@ using namespace Mapsforge;
#define KEY_ELE "ele"
static Coordinates centroid(const QVector<Coordinates> &v)
static Coordinates centroid(const Polygon &polygon)
{
double area = 0;
double cx = 0, cy = 0;
const QVector<Coordinates> &v = polygon.first();
for (int i = 0; i < v.count() - 1; i++) {
const Coordinates &ci = v.at(i);
const Coordinates &cj = v.at(i+1);
double f = (ci.lon() * cj.lat() - cj.lon() * ci.lat());
for (int i = 0; i < v.count(); i++) {
int j = (i == v.count() - 1) ? 0 : i + 1;
double f = (v.at(i).lon() * v.at(j).lat() - v.at(j).lon() * v.at(i).lat());
area += f;
cx += (ci.lon() + cj.lon()) * f;
cy += (ci.lat() + cj.lat()) * f;
cx += (v.at(i).lon() + v.at(j).lon()) * f;
cy += (v.at(i).lat() + v.at(j).lat()) * f;
}
double factor = 1.0 / (3.0 * area);
@ -711,7 +710,7 @@ bool MapData::readPaths(const VectorTile *tile, int zoom, QList<Path> *list)
p.point.coordinates = Coordinates(outline.first().lon() + MD(lon),
outline.first().lat() + MD(lat));
else if (p.closed)
p.point.coordinates = centroid(outline);
p.point.coordinates = centroid(p.poly);
list->append(p);
}
@ -797,7 +796,7 @@ QDebug operator<<(QDebug dbg, const Mapsforge::MapData::Tag &tag)
QDebug operator<<(QDebug dbg, const MapData::Path &path)
{
dbg.nospace() << "Path(" << path.poly.boundingRect() << ", "
<< path.point.tags << ")";
<< path.tags << ")";
return dbg.space();
}