I am not entirely sure about what you re trying to do udig-wise,
however you need to be aware of the fact that  udig 1.1.1 uses a very
old version of geotools hence it is quite hard to give some meaningful
help, at least that's the situation for me.

In principle you should be able to extract the native information form
the coverage returned from the reader, but my experience is related
only to uDig trunk (1.2.X) therefore things might not apply to 1.1.1.


Simone.

-------------------------------------------------------
Ing. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041  Camaiore (LU)
Italy

phone: +39 0584983027
fax:      +39 0584983027
mob:    +39 333 8128928


http://www.geo-solutions.it
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini

-------------------------------------------------------



On Fri, Feb 20, 2009 at 12:27 PM, Pasquale Paola <[email protected]> wrote:
> Ciao,
> The problem is descibed below, in the first mail, but I have bypassed the
> problem reading the image on filesystem, perhaps udig applies a conversion
> (perhaps bit shifting) to render the image: so if I read the rendered image,
> I obtain different(no-sense) values.
>
> Cheers
> Pasquale Paola
>
>
> -----Messaggio originale-----
> Da: [email protected] [mailto:[email protected]] Per conto di Simone
> Giannecchini
> Inviato: venerdì 20 febbraio 2009 12.06
> A: Pasquale Paola
> Cc: [email protected]
> Oggetto: Re: [Geotools-devel] How can I set sample data_type in a geotiff?
>
> Ciao Pasquale,
> I just run across this email, can you please summarise your problem (nabble
> is under mantainence right now) so that I can try to see if we can help you
> out.
>
>
> Simone.
> -------------------------------------------------------
> Ing. Simone Giannecchini
> GeoSolutions S.A.S.
> Owner - Software Engineer
> Via Carignoni 51
> 55041  Camaiore (LU)
> Italy
>
> phone: +39 0584983027
> fax:      +39 0584983027
> mob:    +39 333 8128928
>
>
> http://www.geo-solutions.it
> http://simboss.blogspot.com/
> http://www.linkedin.com/in/simonegiannecchini
>
> -------------------------------------------------------
>
>
>
> On Wed, Feb 11, 2009 at 11:37 AM, Pasquale Paola <[email protected]>
> wrote:
>>
>> Do you know how can i set the data_type in a geotiff? Please read the
>> following messages, or this thread to know my problems.
>> http://www.nabble.com/Udig-1.1.1-problems-to-read-sample-value-in-geot
>> iff-16-bit-to21934226.html#a21934226
>> http://www.nabble.com/Udig-1.1.1-problems-to-read-sample-value-in-geot
>> iff-16-bit-to21934226.html#a21934226
>>
>> Cheers
>> Pa
>>
>> -----Messaggio originale-----
>> Da: Jesse Eichar [mailto:[email protected]]
>> Inviato: mercoledì 11 febbraio 2009 9.04
>> A: [email protected]; User-friendly Desktop Internet GIS
>> Oggetto: Re: R: R: [udig-devel] Udig 1.1.1 problems to read sample
>> value in geotiff 16 bit
>>
>> Hi I think you want to take this into the Geotools-users list uDig is
>> mainly a front end on geotools.  In this case i don't know that we
>> have the expertise you require.
>>
>> Jesse
>>
>> On 10-Feb-09, at 4:42 PM, Pasquale Paola wrote:
>>
>>> Do you know how can i set the data_type in a geotiff?
>>>
>>>
>>> Ciao
>>> Pa
>>>
>>> -----Messaggio originale-----
>>> Da: [email protected]
>>> [mailto:[email protected]] Per conto di andrea
>>> antonello
>>> Inviato: martedì 10 febbraio 2009 15.53
>>> A: User-friendly Desktop Internet GIS
>>> Oggetto: Re: R: [udig-devel] Udig 1.1.1 problems to read sample value
>>> in geotiff 16 bit
>>>
>>> Hi Pasquale,
>>> I don't have lots of time right now, but very quickly:
>>>
>>> - in your getSample method did you check if the called method enters
>>> the right type?
>>> - did you check whether the geoRes you get as Gridcoverage2d is of
>>> type rendered (for visualization) or geophisical view? I assume you
>>> will need the geophisical one.
>>>
>>> Does this help you a bit further?
>>>
>>> Ciao
>>> Andrea
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Feb 10, 2009 at 3:42 PM, Pasquale Paola
>>> <[email protected]>
>>> wrote:
>>>> This is my core code:
>>>>                               ILayer layer = geoOpt.getLayer();
>>>>                               GridCoverage2D geoRes = null;
>>>>                               /*
>>>>                                * List<IGeoResource> bobobo =
>>>> layer.getGeoResources(); for
>>>>                                * (IGeoResource item : bobobo) {
>>>> GridCoverage geo =
>>>>                                * item.resolve(GridCoverage.class,
>>>> new NullProgressMonitor());
>>>>                                * geoRes = (GridCoverage2D) geo;
>>>> item.getInfo(new
>>>>                                * NullProgressMonitor());
>>>>                                *
>>>>                                * if (geoRes != null) break; }
>>>>                                */
>>>>
>>>>                               geoRes = (GridCoverage2D)
>>>> layer.getGeoResource().resolve(
>>>>                                               GridCoverage.class,
>>>> new NullProgressMonitor());
>>>>
>>>>                               Raster raster =
>>>> geoRes.getRenderedImage().getData();
>>>>                               String sample =
>>>> getSample(raster.getSample(i, j, z), dataSampleType);
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> -
>>>> ------
>>>> ------------------------------------------------
>>>>
>>>> /*******/
>>>> private static String getSample(Object sample, int type)
>>>>       {
>>>>               String result = "";
>>>>               try
>>>>               {
>>>>                       switch (type)
>>>>                       {
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_BYTE:
>>>>                                       result = ((Byte)
>>> sample).toString();
>>>>                                       break;
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_DOUBLE:
>>>>                                       result = ((Double)
>>>> sample).toString();
>>>>                                       break;
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_FLOAT:
>>>>                                       result = ((Float)
>>>> sample).toString();
>>>>                                       break;
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_INT:
>>>>                                       result = ((Integer)
>>>> sample).toString();
>>>>                                       break;
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_SHORT:
>>>>                                       result = ((Short)
>>>> sample).toString();
>>>>                                       break;
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_UNDEFINED:
>>>>                                       result = sample.toString();
>>>>                                       break;
>>>>                               case
>>>> java.awt.image.DataBuffer.TYPE_USHORT:
>>>>                                       result = ((Short)
>>>> sample).toString();
>>>>                                       break;
>>>>                               default:
>>>>                                       break;
>>>>
>>>>                       }
>>>>               } catch (ClassCastException e)
>>>>               {
>>>>                       result = ((Integer) sample).toString();
>>>>               }
>>>>               return result;
>>>>       }
>>>>
>>>>
>>>>
>>>> Ciao
>>>> Pasquale
>>>>
>>>>
>>>> -----Messaggio originale-----
>>>> Da: [email protected]
>>>> [mailto:[email protected]] Per conto di
>>>> andrea antonello
>>>> Inviato: martedì 10 febbraio 2009 15.29
>>>> A: User-friendly Desktop Internet GIS
>>>> Oggetto: Re: [udig-devel] Udig 1.1.1 problems to read sample value
>>>> in geotiff 16 bit
>>>>
>>>>> I'm developing a plugin for udig(1.1.1 win32) and when I try to
>>>>> read the sample value of pixel in a geotiff with 16 bit of  depth,
>>>>> I obtain always the same value 2147483647 (that is 2^31). Some ideas?
>>>>> Can i read sample value of geotiff with 16 bit of depth?
>>>>
>>>> How exactly are you reading the image to get your information?
>>>> Not sure how raster were dealth with in udig 1.1, but you should be
>>>> able to access the imagereader and get your values.
>>>> Do you have some code so show us?
>>>>
>>>> Ciao
>>>> Andrea
>>>>
>>>>
>>>>>
>>>>> Cheers
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Udig-1.1.1-problems-to-read-sample-value-in-
>>>>> geo
>>>>> t
>>>>> iff-16-bit-tp21934226p21934226.html
>>>>> Sent from the udig-devel mailing list archive at Nabble.com.
>>>>>
>>>>> _______________________________________________
>>>>> User-friendly Desktop Internet GIS (uDig) http://
>>>>> udig.refractions.net
>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>
>>>> _______________________________________________
>>>> User-friendly Desktop Internet GIS (uDig)
>>>> http://udig.refractions.net
>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>>>
>>>> _______________________________________________
>>>> User-friendly Desktop Internet GIS (uDig)
>>>> http://udig.refractions.net
>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>> _______________________________________________
>>> User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>
>>>
>>> _______________________________________________
>>> User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/How-can-I-set-sample-data_type-in-a-geotiff--tp23
>> 07903p2307903.html Sent from the geotools-devel mailing list archive
>> at Nabble.com.
>>
>>
>> ----------------------------------------------------------------------
>> -------- Open Source Business Conference (OSBC), March 24-25, 2009,
>> San Francisco, CA -OSBC tackles the biggest issue in open source: Open
>> Sourcing the Enterprise -Strategies to boost innovation and cut costs
>> with open source participation -Receive a $600 discount off the
>> registration fee with the source code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> _______________________________________________
>> Geotools-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>
>
>
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to