forked from Framstag/libosmscout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue Framstag#1045 - Update projection
- Added simple Earth object to centralize some constants - Changed enum type of LaneTurn - Centralized gradtorad constant
- Loading branch information
1 parent
38b2f4c
commit 319b378
Showing
9 changed files
with
113 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef OSMSCOUT_PROJECTION_EARTH_H | ||
#define OSMSCOUT_PROJECTION_EARTH_H | ||
|
||
/* | ||
This source is part of the libosmscout library | ||
Copyright (C) 2023 Tim Teulings | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#include <osmscout/CoreImportExport.h> | ||
|
||
namespace osmscout { | ||
|
||
/** | ||
* Some general information regarding the earth | ||
* | ||
* To make the stack support other planets, too, one would have | ||
* to define a interface base class, from which Earth inherits and | ||
* implements the interface. | ||
*/ | ||
class OSMSCOUT_API Earth | ||
{ | ||
public: | ||
static const double radiusMeter; | ||
//< Radius of the earth in meter | ||
static const double extentMeter; | ||
//< Extent of the earth in meter | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,8 @@ | |
|
||
#include <cmath> | ||
|
||
namespace osmscout { | ||
static const double gradtorad=2*M_PI/360.0; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
This source is part of the libosmscout library | ||
Copyright (C) 2023 Tim Teulings | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#include <osmscout/projection/Earth.h> | ||
|
||
#include <osmscout/system/Math.h> | ||
|
||
namespace osmscout { | ||
|
||
/* | ||
* For the calculations here see: | ||
* http://en.wikipedia.org/wiki/Mercator_projection | ||
* http://en.wikipedia.org/wiki/Web_Mercator | ||
* http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames | ||
*/ | ||
|
||
//< Radius of the earth in meter | ||
const double Earth::radiusMeter=6'378'137.0; | ||
//< Extent of the earth in meter | ||
const double Earth::extentMeter=2*M_PI*Earth::radiusMeter; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters