Hi Emily,
it is really good to have you here :)
and we fell offlist. Should let them know you fixed it :)

[...]
> One thing that stands out to me is on the line where the parameterValues are
> set, an "arbitrary" value of 1 is added/subtracted to the coordinate.  In
> lat/long 1 is a fairly large value.
>
> If instead of using the constant 1, I use the bbox passed into the info2
> function:
> ReferencedEnvelope bbox2 = transform(sourceCRS, targetCrs, bbox);
> GeneralParameterValue[] parameterValues =
> createGridGeometryGeneralParameter(1, 1, bbox2.getMaxY(),
> bbox2.getMinY(), bbox2.getMaxX(), bbox2.getMinX(),targetCrs);


the tool was tweaked for coverages in some quick hack, so indeed you
found the problem. Picking the large bound would produce strange
results in lat/long. The 1, which is right for the image space, was
picked also forthe world space, which is bad in case of geographic
proj.

I fixed it with a small enough delta and also added some check with
message to find out if the clicked point lies inside the coverage.

Let me know if it works for you,
Thanks,
Andrea



>
> Emily
>
>
>
> On 17/01/2013 2:51 AM, andrea antonello wrote:
>>
>> Hi Emily,
>>
>>> The info tool works fine for me in our local equal areas projection.  I
>>> only
>>> had issues with lat/long (4326); although I have not tested other
>>> projections.
>>>
>>> I've attached a small tiff file that I am having problems with.
>>>
>>> If I can help let me know.  I had difficulties understanding how the
>>> GridCoverageReader worked so that is where I got stuck when I tried
>>> debugging the problem.
>>
>>
>> Thanks for the sample and help.
>>
>> I did some debugging in this rather strange issue.
>> 2 comments:
>> - the reader is tested first, because it is definitely more performand
>> and will decide when and what is really necessary to be read. Also it
>> will support also raster mosaics.
>> - the real problem here in my opinion is that the lat long bounding
>> box is not properly created/passed and transformed. It looks as if
>> somewhere along the way some info gets lost and maybe some rounding
>> brings the world info to a trimmed pixel info. The method is this:
>>
>> net.refractions.udig.tool.info.internal.CoverageDescribeLayer.info2(ILayer,
>> ReferencedEnvelope, IProgressMonitor)
>> and it really needs some love.
>>
>> Right now I have no more time to look into this. I might in the weekend.
>> let me know if you find anything,
>> Cheers,
>> Andrea
>>
>>
>>
>>>
>>> Thanks,
>>> Emily
>>>
>>>
>>> On 16/01/2013 12:42 AM, andrea antonello wrote:
>>>>
>>>>
>>>> Hi Emily,
>>>> I have made a couple of tests and it looked ok to me.
>>>> Could you share a small dataset which produces the problem? I would
>>>> surely look into it.
>>>>
>>>> Cheers,
>>>> Andrea
>>>>
>>>>
>>>>
>>>> On Mon, Jan 14, 2013 at 9:00 PM, Emily Gouge <[email protected]>
>>>> wrote:
>>>>>
>>>>>
>>>>> I am having some issues getting the info tool to work correctly for
>>>>> Raster
>>>>> layers.  I have a single-band raster layer in lat/long (EPSG: 4326) and
>>>>> am
>>>>> unable to get the info tool to produce the correct results.
>>>>>
>>>>> The source of the problem seems to be the AbstractGridCoverage2DReader
>>>>> in
>>>>> the CoverageDescribeLayer class.  Something here is not producing the
>>>>> correct results.  If I comment out this section of code and simply let
>>>>> the
>>>>> geoResource resolve to a GridCoverage class the results are correct.
>>>>>
>>>>> I assume the purpose of trying the GridCoverage2DReader first is for
>>>>> performance reasons.  I don't understand how this reader class works,
>>>>> but
>>>>> I
>>>>> don't think it is returning the correct results.
>>>>>
>>>>> Thoughts/Ideas?
>>>>> Emily
>>>>> _______________________________________________
>>>>> 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

Reply via email to