Skip to content
Permalink
Browse files

WCS extent and save as fix

  • Loading branch information
blazek committed Sep 12, 2012
1 parent e8061c7 commit 3cb46692b5885c6789be3a9c63c1581c1f846f89
@@ -251,10 +251,10 @@ void QgsRasterLayerSaveAsDialog::setOutputExtent( const QgsRectangle& r, const Q
extent = ct.transformBoundingBox( r );
}

mXMinLineEdit->setText( QString::number( extent.xMinimum() ) );
mXMaxLineEdit->setText( QString::number( extent.xMaximum() ) );
mYMinLineEdit->setText( QString::number( extent.yMinimum() ) );
mYMaxLineEdit->setText( QString::number( extent.yMaximum() ) );
mXMinLineEdit->setText( QgsRasterInterface::printValue( extent.xMinimum() ) );
mXMaxLineEdit->setText( QgsRasterInterface::printValue( extent.xMaximum() ) );
mYMinLineEdit->setText( QgsRasterInterface::printValue( extent.yMinimum() ) );
mYMaxLineEdit->setText( QgsRasterInterface::printValue( extent.yMaximum() ) );

mExtentState = state;
extentChanged();
@@ -762,6 +762,7 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom10( QByteArray const &xml, QgsW
QList<int> high = parseInts( domElementText( gridElement, "limits.GridEnvelope.high" ) );
if ( low.size() == 2 && high.size() == 2 )
{
// low/high are indexes in grid -> size is hight - low + 1
double width = high[0] - low[0] + 1;
double height = high[1] - low[1] + 1;
if ( width > 0 && height > 0 )
@@ -171,11 +171,14 @@ QgsWcsProvider::QgsWcsProvider( QString const &uri )
// in that case we continue without CRS and user is asked for it
//if ( mCoverageCrs.isEmpty() ) return;

// Native size
mWidth = mCoverageSummary.width;
mHeight = mCoverageSummary.height;
mHasSize = mCoverageSummary.hasSize;

QgsDebugMsg( QString( "mWidth = %1 mHeight = %2" ).arg( mWidth ).arg( mHeight ) ) ;
QgsDebugMsg( QString( "mWidth = %1 mHeight = %2" ).arg( mWidth ).arg( mHeight ) );

// TODO: Consider if/how to recalculate mWidth, mHeight if non native CRS is used

if ( !calculateExtent() )
{
@@ -1288,7 +1291,8 @@ bool QgsWcsProvider::calculateExtent()
// Prefer to use extent from capabilities / coverage description because
// transformation from WGS84 increases the extent
mCoverageExtent = mCoverageSummary.boundingBoxes.value( mCoverageCrs );
if ( !mCoverageExtent.isEmpty() && !mCoverageExtent.isFinite() )
QgsDebugMsg( "mCoverageCrs = " + mCoverageCrs + " mCoverageExtent = " + mCoverageExtent.toString() );
if ( !mCoverageExtent.isEmpty() && mCoverageExtent.isFinite() )
{
QgsDebugMsg( "mCoverageExtent = " + mCoverageExtent.toString() );
return true;
@@ -1308,9 +1312,11 @@ bool QgsWcsProvider::calculateExtent()
//QgsDebugMsg( "qgisSrsDest: " + qgisSrsDest.toWkt() );

mCoordinateTransform = new QgsCoordinateTransform( qgisSrsSource, qgisSrsDest );

}

QgsDebugMsg( "mCoverageSummary.wgs84BoundingBox= " + mCoverageSummary.wgs84BoundingBox.toString() );

// Convert to the user's CRS as required
try
{

0 comments on commit 3cb4669

Please sign in to comment.
You can’t perform that action at this time.