In matlab there are several funtions for graphics like plot(x,y) and plot3d(x,y,z). Are there funtions to plot 3d lake surfices and maps? or someones can help me to make that funtion .
thank you very much.
In matlab there are several funtions for graphics like plot(x,y) and plot3d(x,y,z). Are there funtions to plot 3d lake surfices and maps? or someones can help me to make that funtion .
thank you very much.
Colombo C. Da Encarnaçao Q.
Colx007 (14th November 2007)
Hi,
I need to display raster maps in my application, i am using Qt 4.2.2.
Can you suggest how this can be done?
Looking forward to your response
Qwt can display raster data as spectrogram and/or as contour lines.
See its screenshots.
Uwe
Hi,
I am a newbie to Qt.
I have the following requirements,
1. Support multiple layers
2. Display raster data in one layer (dted elevation data files)
3. ability to control the opacity of layers.
I have downloaded and installed Qwt.
Can you help me out, in adding layers and to get the raster data displayed in one layer.
Looking forward to your response![]()
With Qwt you would use a QwtPlotSpectrogram object for each type of raster data.
Use the z value to control the layer stack and hide/show the spectrogram items according to your layer control.1. Support multiple layers
You need to connect your data to QwtPlotSpectrogram using a QwtRasterData object.2. Display raster data in one layer (dted elevation data files)
spectrogram->setAlpha(alpha); // [ 0-255]3. ability to control the opacity of layers.
Uwe
How do i open the DTED file(which is a grid of elevation values) with QwtRasterData class?
Does QwtRasterData class use GDAL libraries to open raster maps?
Sorry for having used two different threads for same topic....
Can you share a sample code which would do the display of a sample elevation data?
I have opened the file using GDAL using the snippet of code given below,
The data is finally stored in the variable "eledata"
{GDALAllRegister();
/*---------------------------------------
* Open Dataset and get raster band (assuming it is band #1)
*/
poDataset = (GDALDataset *) GDALOpen( pszFilename, GA_ReadOnly );
if( poDataset == NULL )
{
printf( "Couldn't open dataset %s\n",
pszFilename );
}
GDALRasterBand *poBand;
poBand = poDataset->GetRasterBand( 1 );
poDataset->GetGeoTransform( adfGeoTransform );
/* -------------------------------------
* Get variables from input dataset
*/
const double nsres = adfGeoTransform[5];
const double ewres = adfGeoTransform[1];
const float nullValue = (float) poBand->GetNoDataValue( );
const int nXSize = poBand->GetXSize();
const int nYSize = poBand->GetYSize();
int flag = 0;
shadeBuf = (float *) CPLMalloc(sizeof(float)*nXSize);
eledata = (float *) CPLMalloc(sizeof(float)*nXSize*nYSize);
xcor = adfGeoTransform[0];
ycor = adfGeoTransform[3];
printf("the initial x : %f\n, the initial y : %f\n", xcor, ycor);
printf("North South Pixel resolution : %d\nEast West Pixel resolution : %d\n", nXSize, nYSize);
printf("Number of bands in raster :%d\n",poDataset->GetRasterCount());
poBand->RasterIO( GF_Read, 0, 0, nXSize, nYSize,
eledata, nXSize, nYSize, GDT_Float32,
0, 0 );
}
How do i proceed to display this data using QwtRasterData class?
The elevation values ranges from -9000 to 10000 meters and i need to display these as gray scale values or provide suitable RGB mapping for the same.
Looking forward to your response![]()
I already told you the 4 methods you need to implement.How do i proceed to display this data using QwtRasterData class?
Then YourElevationData::range() should return [-9000, 10000]. Next have a look at QwtColorMap and friends.The elevation values ranges from -9000 to 10000 meters and i need to display these as gray scale values or provide suitable RGB mapping for the same.
What about looking at the docs ?
Uwe
Thanks for the info![]()
Bookmarks