| 1 | == Gdal Grass == |
| 2 | |
| 3 | in these page i'll try to make annotation about the gdal grass code. |
| 4 | please add your note about it, suggestion, documentation to read or any thing youn think can help me to learn more about it. |
| 5 | i haven't a c++ base, i changed the time line to give more time to thise part of the project. |
| 6 | |
| 7 | as start point i had a discussion on Irc with Frank W. about the problems i had tring to load grass raster in ossim : |
| 8 | |
| 9 | {{{ |
| 10 | |
| 11 | [2009-04-10 16:46:08] <epifanio> hi FrankW |
| 12 | [2009-04-10 16:46:25] <epifanio> i've just a little question to you :-/ |
| 13 | [2009-04-10 16:46:40] <epifanio> maybe OT on qgis, so i used provate message |
| 14 | [2009-04-10 16:46:51] <FrankW> sure, fire away |
| 15 | [2009-04-10 16:47:08] <epifanio> i'm tring to learn more about the ossim_gdal_plugin |
| 16 | [2009-04-10 16:47:16] <epifanio> are you familiar with it ? |
| 17 | [2009-04-10 16:47:38] <epifanio> the problem you expose me the last time was related to the color table |
| 18 | [2009-04-10 16:47:40] <FrankW> I had done some work on it at one time. |
| 19 | [2009-04-10 16:47:55] <epifanio> the gdal plugin probably only recognizes 8 bit pseudo color data |
| 20 | [2009-04-10 16:48:12] <epifanio> but if gdal can read it try translating to 3 band tiff then planet could read it |
| 21 | [2009-04-10 16:48:59] <FrankW> Potentially the GDAL pct2rgb.py script could be used to convert to an RGB file. |
| 22 | [2009-04-10 16:49:13] <FrankW> But I'm not even positive that supports more than 8bit images! |
| 23 | [2009-04-10 16:49:32] <FrankW> Ultimately though I imagine bulk translation would not be the desired approach. |
| 24 | [2009-04-10 16:50:07] <epifanio> yes it is ... beacose it implies a data duplication |
| 25 | [2009-04-10 16:50:12] <epifanio> i think ... |
| 26 | [2009-04-10 16:50:29] <FrankW> You *want* data duplication? |
| 27 | [2009-04-10 16:50:35] <epifanio> no |
| 28 | [2009-04-10 16:50:47] <epifanio> i prefer to avoid data duplication |
| 29 | [2009-04-10 16:51:19] <FrankW> ah, that was what I expected. |
| 30 | [2009-04-10 16:51:34] <epifanio> beacouse my targhet is to read grass data directly |
| 31 | [2009-04-10 16:51:44] <FrankW> Understood. |
| 32 | [2009-04-10 16:51:59] <FrankW> The comment "yes it is" in reply to my suggesting bulk translation was not desirable confused me. |
| 33 | [2009-04-10 16:52:30] <epifanio> ahhh ... my poor english sorry :-( |
| 34 | [2009-04-10 16:52:37] <FrankW> It may be that the ossimGdalTileSource::loadIndexTo3BandTile method could be updated to support non-8bit data. |
| 35 | [2009-04-10 16:53:08] <FrankW> I'm looking at OSSIM code from mid-2006 I happen to have sitting around, but I agree that this code is 8bit oriented, but it seems like it could be correctedly reasonably easily. |
| 36 | [2009-04-10 16:53:18] <epifanio> do you have "under hand" the ossim_plugin_source code ? |
| 37 | [2009-04-10 16:53:23] <epifanio> ok |
| 38 | [2009-04-10 16:53:57] <FrankW> What happens when you load your non-8bit image by the way? A crash? An exception? A runtime error? Or just the wrong visual results? |
| 39 | [2009-04-10 16:54:10] <epifanio> no, it load the data |
| 40 | [2009-04-10 16:54:21] <epifanio> recognize the right projection too |
| 41 | [2009-04-10 16:54:31] <epifanio> but it iis sympli no "rendered" |
| 42 | [2009-04-10 16:54:58] <epifanio> i can have a black image or a "band series" |
| 43 | [2009-04-10 16:55:37] <epifanio> like the image is composed by different coloured strip |
| 44 | [2009-04-10 16:55:56] <epifanio> i can produce a scrrenshot |
| 45 | [2009-04-10 16:58:30] <epifanio> these is a screen in imagelinker for the elevation.10m from the spearfish dataset :http://www.geofemengineering.it/data/elevation.10m.png |
| 46 | [2009-04-10 17:00:24] <epifanio> while the slope : http://www.geofemengineering.it/data/slope.png is rendered |
| 47 | [2009-04-10 17:01:28] <epifanio> FrankW: these the link : http://www.geofemengineering.it/data/elevation.10m.png |
| 48 | [2009-04-10 17:01:32] <FrankW> I was able to look at the slope.png |
| 49 | [2009-04-10 17:01:48] <epifanio> can you see it ? |
| 50 | [2009-04-10 17:01:54] <epifanio> the elevation.10m |
| 51 | [2009-04-10 17:02:11] <FrankW> Based on the screen shot of the elevation (I see it now), I believe a 16 or 32bit buffer is just being directly intepreted as 8bit. |
| 52 | [2009-04-10 17:02:44] <FrankW> This reassures me that it may be easy to modify loadIndexTo3BandTile() to support non-eight bit imagery. |
| 53 | [2009-04-10 17:03:48] <epifanio> ohh :-) i haven't knowledge about cpp/c code, but if you pooint me on the right source ... i'l try to read and learn a bit from the source file |
| 54 | [2009-04-10 17:04:18] <epifanio> so i need to point my attention on : ossimGdalTileSource.cpp .h |
| 55 | [2009-04-10 17:04:26] <epifanio> ? |
| 56 | [2009-04-10 17:04:30] <FrankW> yes |
| 57 | [2009-04-10 17:05:12] <FrankW> http://trac.osgeo.org/ossim/browser/trunk/ossim_plugins/gdal/ossimGdalTileSource.cpp#L1516 |
| 58 | [2009-04-10 17:05:35] <FrankW> The core problem is that the result of getBuf() is cast to ossim_uint8* without regard to the true type of the buffer. |
| 59 | [2009-04-10 17:06:03] <FrankW> I believe the code needs to be modified to handle three cases - 8bit, 16bit and 32bit integers and to error out gracefully if it isn't one of those cases. |
| 60 | [2009-04-10 17:06:45] <FrankW> Down at line 1567 where the s[sample] value it fetched from the input buffer this would need to be altered to fetch it based on the type of the buffer. |
| 61 | [2009-04-10 17:07:23] <FrankW> The GDALGetColorEntryAsRGB() already supports non-eight bit palette entries so that aspect should not be a problem. |
| 62 | [2009-04-10 17:08:11] <epifanio> huhh i'm reading .. and follow you :-) |
| 63 | [2009-04-10 17:09:44] <epifanio> each word is for me a great hand, thanks |
| 64 | [2009-04-10 17:09:49] <epifanio> right now i haven't the nedeed knowledge to undstoand ... |
| 65 | [2009-04-10 17:10:01] <epifanio> but i can document all, reading more .. and try to send a relative mail/irc to the ossimpanet dev-team |
| 66 | [2009-04-10 17:10:28] <FrankW> sounds good - those guys should have no problem helping with the code changes. I'm glad to answer further questions too. |
| 67 | [2009-04-10 17:11:16] <epifanio> maybe that's what i can do actually, yes nhv gpots gived me a great help and like you ar so kind |
| 68 | [2009-04-10 17:11:49] <FrankW> Just now however I need to drive my daughter somewhere ... later! |
| 69 | [2009-04-10 17:11:59] <epifanio> i'll try to documnet all , done screenshot and the relative gdalinfo information |
| 70 | [2009-04-10 17:12:11] <epifanio> thanks !!! see you at the next time :-) |
| 71 | }}} |
| 72 | |
| 73 | |