-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathGeoRectangularProjection.cc
More file actions
648 lines (531 loc) · 20.9 KB
/
GeoRectangularProjection.cc
File metadata and controls
648 lines (531 loc) · 20.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
/*
* (C) Copyright 1996-2016 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation nor
* does it submit to any jurisdiction.
*/
/*! \file GeoRectangularProjection.cc
\brief Implementation of GeoRectangularProjection.
\author Meteorological Visualisation Section, ECMWF
Started: Thu Jan 10 17:24:36 2008
*/
#include "GeoRectangularProjection.h"
#include "Polyline.h"
#include "Text.h"
#include "GridPlotting.h"
#include "LabelPlotting.h"
#include "MagJSon.h"
#include "MatrixHandler.h"
#include "ParameterSettings.h"
#include "SceneVisitor.h"
#include "UserPoint.h"
using namespace magics;
/*!
\brief Constructor
*/
GeoRectangularProjection::GeoRectangularProjection() : projection_(0) {
init();
// Tiling information
originX_ = 0;
originY_ = 0;
tile_ = 256;
unit_ = 360.;
unitEpsilon_ = unit_ * 0.0001;
name_ = "cylindrical";
}
/*!
\brief Destructor
\todo do we need here a "delete projection_;" as in MercatorProjection::~MercatorProjection() ?
*/
GeoRectangularProjection::~GeoRectangularProjection() {}
void GeoRectangularProjection::print(ostream& o) const {
o << "GeoRectangularProjection[";
GeoRectangularProjectionAttributes::print(o);
o << "]";
}
PaperPoint GeoRectangularProjection::operator()(const UserPoint& point) const {
if (!projection_) {
return PaperPoint(point.x(), point.y(), point.value(), point.missing(), point.border(), 0, point.name());
}
TeCoord2D geo = TeCoord2D(point.x() * TeCDR, point.y() * TeCDR);
TeCoord2D xy = projection_->LL2PC(geo);
return PaperPoint(xy.x(), xy.y(), point.value(), point.missing(), point.border(), 0, point.name());
}
PaperPoint GeoRectangularProjection::operator()(const PaperPoint& point) const {
MagLog::dev() << "GeoRectangularProjection::operator()(...) needs implementing." << endl;
return Transformation::operator()(point);
}
void GeoRectangularProjection::revert(const PaperPoint& xy, UserPoint& point) const {
if (!projection_) {
point = UserPoint(xy.x(), xy.y());
return;
}
TeCoord2D texy = TeCoord2D(xy.x(), xy.y());
TeCoord2D geo = projection_->PC2LL(texy);
point = UserPoint(geo.x() * TeCRD, geo.y() * TeCRD);
}
void GeoRectangularProjection::revert(const vector<std::pair<double, double> >& input,
vector<std::pair<double, double> >& output) const {
output.reserve(input.size());
const vector<std::pair<double, double> >::const_iterator in_end = input.end();
if (!projection_) {
for (vector<std::pair<double, double> >::const_iterator pt = input.begin(); pt != in_end; ++pt) {
output.push_back(*pt);
}
return;
}
ASSERT(projection_);
for (vector<std::pair<double, double> >::const_iterator pt = input.begin(); pt != in_end; ++pt) {
TeCoord2D texy = TeCoord2D(pt->first, pt->second);
TeCoord2D geo = projection_->PC2LL(texy);
output.push_back(make_pair(geo.x() * TeCRD, geo.y() * TeCRD));
}
}
bool GeoRectangularProjection::needShiftedCoastlines() const {
return true;
}
void GeoRectangularProjection::boundingBox(double& xmin, double& ymin, double& xmax, double& ymax) const {
xmin = std::min(min_longitude_, max_longitude_);
xmax = std::max(min_longitude_, max_longitude_);
ymin = std::min(min_latitude_, max_latitude_);
ymax = std::max(min_latitude_, max_latitude_);
const double tol = 1.;
xmin = xmin - tol;
xmax = xmax + tol;
ymin = (ymin < (-90 + tol)) ? -90. : ymin - tol;
ymax = (ymax > (90 - tol)) ? 90. : ymax + tol;
}
void GeoRectangularProjection::smallestBoundingBox(double& xmin, double& ymin, double& xmax, double& ymax) const {
xmin = std::min(min_longitude_, max_longitude_);
xmax = std::max(min_longitude_, max_longitude_);
ymin = std::min(min_latitude_, max_latitude_);
ymax = std::max(min_latitude_, max_latitude_);
}
bool GeoRectangularProjection::verifyDef(const string& def) const {
return (def == "EPSG:4326" || def == "CRS:84");
}
void GeoRectangularProjection::aspectRatio(double& w, double& h) {
init();
Transformation::aspectRatio(w, h);
}
double GeoRectangularProjection::getMinX() const {
return min_longitude_;
}
double GeoRectangularProjection::getMinY() const {
return min_latitude_;
}
double GeoRectangularProjection::getMaxX() const {
return max_longitude_;
}
double GeoRectangularProjection::getMaxY() const {
return max_latitude_;
}
void GeoRectangularProjection::setMinX(double xx) {
min_longitude_ = xx;
}
void GeoRectangularProjection::setMinY(double yy) {
min_latitude_ = yy;
}
void GeoRectangularProjection::setMaxX(double xx) {
max_longitude_ = xx;
}
void GeoRectangularProjection::setMaxY(double yy) {
max_latitude_ = yy;
}
double GeoRectangularProjection::getMinPCX() const {
return xpcmin_;
}
double GeoRectangularProjection::getMinPCY() const {
return ypcmin_;
}
double GeoRectangularProjection::getMaxPCX() const {
return xpcmax_;
}
double GeoRectangularProjection::getMaxPCY() const {
return ypcmax_;
}
double GeoRectangularProjection::getExtendedMinPCX() const {
return xpcmin_ - xgutter_;
}
double GeoRectangularProjection::getExtendedMinPCY() const {
return ypcmin_- ygutter_;
}
double GeoRectangularProjection::getExtendedMaxPCX() const {
return xpcmax_ + xgutter_;
}
double GeoRectangularProjection::getExtendedMaxPCY() const {
return ypcmax_ + ygutter_;
}
void GeoRectangularProjection::gridLongitudes(const GridPlotting& grid) const {
const vector<double>& longitudes = grid.longitudes();
const double min = std::max(min_latitude_, -90.);
const double max = std::min(max_latitude_, 90.);
const double step = (max - min) / 20;
const vector<double>::const_iterator lon_end = longitudes.end();
for (vector<double>::const_iterator lon = longitudes.begin(); lon != lon_end; ++lon) {
magics::Polyline poly;
poly.setAntiAliasing(false);
for (double lat = min; lat <= max + step; lat += step) {
(lat > max) ? poly.push_back((*this)(UserPoint(*lon, max))) : poly.push_back((*this)(UserPoint(*lon, lat)));
}
grid.add(poly);
}
}
void GeoRectangularProjection::gridLatitudes(const GridPlotting& grid) const {
const vector<double>& latitudes = grid.latitudes();
const double step = (max_longitude_ - min_longitude_) / 20;
const vector<double>::const_iterator lat_end = latitudes.end();
for (vector<double>::const_iterator lat = latitudes.begin(); lat != lat_end; ++lat) {
if (*lat < -90)
continue;
if (*lat > 90)
continue;
magics::Polyline poly;
poly.setAntiAliasing(false);
for (double lon = getMinX(); lon < getMaxX(); lon += step) {
poly.push_back((*this)(UserPoint(lon, *lat)));
}
// add the last one!
poly.push_back((*this)(UserPoint(getMaxX(), *lat)));
grid.add(poly);
}
}
/*!
\brief generates text to mark longitudes at the top
\sa Text
*/
void GeoRectangularProjection::labels(const LabelPlotting& label, TopAxisVisitor&) const {
Text* text;
const double cy = min_latitude_ + (max_latitude_ - min_latitude_) * .2;
const vector<double>& longitudes = label.longitudes();
const vector<double>::const_iterator lon_end = longitudes.end();
for (vector<double>::const_iterator lon = longitudes.begin(); lon != lon_end; ++lon) {
if (*lon > min_longitude_ && *lon < max_longitude_) {
UserPoint point(*lon, cy);
text = new Text();
label.add(text);
text->setText(writeLongitude(point));
text->setJustification(Justification::CENTRE);
text->setVerticalAlign(VerticalAlign::BOTTOM);
text->push_back((*this)(point));
}
}
}
/*!
\brief generates text to mark longitudes at the bottom
\sa Text
*/
void GeoRectangularProjection::labels(const LabelPlotting& label, BottomAxisVisitor&) const {
Text* text;
const double cy = min_latitude_ + (max_latitude_ - min_latitude_) * .8;
const vector<double>& longitudes = label.longitudes();
const vector<double>::const_iterator lon_end = longitudes.end();
for (vector<double>::const_iterator lon = longitudes.begin(); lon != lon_end; ++lon) {
if (*lon > min_longitude_ && *lon < max_longitude_) {
UserPoint point(*lon, cy);
text = new Text();
label.add(text);
text->setText(writeLongitude(point));
text->setJustification(Justification::CENTRE);
text->setVerticalAlign(VerticalAlign::TOP);
text->push_back((*this)(point));
}
}
}
/*!
\brief generates text to mark latitudes at the left
\sa Text
*/
void GeoRectangularProjection::labels(const LabelPlotting& label, LeftAxisVisitor&) const {
Text* text;
const vector<double>& latitudes = label.latitudes();
const vector<double>::const_iterator lat_end = latitudes.end();
const double lon = max_longitude_ - ((max_longitude_ - min_longitude_) * .1);
for (vector<double>::const_iterator lat = latitudes.begin(); lat != lat_end; ++lat) {
if (*lat > min_latitude_ && *lat < max_latitude_) {
UserPoint point(lon, *lat);
text = new Text();
label.add(text);
text->setText(writeLatitude(point));
text->setJustification(Justification::RIGHT);
text->setVerticalAlign(VerticalAlign::HALF);
text->push_back((*this)(point));
}
}
}
void GeoRectangularProjection::labels(const LabelPlotting&, DrawingVisitor&) const {}
/*!
\brief generates text to mark latitudes at the right
\sa Text
*/
void GeoRectangularProjection::labels(const LabelPlotting& label, RightAxisVisitor&) const {
Text* text;
const vector<double>& latitudes = label.latitudes();
const vector<double>::const_iterator lat_end = latitudes.end();
for (vector<double>::const_iterator lat = latitudes.begin(); lat != lat_end; ++lat) {
if (*lat > min_latitude_ && *lat < max_latitude_) {
const double lon = min_longitude_ + ((max_longitude_ - min_longitude_) * .1);
UserPoint point(lon, *lat);
text = new Text();
label.add(text);
text->setText(writeLatitude(point));
text->setJustification(Justification::LEFT);
text->setVerticalAlign(VerticalAlign::HALF);
text->push_back((*this)(point));
}
}
}
double GeoRectangularProjection::patchDistance(double res) const {
return res;
}
void GeoRectangularProjection::init() {
// make sure min < max!
// reset any previous setting
userEnveloppe_->clear();
PCEnveloppe_->clear();
while (min_longitude_ > max_longitude_) {
max_longitude_ += 360;
MagLog::warning() << "lower_left_longitude > upper_right_longitude --> upper_right_longitude is change to "
<< max_longitude_ << endl;
}
if (min_latitude_ > max_latitude_) {
MagLog::warning() << "lower_left_latitude > upper_right_latitude --> swap" << endl;
std::swap(min_latitude_, max_latitude_);
}
if (max_longitude_ - min_longitude_ < min_area_) {
max_longitude_ = min_longitude_ + min_area_;
MagLog::warning() << "The geographical area has been extented to respect the minimal dimension" << endl;
}
if (max_latitude_ - min_latitude_ < min_area_) {
max_latitude_ = min_latitude_ + min_area_;
MagLog::warning() << "The geographical area has been extented to respect the minimal dimension" << endl;
}
if (max_longitude_ - min_longitude_ > 1080)
max_longitude_ = min_longitude_ + 1080;
// Now we try to get the min longitudes in the the ranges -360/+720
while (min_longitude_ < -360) {
min_longitude_ += 360;
max_longitude_ += 360;
}
while (max_longitude_ > 720) {
min_longitude_ -= 360;
max_longitude_ -= 360;
}
// if ( min_latitude_ < -90) min_latitude_ = -90.;
// if ( max_latitude_ > 90 ) max_latitude_ = 90;
xpcmin_ = min_longitude_;
ypcmin_ = min_latitude_;
xpcmax_ = max_longitude_;
ypcmax_ = max_latitude_;
xgutter_ = ((xpcmax_ - xpcmin_ ) * gutter_)/100;
ygutter_ = ((ypcmax_ - ypcmin_ ) * gutter_)/100;
userEnveloppe_->push_back(PaperPoint(min_longitude_, min_latitude_));
userEnveloppe_->push_back(PaperPoint(min_longitude_, max_latitude_));
userEnveloppe_->push_back(PaperPoint(max_longitude_, max_latitude_));
userEnveloppe_->push_back(PaperPoint(max_longitude_, min_latitude_));
userEnveloppe_->push_back(PaperPoint(min_longitude_, min_latitude_));
PCEnveloppe_->push_back(PaperPoint(min_longitude_, min_latitude_));
PCEnveloppe_->push_back(PaperPoint(min_longitude_, max_latitude_));
PCEnveloppe_->push_back(PaperPoint(max_longitude_, max_latitude_));
PCEnveloppe_->push_back(PaperPoint(max_longitude_, min_latitude_));
PCEnveloppe_->push_back(PaperPoint(min_longitude_, min_latitude_));
askedxmin_ = std::min(xpcmin_, xpcmax_);
askedxmax_ = std::max(xpcmin_, xpcmax_);
askedymin_ = std::min(ypcmin_, ypcmax_);
askedymax_ = std::max(ypcmin_, ypcmax_);
}
MercatorProjection::MercatorProjection() {}
MercatorProjection::~MercatorProjection() {
delete projection_;
}
void MercatorProjection::print(ostream& o) const {
o << " mercator[";
GeoRectangularProjection::print(o);
o << "]";
}
void MercatorProjection::init() {
if (!projection_)
projection_ = new TeMercator(TeDatum(), 0);
// make sure min < max!
if (min_longitude_ > max_longitude_) {
MagLog::warning() << "lower_left_lon > upper_right_lon --> swap" << endl;
std::swap(min_longitude_, max_longitude_);
}
if (min_latitude_ > max_latitude_) {
MagLog::warning() << "lower_left_lat > upper_right_lat --> swap" << endl;
std::swap(min_latitude_, max_latitude_);
}
const double t = 2;
min_latitude_ = std::max(min_latitude_, -89.);
max_latitude_ = std::min(max_latitude_, 89.);
min_longitude_ = std::max(min_longitude_, -180.);
max_longitude_ = std::min(max_longitude_, 720.);
if (max_longitude_ - min_longitude_ < t)
max_longitude_ = min_longitude_ + t;
if (max_latitude_ - min_latitude_ < t)
max_latitude_ = min_latitude_ + t;
UserPoint ll(min_longitude_, min_latitude_);
UserPoint ur(max_longitude_, max_latitude_);
PaperPoint xy;
xy = (*this)(ll);
xpcmin_ = xy.x();
ypcmin_ = xy.y();
xy = (*this)(ur);
xpcmax_ = xy.x();
ypcmax_ = xy.y();
userEnveloppe_->clear();
PCEnveloppe_->clear();
askedxmin_ = std::min(xpcmin_, xpcmax_);
askedxmax_ = std::max(xpcmin_, xpcmax_);
askedymin_ = std::min(ypcmin_, ypcmax_);
askedymax_ = std::max(ypcmin_, ypcmax_);
}
bool MercatorProjection::fast_reproject(double& x, double& y) const {
TeCoord2D geo = TeCoord2D(x * TeCDR, y * TeCDR);
TeCoord2D xy = projection_->LL2PC(geo);
x = xy.x();
y = xy.y();
return true;
}
void GeoRectangularProjection::setNewPCBox(double minx, double miny, double maxx, double maxy) {
PaperPoint p1(minx, miny);
PaperPoint p2(maxx, maxy);
UserPoint ll, ur;
revert(p1, ll);
revert(p2, ur);
min_longitude_ = ll.x();
max_longitude_ = ur.x();
min_latitude_ = ll.y();
max_latitude_ = ur.y();
}
/*!
\brief Set the resolution of Coastlines
*/
void GeoRectangularProjection::coastSetting(map<string, string>& setting, double abswidth, double absheight) const {
// work out the ratios of geographical to paper lengths
const double xratio = (max_longitude_ - min_longitude_) / abswidth;
const double yratio = (max_latitude_ - min_latitude_) / absheight;
// choose the smallest (smaller ratio means more detail required)
const double ratio = min(xratio, yratio);
std::string resol = "110m";
if (ratio < 0.8) // highest resolution
{
resol = "10m";
}
else if (ratio < 3.5) // medium resolution
{
resol = "50m";
}
setting["resolution"] = resol;
setting["land"] = resol + "/ne_" + resol + "_land";
setting["ocean"] = resol + "/ne_" + resol + "_ocean";
setting["coast"] = resol + "/ne_" + resol + "_coastline";
setting["rivers"] = resol + "/ne_" + resol + "_rivers_lake_centerlines";
setting["boundaries"] = resol + "/ne_" + resol + "_admin_0_boundary_lines_land";
//! \note Administraive borders hardcoded to 10m resolution (low res version do not contain all info)
setting["administrative_boundaries"] = "10m/ne_10m_admin_1_states_provinces_lines";
MagLog::dev() << "GeoRectangularProjection::coastSetting[" << abswidth << ", " << absheight << "]->" << ratio
<< " resol: " << resol << endl;
}
MatrixHandler* GeoRectangularProjection::prepareData(const AbstractMatrix& matrix) const {
// return new MatrixHandler(matrix);
return new GeoBoxMatrixHandler(matrix, *this);
}
void GeoRectangularProjection::populate(double lon, double lat, double value, vector<UserPoint>& out) const {
while (lon < min_longitude_)
lon += 360;
while (lon > min_longitude_ + 360.)
lon -= 360.;
if (!in(lon, lat))
return;
out.push_back(UserPoint(lon, lat, value));
double normlon = lon;
lon += 360.;
while (lon > min_longitude_ && lon < max_longitude_) {
out.push_back(UserPoint(lon, lat, value));
lon += 360;
}
// To the West
lon = normlon;
lon -= 360.;
while (lon > min_longitude_ && lon < max_longitude_) {
out.push_back(UserPoint(lon, lat, value));
lon -= 360;
}
}
void GeoRectangularProjection::wraparound(const UserPoint& origin, stack<UserPoint>& out) const {
UserPoint point = origin;
if (point.y_ > max_latitude_ || point.y_ < min_latitude_)
return;
while (point.x_ < min_longitude_)
point.x_ += 360;
while (point.x_ > min_longitude_ + 360.)
point.x_ -= 360.;
if (point.x_ < min_longitude_ || point.x_ > max_longitude_) {
return;
}
out.push(point);
double lon = point.x_;
// To the East
point.x_ = lon + 360.;
while (point.x_ > min_longitude_ && point.x_ < max_longitude_) {
out.push(point);
point.x_ += 360;
}
// To the West
point.x_ = lon - 360.;
while (point.x_ > min_longitude_ && point.x_ < max_longitude_) {
out.push(point);
point.x_ -= 360;
}
}
magics::Polyline& GeoRectangularProjection::getPCBoundingBox() const {
if (PCEnveloppe_->empty()) {
PCEnveloppe_->push_back(PaperPoint(xpcmin_, ypcmin_));
PCEnveloppe_->push_back(PaperPoint(xpcmin_, ypcmax_));
PCEnveloppe_->push_back(PaperPoint(xpcmax_, ypcmax_));
PCEnveloppe_->push_back(PaperPoint(xpcmax_, ypcmin_));
PCEnveloppe_->push_back(PaperPoint(xpcmin_, ypcmin_));
}
return *PCEnveloppe_;
}
magics::Polyline& GeoRectangularProjection::getUserBoundingBox() const {
if (userEnveloppe_->empty()) {
userEnveloppe_->push_back(PaperPoint(min_longitude_, min_latitude_));
userEnveloppe_->push_back(PaperPoint(min_longitude_, max_latitude_));
userEnveloppe_->push_back(PaperPoint(max_longitude_, max_latitude_));
userEnveloppe_->push_back(PaperPoint(max_longitude_, min_latitude_));
userEnveloppe_->push_back(PaperPoint(min_longitude_, min_latitude_));
}
return *userEnveloppe_;
}
void GeoRectangularProjection::getNewDefinition(const UserPoint& ll, const UserPoint& ur, string& out) const {
map<string, string> def;
def["subpage_map_projection"] = "cylindrical";
def["subpage_map_area_definition"] = "corners";
def["subpage_lower_left_longitude"] = tostring(ll.x_);
def["subpage_lower_left_latitude"] = tostring(ll.y_);
def["subpage_upper_right_longitude"] = tostring(ur.x_);
def["subpage_upper_right_latitude"] = tostring(ur.y_);
::toxml(out, def);
out = "{" + out + "}";
}
void GeoRectangularProjection::setDefinition(const string& json) {
if (json.empty())
return;
MagJSon helper;
helper.interpret(json);
XmlNode node = **helper.tree_.begin();
node.name("cylindrical");
set(node);
}
double MercatorProjection::patchDistance(double) const {
return 1000000;
}
double GeoRectangularProjection::ratio() const {
// return domain/fulldomain!
return ((max_longitude_ - min_longitude_) * (max_latitude_ - min_latitude_)) / (360 * 180);
}