[gdal-dev] [EXTERNAL] Convert VRT+JPEG with gdalwarp

Kalev Julge kalev.julge at reach-u.com
Mon Jun 25 06:10:16 PDT 2018


Hi Doug,

Thanks for the info. I know that JPEG is lossy but our datasets are very large. That’s why we use JPEG, which is good enough for our needs and the file sizes are smaller.

It seems that GDAL doesn’t create new JPEG files without having pre-existing JPEG-s to modify. If I try to modify old JPEG, I get a message “Output dataset exists, but cannot be opened in update mode.

I also tried using “CreateCopy” but that produced syntax error. Used command on GDAL CMD:
“GDALDriver::CreateCopy ("new.jpg","old.jpg", FALSE, NULL, NULL, NULL)”

Kalev

From: Doug Newcomb <doug_newcomb at fws.gov>
Sent: Thursday, June 21, 2018 5:24 PM
To: Kalev Julge <kalev.julge at reach-u.com>
Cc: gdal dev <gdal-dev at lists.osgeo.org>
Subject: Re: [EXTERNAL] [gdal-dev] Convert VRT+JPEG with gdalwarp

Kalev,
Just set the output file format to -f  JPEG format   ( .jpg) or  -f JP2OpenJPEG (.jp2)

The JPEG format will be lossey by default.  Is that what you want?
See:
 https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-1-a3253eb96082

https://medium.com/planet-stories/a-gentle-introduction-to-gdal-part-2-map-projections-gdalwarp-e05173bd710a

Doug

On Thu, Jun 21, 2018 at 10:00 AM kalevj <kalev.julge at reach-u.com<mailto:kalev.julge at reach-u.com>> wrote:
Hello,

I used gdalwarp to transform a VRT+JPEG pair from one EPSG projection to
another. Everything worked well. This conversion changed the VRT file so
that reprojection takes place when the images are loaded. However, I would
need to reproject the JPEG so that there would not be a need to reproject
every time the images are loaded. Is it possible somehow?

I used the command:
"gdalwarp -s_srs EPSG:2006 -t_srs EPSG:3857 -of VRT -r near old.vrt new.vrt"

Thanks!

Kalev



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
Doug Newcomb
USFWS
551F Pylon Dr
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb at fws.gov<mailto:doug_newcomb at fws.gov>
---------------------------------------------------------------------------------------------------------

NOTE: This email correspondence and any attachments to and from this sender is subject to the Freedom of Information Act (FOIA) and may be disclosed to third parties.​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180625/bf85ad81/attachment-0001.html>


More information about the gdal-dev mailing list