Use error threshold for image sources reprojection

This commit is contained in:
Petr Sloup
2015-08-24 11:23:08 +02:00
parent fc23a38692
commit 615b54eb67
+9 -1
View File
@@ -37,12 +37,20 @@ ol.reproj.Image = function(sourceProj, targetProj,
var limitedTargetExtent = ol.extent.getIntersection( var limitedTargetExtent = ol.extent.getIntersection(
targetExtent, maxTargetExtent); targetExtent, maxTargetExtent);
var errorThresholdInPixels = ol.DEFAULT_RASTER_REPROJ_ERROR_THRESHOLD;
// in source units
var errorThreshold = targetResolution * errorThresholdInPixels *
targetProj.getMetersPerUnit() / sourceProj.getMetersPerUnit();
/** /**
* @private * @private
* @type {!ol.reproj.Triangulation} * @type {!ol.reproj.Triangulation}
*/ */
this.triangulation_ = new ol.reproj.Triangulation( this.triangulation_ = new ol.reproj.Triangulation(
sourceProj, targetProj, limitedTargetExtent, this.maxSourceExtent_, 0); sourceProj, targetProj, limitedTargetExtent, this.maxSourceExtent_,
errorThreshold);
/** /**
* @private * @private