*we already have support for reading
GeoReferencedRaster.parseGDALM**etaData(URI
uri) (seems format agnostic too). but that is depending on GDAL installed,
while the implementaion in TiffUtils.calculateStats() seems be plain java
utilizing some apache commons imaging code but is limited to TIFF files*.

Note that, together with Statistics, also NoData value is read using apache
commons. Possibly it can be used JAI staff instead (as in
AddRasterImageLayerWizard class).


Il giorno mar 22 set 2020 alle ore 13:49 Giuseppe Aruta <
giuseppe.ar...@gmail.com> ha scritto:

> > +       private static ImageAndMetadata readImage(File tiffFile, int
> overviewIndex, int indexStart, Point originalSize,
> > +           Resolution originalCellSize, Envelope wholeImageEnvelope,
> Envelope viewportEnvelope, double noDataValue,
> > +           Stats stats) throws IOException,
> NoninvertibleTransformException {
> > +
> > +         ImageInputStream imageInputStream =
> ImageIO.createImageInputStream(tiffFile);
> > +         Iterator<ImageReader> iterator =
> ImageIO.getImageReaders(imageInputStream);
>
> this seems to be a leftover. we want to enforce a specific TIFF reader,
> which seems not to be done here.
>
> why exactly are there two readImage() methods needed anyway? one should
> suffice. can you remove it?
>
> Not sure. As it tries to read overviews of a file from an external .ovr
> file. I have never used or found it in projects. Once I tried to save a
> tiff with overviews using QGIS: I had back two files, a TIF and a OVR one.
> But when I tried to load this  couple into OpenJUMP, it took so long that I
> gave up. AFAIR this was a request of many years ago from someone of the list
>
> Il giorno mar 22 set 2020 alle ore 13:07 <edgar.sol...@web.de> ha scritto:
>
>> we already have support for reading
>> GeoReferencedRaster.parseGDALMetaData(URI uri) (seems format agnostic too).
>> but that is depending on GDAL installed, while the implementaion in
>> TiffUtils.calculateStats() seems be plain java utilizing some apache
>> commons imaging code but is limited to TIFF files.
>>
>> note the following comment in GeoRefRaster
>>    /**
>>     * initialize the img and try to parse geo infos via (in this order)
>>     * worldfile, gdal or geotiff
>>     */
>>    protected void readRasterfile() throws ReferencedImageException {
>>
>> tl;dr i am good with keeping the addtional metadata reading within
>> TiffUtils generally. still you my want to consider a caching approach there
>> as well if the info is accessed more than once and expected not to change
>> over the course of the runtime.
>>
>> ..ede
>>
>> On 9/22/2020 12:32, Giuseppe Aruta wrote:
>> > I will make those changes. Statistics are calculated in order to reuse
>> on raster analysis (sextante). It is also saved into a special .aux.xml
>> sidecar file.
>> > At this moment there is no need to implement GeoReferencedRaster with
>> Statistic read as it is uìused only by Sextante.
>> >
>> > Il giorno mar 22 set 2020 alle ore 11:59 <edgar.sol...@web.de <mailto:
>> edgar.sol...@web.de>> ha scritto:
>> >
>> >     hey Peppe,
>> >
>> >     nice try, but no dice. the reason i created an explicit TiffUtilsV2
>> was
>> >     to make sure it contains no reference to RasterImageIO or TiffTags
>> >     anymore. the idea is to wrap GeoReferencedRaster functionality to
>> reuse.
>> >     GeoReferencedRaster includes all functionality for retrieving an
>> >     Envelope or dimensions needed.
>> >
>> >     If you are lacking functionality in GeoReferencedRaster we may add
>> it
>> >     accordingly.
>> >
>> >     i cut some code parts below and commented them which should be
>> replaced
>> >     by using GeoReferencedRaster routines. ..ede
>> >
>> >
>> >
>> >     On 9/22/2020 11:26, jump-pilot-svn--- via Jump-pilot-devel wrote:
>> >      > Revision: 6507
>> >      > http://sourceforge.net/p/jump-pilot/code/6507 <
>> http://sourceforge.net/p/jump-pilot/code/6507>
>> >      > Author:   ma15569
>> >      > Date:     2020-09-22 09:26:19 +0000 (Tue, 22 Sep 2020)
>> >      > Log Message:
>> >      > -----------
>> >      > Ported functionality from TiffUtils to TiffUtilsV2.
>> >      > Make TiffUtils deprecated
>> >      >
>> >     SNIP
>>
>>
>>
>>
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
>
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to