[fdo-dev] Raster SetBounds()
Greg Boone
greg.boone at autodesk.com
Thu Oct 5 16:40:40 EDT 2006
FYI: I don't think any client, map or mapguide, is calling set bounds
-----Original Message-----
From: Frank Warmerdam (External)
Sent: Thursday, October 05, 2006 12:35 PM
To: dev at fdo.osgeo.org
Subject: Re: [fdo-dev] Raster SetBounds()
Traian Stanev wrote:
>
> Hi Frank,
>
> MapGuide shouldn't be expecting the extent of the FdoIRaster to match
> the queried extent. I looked at the sources again, and here is what
> MapGuide does:
>
> 1. Execute a Select query of a computed identifier which contains a
> RESAMPLE function, like this (StylizationUtil.cpp):
>
> //Set up RESAMPLE command
> FdoPtr<FdoExpressionCollection> funcParams =
> FdoExpressionCollection::Create();
> FdoPtr<FdoIdentifier> rasterProp =
> FdoIdentifier::Create(geom.c_str());
> funcParams->Add(rasterProp);
> FdoPtr<FdoDataValue> minX = FdoDataValue::Create(extent.minx,
> FdoDataType_Double);
> funcParams->Add(minX);
> FdoPtr<FdoDataValue> minY = FdoDataValue::Create(extent.miny,
> FdoDataType_Double);
> funcParams->Add(minY);
> FdoPtr<FdoDataValue> maxX = FdoDataValue::Create(extent.maxx,
> FdoDataType_Double);
> funcParams->Add(maxX);
> FdoPtr<FdoDataValue> maxY = FdoDataValue::Create(extent.maxy,
> FdoDataType_Double);
> funcParams->Add(maxY);
> FdoPtr<FdoDataValue> height = FdoDataValue::Create(devHeight);
> funcParams->Add(height);
> FdoPtr<FdoDataValue> width = FdoDataValue::Create(devWidth);
> funcParams->Add(width);
>
> FdoPtr<FdoFunction> clipFunc =
FdoFunction::Create(L"RESAMPLE",
> funcParams);
>
> STRING func = clipFunc->ToString();
> options->AddComputedProperty(L"clipped_raster", func);
>
>
> The RESAMPLE function is set up to request the full visible extent at
a
> certain window size. So far so good.
>
> 2. Later, when reading the FdoRaster, the RasterAdapter.cpp code in
> MapGuide does not actually expect the raster extent to equal the
visible
> extent. Here is what it does:
>
> //first get the map data extent
> RS_Bounds mapExt = renderer->GetBounds();
>
> //get the map extent of the image
> //TODO: need to transform to destination coordinate system
> RS_Bounds imgExt = raster->GetExtent();
>
> //intersect the image extent with the requested map extent
> RS_Bounds intExt = RS_Bounds::Intersect(mapExt, imgExt);
>
> //if raster bounds outside map extent, don't stylize
> if (intExt.IsValid())
> {
> .....
>
>
>
> As long as your RESAMPLE is implemented correctly, I don't see why
there
> would be a problem. Note that MapGuide reads the raster that comes out
> of the computed property (i.e. the resampled raster).
Traian,
OK, this gives me something to dig into.
Thanks!
--
---------------------------------------+--------------------------------
------
I set the clouds in motion - turn up | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo,
http://osgeo.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at fdo.osgeo.org
For additional commands, e-mail: dev-help at fdo.osgeo.org
More information about the Fdo-internals
mailing list