mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-23 19:25:54 +01:00
Compare commits
3 Commits
33b9354212
...
6d450023b0
Author | SHA1 | Date | |
---|---|---|---|
6d450023b0 | |||
890985bacd | |||
496065b549 |
@ -1,4 +1,4 @@
|
|||||||
version: 13.30.{build}
|
version: 13.31.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 13.30
|
VERSION = 13.31
|
||||||
|
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
|
@ -37,7 +37,7 @@ Unicode true
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "13.30"
|
!define VERSION "13.31"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
@ -20,18 +20,19 @@ using namespace Mapsforge;
|
|||||||
#define KEY_ELE "ele"
|
#define KEY_ELE "ele"
|
||||||
|
|
||||||
|
|
||||||
static Coordinates centroid(const Polygon &polygon)
|
static Coordinates centroid(const QVector<Coordinates> &v)
|
||||||
{
|
{
|
||||||
double area = 0;
|
double area = 0;
|
||||||
double cx = 0, cy = 0;
|
double cx = 0, cy = 0;
|
||||||
const QVector<Coordinates> &v = polygon.first();
|
|
||||||
|
|
||||||
for (int i = 0; i < v.count(); i++) {
|
for (int i = 0; i < v.count() - 1; i++) {
|
||||||
int j = (i == v.count() - 1) ? 0 : i + 1;
|
const Coordinates &ci = v.at(i);
|
||||||
double f = (v.at(i).lon() * v.at(j).lat() - v.at(j).lon() * v.at(i).lat());
|
const Coordinates &cj = v.at(i+1);
|
||||||
|
double f = (ci.lon() * cj.lat() - cj.lon() * ci.lat());
|
||||||
|
|
||||||
area += f;
|
area += f;
|
||||||
cx += (v.at(i).lon() + v.at(j).lon()) * f;
|
cx += (ci.lon() + cj.lon()) * f;
|
||||||
cy += (v.at(i).lat() + v.at(j).lat()) * f;
|
cy += (ci.lat() + cj.lat()) * f;
|
||||||
}
|
}
|
||||||
|
|
||||||
double factor = 1.0 / (3.0 * area);
|
double factor = 1.0 / (3.0 * area);
|
||||||
@ -710,7 +711,7 @@ bool MapData::readPaths(const VectorTile *tile, int zoom, QList<Path> *list)
|
|||||||
p.point.coordinates = Coordinates(outline.first().lon() + MD(lon),
|
p.point.coordinates = Coordinates(outline.first().lon() + MD(lon),
|
||||||
outline.first().lat() + MD(lat));
|
outline.first().lat() + MD(lat));
|
||||||
else if (p.closed)
|
else if (p.closed)
|
||||||
p.point.coordinates = centroid(p.poly);
|
p.point.coordinates = centroid(outline);
|
||||||
|
|
||||||
list->append(p);
|
list->append(p);
|
||||||
}
|
}
|
||||||
@ -796,7 +797,7 @@ QDebug operator<<(QDebug dbg, const Mapsforge::MapData::Tag &tag)
|
|||||||
QDebug operator<<(QDebug dbg, const MapData::Path &path)
|
QDebug operator<<(QDebug dbg, const MapData::Path &path)
|
||||||
{
|
{
|
||||||
dbg.nospace() << "Path(" << path.poly.boundingRect() << ", "
|
dbg.nospace() << "Path(" << path.poly.boundingRect() << ", "
|
||||||
<< path.tags << ")";
|
<< path.point.tags << ")";
|
||||||
return dbg.space();
|
return dbg.space();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user