Correctly reproject projections with undefined units

This commit is contained in:
Petr Sloup
2015-08-25 17:35:07 +02:00
parent aad5f94556
commit 14e20e23a0
3 changed files with 27 additions and 32 deletions
+4 -9
View File
@@ -36,20 +36,19 @@ ol.reproj.Image = function(sourceProj, targetProj,
var limitedTargetExtent = ol.extent.getIntersection(
targetExtent, maxTargetExtent);
var targetCenter = ol.extent.getCenter(limitedTargetExtent);
var sourceResolution = ol.reproj.calculateSourceResolution(
sourceProj, targetProj, targetCenter, targetResolution);
var errorThresholdInPixels = ol.DEFAULT_RASTER_REPROJ_ERROR_THRESHOLD;
// in source units
var errorThreshold = targetResolution * errorThresholdInPixels *
targetProj.getMetersPerUnit() / sourceProj.getMetersPerUnit();
/**
* @private
* @type {!ol.reproj.Triangulation}
*/
this.triangulation_ = new ol.reproj.Triangulation(
sourceProj, targetProj, limitedTargetExtent, this.maxSourceExtent_,
errorThreshold);
sourceResolution * errorThresholdInPixels);
/**
* @private
@@ -65,10 +64,6 @@ ol.reproj.Image = function(sourceProj, targetProj,
var srcExtent = this.triangulation_.calculateSourceExtent();
var targetCenter = ol.extent.getCenter(targetExtent);
var sourceResolution = ol.reproj.calculateSourceResolution(
sourceProj, targetProj, targetCenter, targetResolution);
/**
* @private
* @type {ol.ImageBase}