Merge "Issue #2896 Fix sat best res on weird projections" into omaha_14.2.1
Former-commit-id:a9811bdb2c
[formerlycef0438c35
] [formerly85f5821a6f
] [formerlya9811bdb2c
[formerlycef0438c35
] [formerly85f5821a6f
] [formerlyafbdf6962c
[formerly85f5821a6f
[formerly d463531d4cf3bce8862ce1c29b12e9a594d8c63b]]]] Former-commit-id:afbdf6962c
Former-commit-id:fd0a81a181
[formerly3411167042
] [formerly 2ac85b86fee6285f476e7194d549ae07555767d9 [formerly09f4bd9883
]] Former-commit-id: 0f271f5e259517b85add913a4d42f6b3fbb92885 [formerlybe9744c6f9
] Former-commit-id:39d73f1569
This commit is contained in:
commit
95a07d847e
1 changed files with 22 additions and 9 deletions
|
@ -62,12 +62,14 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 30, 2010 mschenke Initial creation
|
||||
* Oct 31, 2012 DR 15287 D. Friedman Fix overlap calculation
|
||||
* Nov 06, 2012 DR 15157 D. Friedman Allow configured inclusion percentage
|
||||
* Oct 10, 2013 2104 mschenke Fixed broken percentage calculation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jul 30, 2010 mschenke Initial creation
|
||||
* Oct 31, 2012 15287 D. Friedman Fix overlap calculation
|
||||
* Nov 06, 2012 15157 D. Friedman Allow configured inclusion percentage
|
||||
* Oct 10, 2013 2104 mschenke Fixed broken percentage calculation
|
||||
* Mar 11, 2014 2896 bsteffen Limit the number of divisions.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -322,11 +324,22 @@ public class SatBestResResourceData extends AbstractRequestableResourceData {
|
|||
double threshold = targetGeometry.getEnvelope().getSpan(0)
|
||||
/ targetGeometry.getGridRange().getSpan(0);
|
||||
|
||||
int xDiv = (int) (envWidth / 100);
|
||||
int yDiv = (int) (envHeight / 100);
|
||||
if (xDiv * yDiv > 1024 * 1024) {
|
||||
/* Don't wasste too much time/memory, preserve aspect ratio. */
|
||||
if (xDiv > yDiv) {
|
||||
yDiv = 1024 * yDiv / xDiv;
|
||||
xDiv = 1024;
|
||||
} else {
|
||||
xDiv = 1024 * xDiv / yDiv;
|
||||
yDiv = 1024;
|
||||
}
|
||||
}
|
||||
Geometry intersection = EnvelopeIntersection
|
||||
.createEnvelopeIntersection(gridGeometry.getEnvelope(),
|
||||
targetGeometry.getEnvelope(), threshold,
|
||||
(int) (envWidth / 100.0),
|
||||
(int) (envHeight / 100.0));
|
||||
targetGeometry.getEnvelope(), threshold, xDiv,
|
||||
yDiv);
|
||||
if (area == null) {
|
||||
area = intersection;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue