[postgis-devel] [gdal-dev] [WKTRaster] WKT Raster band to GDAL band

Jorge Arevalo jorgearevalo at gis4free.org
Tue Mar 9 00:21:04 PST 2010


On Mon, Mar 8, 2010 at 10:55 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca> wrote:
>>> >POLYGON ((3 1,3 2,2 2,2 3,1 3,1 6,2 6,2 7,3 7,3 8,5 8,5 6,3 6,3 3,4 3,5 3,5 1,3 1))
>>> >POLYGON ((3 3,3 6,6 6,6 3,3 3))
>>> >POLYGON ((5 1,5 3,6 3,6 6,5 6,5 8,6 8,6 7,7 7,7 6,8 6,8 3,7 3,7 2,6 2,6 1,5 1))
>>> >POLYGON ((0 0,0 9,9 9,9 0,0 0),(6 7,6 8,3 8,3 7,2 7,2 6,1 6,1 3,2 3,2 2,3 2,3 1,6 1,6 2,7 2,7 3,8
>>3,8
>>> >6,7 6,7 7,6 7))
>>> >
>>> >Something strange here? Am I doing things right?
>
> You know how to quickly display geometries? Do you? I use OpenJump.
>
I've used QGis. I'll try OpenJump. Thanks for advice.


>>> >3.- From a GDAL RasterBand, I can fetch the owning dataset handle (GDALGetBandDataset).I think it
>>> >could be useful to get the WKT Raster handle from a WKT RasterBand too... Am I right?
>>>
>>> rt_band_get_data()?
>>
>>No, I mean getting the raster that contains this band, from the band
>>struct itself, like
>>
>>GDALDatasetH GDALGetBandDataset(GDALRasterBandH hBand )
>>
>>from GDAL C API
>>
>>(or GDALRasterBand::GetDataset() from GDAL C++ API)
>
> If it would be useful to you, then it would probably be useful to us...
>

Ok, I'll propose it in the specs at wiki.


> By the way: I saw that your code does not handle the SRID. That means ST_AsPolygon(raster, integer) -> geomval set would have to get it itself from the raster. Maybe it would be more efficient to include it in the wktgeomval structure so ST_AsPolygon could use it directly in ST_GeometryFromText(text WKT, SRID) without having to query the raster again.
>

Yes. I might access the SRID from the rt_raster object that contains
the band. Mmmm... now I remember. About the GeoTransform, I thought in
using rt_raster_get_x_offset(), rt_raster_get_pixel_width(),
rt_raster_get_x_rotation(), rt_raster_get_y_offset(),
rt_raster_get_y_rotation(), rt_raster_get_pixel_height(), as you said,
instead of the default {0.0, 1.0, 0.0, 0.0, 0.0,1.0 }, but in the
method I only have the rt_band. These kind of things made me think
about getting the raster object from the band.


> Pierre
>
Thanks again,

Jorge



More information about the postgis-devel mailing list