Re: [gdal-dev] GDALWarp Datasets

2019-02-15 Thread James McClain
Hello,

Okay, all of that is well-taken.  Thank you for your response.

> If you're not interested in the pixel values, using
GDALSuggestedWarpOutput2()
is a better fit.

Yes, my question was worded a bit unclearly: I am essentially interested in
retrieving warped tiles so the pixels are of primary interest.

Thank you,
James McClain



On Fri, Feb 15, 2019 at 4:58 AM Even Rouault 
wrote:

> On vendredi 15 février 2019 00:06:28 CET James McClain wrote:
> > Hello,
> >
> > If I may, I would like to a few questions regarding how best to use the
> > GDALWarp function (
> >
> https://github.com/OSGeo/gdal/blob/master/gdal/apps/gdalwarp_lib.cpp#L748-L7
> > 70) and the datasets that it creates.
> >
> > In particular, I am experimenting with using such datasets to read warped
> > extents on an on-demand basis and in a thread-safe way.
> >
> > I have found that the VRT output format is lazy with respect to
> computation
> > and allocation which is great for my use case, but it appears not to be
> > thread safe with respect to reading from a single warped dataset from
> > multiple threads.
>
> No single GDALDataset object of any driver should be used simultaneously
> by
> multiple threads (this extends to any GDAL/OGR class instance). If this
> seems
> to work for GTiff, you're just lucky, but that might just fail as well.
> If you need to access a dataset from several threads, each one should have
> its
> own GDALDataset object (so this won't work for the MEM driver)
>
> >
> > On a more meta level, are datasets created by GDALWarp the right approach
> > (if I want to lazy get warped extents in a thread-safe manner) or should
> I
> > look elsewhere?
>
> If you're not interested in the pixel values, using
> GDALSuggestedWarpOutput2()
> is a better fit.
>
> Even
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
"I prayed for freedom for twenty years, but received no answer until I
prayed with my legs."
 -- Frederick Douglass
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDALWarp Datasets

2019-02-15 Thread Even Rouault
On vendredi 15 février 2019 00:06:28 CET James McClain wrote:
> Hello,
> 
> If I may, I would like to a few questions regarding how best to use the
> GDALWarp function (
> https://github.com/OSGeo/gdal/blob/master/gdal/apps/gdalwarp_lib.cpp#L748-L7
> 70) and the datasets that it creates.
> 
> In particular, I am experimenting with using such datasets to read warped
> extents on an on-demand basis and in a thread-safe way.
> 
> I have found that the VRT output format is lazy with respect to computation
> and allocation which is great for my use case, but it appears not to be
> thread safe with respect to reading from a single warped dataset from
> multiple threads.

No single GDALDataset object of any driver should be used simultaneously by 
multiple threads (this extends to any GDAL/OGR class instance). If this seems 
to work for GTiff, you're just lucky, but that might just fail as well.
If you need to access a dataset from several threads, each one should have its 
own GDALDataset object (so this won't work for the MEM driver)

> 
> On a more meta level, are datasets created by GDALWarp the right approach
> (if I want to lazy get warped extents in a thread-safe manner) or should I
> look elsewhere?

If you're not interested in the pixel values, using GDALSuggestedWarpOutput2() 
is a better fit.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] GDALWarp Datasets

2019-02-14 Thread James McClain
Hello,

If I may, I would like to a few questions regarding how best to use the
GDALWarp function (
https://github.com/OSGeo/gdal/blob/master/gdal/apps/gdalwarp_lib.cpp#L748-L770)
and the datasets that it creates.

In particular, I am experimenting with using such datasets to read warped
extents on an on-demand basis and in a thread-safe way.

I have found that the VRT output format is lazy with respect to computation
and allocation which is great for my use case, but it appears not to be
thread safe with respect to reading from a single warped dataset from
multiple threads.

I have found that the MEM output format is safe with respect to concurrent
reads, but is eager in its allocation and computation.

I have found that the GTIFF output format is also safe with respect to
concurrent reads (but CPU utilization is low so it looks like there is
internal locking), and it is once again eager with respect to allocation
and computation.

What I would like to find is way to create a dataset that is both lazy and
safe with respect to concurrent reads.  Can anyone share any suggestions
with me?

(Note: the foregoing statements are based on experiments that I have done,
not based on looking at the code; if any of the above is incorrect I am
very happy to be corrected.)

On a more meta level, are datasets created by GDALWarp the right approach
(if I want to lazy get warped extents in a thread-safe manner) or should I
look elsewhere?

Thank you,
James McClain

-- 
"I prayed for freedom for twenty years, but received no answer until I
prayed with my legs."
 -- Frederick Douglass
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev