Re: [gdal-dev] Errors during make - GDAL/Linux

2022-04-05 Thread Mateusz Loskot
On Tue, 5 Apr 2022 at 22:33, Ritu Vatsalya  wrote:

> I am trying to install GDAL 3.3.3 on Red Hat Enterprise Linux release 8.5.
>
> jpeg2000dataset.cpp:40:10: fatal error: jasper/jasper.h: No such file or
> directory
>
> #include 
>
>   ^
> Please suggest.
>

https://github.com/OSGeo/gdal/issues/2402#issuecomment-613541129

By the way, at near the top of
https://www.google.com/search?q=fatal+error%3A+jasper%2Fjasper.h%3A

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Errors during make - GDAL/Linux

2022-04-05 Thread Ritu Vatsalya
Hello,
I am trying to install GDAL 3.3.3 on Red Hat Enterprise Linux release 8.5.
I hit the error below during make:

make -C jpeg2000 install-obj
make[2]: Entering directory '/u01/software/gdal-3.3.3/frmts/jpeg2000'
/bin/sh /u01/software/gdal-3.3.3/libtool --mode=compile --silent --tag=CXX g++ 
-I/u01/software/gdal-3.3.3/port -I/u01/software/gdal-3.3.3/gcore 
-I/u01/software/gdal-3.3.3/alg -I/u01/software/gdal-3.3.3/ogr 
-I/u01/software/gdal-3.3.3/ogr/ogrsf_frmts -I/u01/software/gdal-3.3.3/gnm 
-I/u01/software/gdal-3.3.3/apps -DHAVE_AVX_AT_COMPILE_TIME 
-DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2  -Wall -Wextra 
-Winit-self -Wunused-parameter -Wformat -Werror=format-security 
-Wno-format-nonliteral -Wlogical-op -Wshadow -Wmissing-include-dirs -Werror=vla 
-Wdate-time -Wnull-dereference -Wduplicated-cond -Wextra-semi 
-Wfloat-conversion -Wmissing-declarations -Wnon-virtual-dtor 
-Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant 
-Wsuggest-override -Wimplicit-fallthrough   -DGNM_ENABLED 
-I/u01/software/gdal-3.3.3/port  -DGDAL_COMPILATION -c -o 
../o/jpeg2000dataset.lo jpeg2000dataset.cpp
jpeg2000dataset.cpp:40:10: fatal error: jasper/jasper.h: No such file or 
directory
#include 
  ^
compilation terminated.
make[2]: *** [../../GDALmake.opt:648: ../o/jpeg2000dataset.lo] Error 1
make[2]: Leaving directory '/u01/software/gdal-3.3.3/frmts/jpeg2000'
make[1]: *** [GNUmakefile:15: jpeg2000-install-obj] Error 2
make[1]: Leaving directory '/u01/software/gdal-3.3.3/frmts'
make: *** [GNUmakefile:114: frmts-target] Error 2

Also, I tried installing GDAL version 3.3.2 and get the same issue. Please 
suggest.


Thanks,
Ritu Vatsalya
Sr Database Admin

Teranet Inc.
123 Front Street West, Suite 700
Toronto, ON M5J 2M2
416.254.0687
www.teranet.ca
[togaf9-certified]
[cid:image002.png@01D8490A.DD07B4C0]

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Create COG jpeg tiles with JFIF APPn markers

2022-04-05 Thread Even Rouault

Jose,
Those tiles contain normal JPEG markers (SOI, SOF0, DQT) but no JFIF 
marker (APP/n/) is added. How can I ensure adding this JFIF marker?


you can't, unless you're ready to patch the JPEG codec in libtiff to do that

I should point to 
https://www.awaresystems.be/imaging/tiff/specification/TIFFTechNote2.txt 
which mentions:


"Writers should avoid including "noise" JPEG markers (COM and APPn markers).
Standard TIFF fields provide a better way to transport any non-image data.
Some JPEG codecs may change behavior if they see an APPn marker they
think they understand; since the TIFF spec requires these markers to be
ignored, this behavior is undesirable."

Even

--
http://www.spatialys.com
My software is free, but my time generally not.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Create COG jpeg tiles with JFIF APPn markers

2022-04-05 Thread Rahkonen Jukka (MML)
Hi,

I would like to inform that you did write mail to the right place even you have 
not received any answers yet. Unfortunately your question is too specific for 
most GDAL users and capable developers are very busy as you can see from the 
GitHub activity. Let's still hope that somebody reacts.

-Jukka Rahkonen-

Lähettäjä: gdal-dev  Puolesta Jose Calvo
Lähetetty: tiistai 29. maaliskuuta 2022 9.59
Vastaanottaja: gdal-dev@lists.osgeo.org
Aihe: [gdal-dev] Create COG jpeg tiles with JFIF APPn markers

Hi.

Currently my c++ app creates COG files from GeoTiff tiled files.


GeoTiff files are created using JPEG compression with YCBCR photometric using 
following creation options:

  *   PROFILE=GeoTIFF
  *   TILED=YES
  *   BLOCKXSIZE=xxx
  *   BLOCKYSIZE=xxx
  *   COMPRESS=JPEG
  *   PHOTOMETRIC=YCBCR
  *   JPEG_QUALITY=xx
  *   JPEGTABLESMODE=0
>From this Geotiff files, app creates COG tiled files using following options:

  *   BLOCKSIZE=xxx
  *   OVERVIEWS=FORCE_USE_EXISTING
  *   COMPRESS=JPEG
  *   QUALITY=xx
Those tiles contain normal JPEG markers (SOI, SOF0, DQT) but no JFIF marker 
(APPn) is added. How can I ensure adding this JFIF marker?

I'm using gdal 3.1.0.7 in a ubuntu 20.10 using both strategies:

  *   internal jpeg and tiff code: --with-jpeg=internal --with-libtiff=internal
  *   external jpeg and tiff libraries: libjpeg.so.8.2.2 libtiff.so.5.5.0
Thanks in advance.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL warp tutorial question (C vs. C++)

2022-04-05 Thread Michael Sumner
Excellent - I'll submit a PR for the include in the first snippet.

I've become more au fait with the different idioms today, and this
description is very helpful.

Best, Mike

On Tue, Apr 5, 2022 at 8:47 PM Even Rouault 
wrote:
>
>
> Le 05/04/2022 à 01:28, Michael Sumner a écrit :
> > Hello, the warp tutorial  needs at least inclusion of "cpl_conv.h" for
> > CPLMalloc to work.
> >
> > https://gdal.org/tutorials/warp_tut.html
> >
> > But, I'd like to ask why it uses the style of the C examples (as per
> > the Raster API tutorial
> > https://gdal.org/tutorials/raster_api_tut.html) rather than the C++ -
> > i.e. it uses 'GDALDatasetH hSrcDS' declarations rather than
> > 'GDALDataset *poDataset', and all the 'GDAL' rather than
> > '->' pointer syntax.
> >
> > Is that recommended, or is it just old style in this tutorial (because
> > the apps were originally C)?
>
> Probably just the preference of the author of the example. At least the
> first code snippet
> (https://gdal.org/tutorials/warp_tut.html#a-simple-reprojection-case)
> uses some C++ with the GDALWarpOperation class so it could be
> potentially converted to full C++ (but you'll need to keep CPLMalloc()
> and not use new[] because GDALDestroyWarpOptions() expects panSrcBands
> and panDstBands to have been allocated with CPLMalloc())
>
> Actually I see the second snippet
> (https://gdal.org/tutorials/warp_tut.html#creating-the-output-file) does
> use some bits of C++ with the OGRSpatialReference class. It could be
> either fully converted to C++ (but some functions like
> GDALCreateGenImgProjTransformer() or GDALSuggestedWarpOutput() only
> exist in the C API, so you'd have to cast C++ dataset objects to C
> handles at some point. This also applies to the first snippet, which
> explains that using C functions is more practical to avoid those casts))
> or C.
>
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
>


--
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsum...@gmail.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL warp tutorial question (C vs. C++)

2022-04-05 Thread Even Rouault


Le 05/04/2022 à 01:28, Michael Sumner a écrit :
Hello, the warp tutorial  needs at least inclusion of "cpl_conv.h" for 
CPLMalloc to work.


https://gdal.org/tutorials/warp_tut.html

But, I'd like to ask why it uses the style of the C examples (as per 
the Raster API tutorial 
https://gdal.org/tutorials/raster_api_tut.html) rather than the C++ - 
i.e. it uses 'GDALDatasetH hSrcDS' declarations rather than 
'GDALDataset *poDataset', and all the 'GDAL' rather than 
'->' pointer syntax.


Is that recommended, or is it just old style in this tutorial (because 
the apps were originally C)?


Probably just the preference of the author of the example. At least the 
first code snippet 
(https://gdal.org/tutorials/warp_tut.html#a-simple-reprojection-case) 
uses some C++ with the GDALWarpOperation class so it could be 
potentially converted to full C++ (but you'll need to keep CPLMalloc() 
and not use new[] because GDALDestroyWarpOptions() expects panSrcBands 
and panDstBands to have been allocated with CPLMalloc())


Actually I see the second snippet 
(https://gdal.org/tutorials/warp_tut.html#creating-the-output-file) does 
use some bits of C++ with the OGRSpatialReference class. It could be 
either fully converted to C++ (but some functions like 
GDALCreateGenImgProjTransformer() or GDALSuggestedWarpOutput() only 
exist in the C API, so you'd have to cast C++ dataset objects to C 
handles at some point. This also applies to the first snippet, which 
explains that using C functions is more practical to avoid those casts)) 
or C.



--
http://www.spatialys.com
My software is free, but my time generally not.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev