Re: [Qgis-user] Timestep for (Temporal) Mesh/netcdf layers?

2023-03-09 Thread Vincent Cloarec via QGIS-User
For me, here, time step is the difference between the time of two
successive dataset of the same group. Do we agree?
The three methods of my previous message return a time that represents the
relative time associated with the dataset you point to. It is not the time
range of the whole group. This relative time is from a reference time that
is related to the dataset group.
So you (reference time + relative time)=absolute time (date+time) of the
dataset.
If your time step is constant, you just have to take two successive dataset
and soustract their relative times.

Le jeu. 9 mars 2023 à 10:28, Richard Duivenvoorde  a
écrit :

> Hi Vincent,
>
> Thanks for the clarifications!
>
> I am aware that netcdf's can have variable time steps. But in my case the
> dataset are all run from a model which runs at variable lengths but in
> fixed time steps, outputting >60 variables.
> So a run of 24 hour of every hour, or one of 3 days per 6 hours or 6 hours
> per 10 minutes.
>
> So the timestep are the same in one netcdf, it is just that I need to find
> out what the used 'timestep' is; actually to set the timecontroller
> timestep, because it is not set when I load a mesh using pyqgis (I have to
> download the model output zipped from some service endpoint, and put custom
> (logaritmic) classification styling on it...)
>
> So the datasetMetadata (I think) does not give me that info? As it gives
> the timerange of the full dataset, but I would have to know the length of
> the variables then to know my timestep?
>
> Thanks for your time!
>
> Regards,
>
> Richard Duivenvoorde
>
>
> On 3/9/23 15:03, Vincent Cloarec wrote:
> > Hi Richard,
> >
> > First, mesh layer time step is not supposed to be constant. Some dataset
> could have variable time steps, so there is not ONE time step available for
> each mesh layer or dataset group.
> >
> > If you need one time step, you can deduced if by using one of these ways:
> > - QgsMeshLayer::datasetMetadata() that will return the metadata of the
> dataset, this metadata contains the method time() that will return the time
> of the dataset in hours from the reference time
> > - QgsMeshLayer::datasetRelativeTime() that will return a QgsInteval that
> is the time of the dataset from the reference time
> > - QgsMeshLayer::datasetRelativeTimeInMilliseconds(), same but return in
> milliseconds.
> >
> > By soustraction of two dataset, you will have a time step, and if your
> data has constant time step it will be THE time step.
> > The reference time is not needed in your case but it can be obtained
> through the meta data of the dataset group.
> >
> > Or you can also use your method with the temporalCapabilities that
> should give the same results, but it is more related to the data provider,
> and I would avoid using it as it could have some issues with dataset group
> indexes.
> >
> > Note that the temporalUnit() of the temporal capabilities is not the
> unit of the time returned by the layer, but it the the data provider must
> considerer to read the times value. Default is hour for MDAL, but in
> certain case, when MDAL can't know the time unit, the user specify this
> unit.
> >
> > Hope this helps.
> >
> > Regards.
> >
> > Vincent
> >
> > Le mer. 8 mars 2023 à 10:42, Richard Duivenvoorde via QGIS-User <
> qgis-user@lists.osgeo.org > a écrit :
> >
> > Ok, found it. It is in the temporalCapabilities...
> >
> > So given a loaded netcdf/mesh with time.
> > Easiest is the firstTimeStepDuration(i) of
> QgsMeshDataProviderTemporalCapabilities:
> >
> >>>> p = iface.activeLayer().dataProvider().temporalCapabilities()
> >>>> p
> > 0x7fa958267e20>
> >>>> p.timeExtent()
> >
> >>>> p.temporalUnit()
> >   <<< ?
> ># datasetTime() Returns the relative time in milliseconds of the
> dataset
> >>>> p.datasetTime(QgsMeshDatasetIndex(0,0))
> >360
> >>>> p.datasetTime(QgsMeshDatasetIndex(0,1))
> >720
> >>>> p.datasetTime(QgsMeshDatasetIndex(0,2))
> >1080
> ># firstTimeStepDuration() Returns the duration of the first time
> step of the dataset group with index \a group
> ># in milliseconds
> >p.firstTimeStepDuration(0)
> >360  == 3600 s = 1 hours
> >p.firstTimeStepDuration(0)
> >2160  == 21600 s == 360 minute == 6 hours
> >
> > Only strange thing is that the temporalUnit() always returns
> 'hours', while the actual data time is relative in minutes...
> >
> > Regards,
> >
> > Richard Duivenvoorde
> >
> > On 3/8/23 10:46, Richard Duivenvoorde via QGIS-User wrote:
> >  > Hi,
> >  >
> >  > (trying here too, sorry for cross posting)
> >  >
> >  > When loading (temporal) Netcdf files (as MeshLayers), the
> 'timestep'
> >  > that you see in the Temporal Controller does not change.
> >  >
> >  > I had a look at the api, but could not find any 

[Qgis-user] File Geodatabase raster datasets readable in GDAL 3.7.0 (was Re: Unable to open some LISTdata open data ESRI File Geodatabases)

2023-03-09 Thread Even Rouault via QGIS-User

Hi,

Just to inform you that GDAL 3.7.0 will include a driver to read 
directly File Geodatabase raster datasets: 
https://github.com/OSGeo/gdal/pull/7389 . I've successfully tested it 
against the below datasets, among others.


They will consequently be directly be usable by QGIS once QGIS is built 
against this GDAL version (whose release will be in May)


Even

Le 16/12/2022 à 00:36, Nyall Dawson a écrit :

On Fri, 16 Dec 2022 at 09:18, Even Rouault via QGIS-User
 wrote:

Hi Peter,

yes I confirm this dataset is a raster gdb. I can sort-of open it with
my QGIS + GDAL master build using the OpenFileGDB driver, but you'll see
the raster tables in a raw unusable way. For example layers like
fras_blk_NCH_ES_WATER_LOGGING_HAZARD which contains the tiles as
compressed data in a BLOB column.

You could try the https://github.com/r-barnes/ArcRasterRescue utility to
convert into GeoTIFF

FWIW, I've had more luck with the fork at
https://github.com/justinfisk/ArcRasterRescue

Nyall


You could also kindly or not kindly suggest your administration to not
use proprietary formats for open data whereas thereare so many open
alternatives, like GeoTIFF...

Small "advertizing": for those interesting, there's a funding
opportunity to develop a GDAL open source raster driver to be able to
read filegdb rasters that QGIS could use to open directly such files.
Contact me off-list if interested.

Even

Le 15/12/2022 à 23:49, JOLLY, Peter via QGIS-User a écrit :

Hello

I've downloaded some  datasets from the LISTdata open data repository 
(https://listdata.thelist.tas.gov.au/opendata/index.html) -  which is a great 
service.
However, I can't open any datasets that are solely an ESRI File Geodatabase, 
e.g. 
https://listdata.thelist.tas.gov.au/opendata/data/NCH_ES_WATER_LOGGING_HAZARD_STATEWIDE.zip
 (279 MB)
Maybe these are raster gdb datasets? How can I tell if that is the case?
Is there any way the open a raster gdb other than with ESRI software?

I can open gdb files in QGIS from LISTdata that are included as part of a set with 
shapefile and MapInfo tab files (e.g. in the "Tasmanian Irrigation Irrigation 
District" dataset). I'm guessing that is because these are vector gdb files?

I'm running QGIS 3.10.6 ltr on Windows 10 64-bit (yes I know it's not the latest ltr, but 
it was the most recent "portable" build I have been able to find and run 
successfully).

Thanks
Peter
Tasmania, Australia

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

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

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


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

___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Disable anti-aliasing on XYZ layer

2023-03-09 Thread Richard Duivenvoorde via QGIS-User

( bringing it back to the list :-) )

And are you sure the image retrieved from the xyz server is not a jpeg 
(compared to your original png)?
You can try to see the actual url's used via F12 (the Debugging Development 
Tools panel) in QGIS.

Another option: QGIS does not respect the xyz-zoomlevels always.. so it is very 
easy to go to a zoomlevel in which QGIS has to resize the original image a 
little (and 'resample' it, see Rendering/Raster settings in the Options). So to 
really compare QGIS image to the original one, you have to use the 'Zoom to 
native resolution' in the legend/layer context menu).

Last idea: is your project in the same CRS as the xyz service (probably 
EPSG:3857?) Because if not, QGIS will also resample your original image to 
'fit' the tile in the right position in that other crs

(and again: I know nothing about Qt image rendering )

Regards,

Richard Duivenvoorde

On 3/9/23 15:36, Stephane Goldstein wrote:

I can see the difference by comparing the .png file in an image editor 
(https://pasteboard.co/YodS7tuhtzSC.png ) and 
how it's rendered in QGIS (https://pasteboard.co/tcGLRc7XrsNj.png 
).
The examples are at the same zoom level.

On Thu, 9 Mar 2023 at 21:46, Richard Duivenvoorde mailto:rdmaili...@duif.net>> wrote:

On 3/9/23 14:05, Stephane Goldstein via QGIS-User wrote:
 > Hi.
 > Is there a way to disable anti-aliasing of the png tiles loaded on an 
XYZ layer ?

Hi Stephane,

  From what do you conclude that there is anti-aliasing going on with XYZ 
layers?
I use xyz layers also but I'm not aware of such behaviour?

FYI: this is the code rendering the images:
https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp 

(tried to search for 'alias' but could not find anything)

Note, I'm not an expert in this field, so just wondering...

Regards,

Richard Duivenvoorde




___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Timestep for (Temporal) Mesh/netcdf layers?

2023-03-09 Thread Richard Duivenvoorde via QGIS-User

Hi Vincent,

Thanks for the clarifications!

I am aware that netcdf's can have variable time steps. But in my case the dataset 
are all run from a model which runs at variable lengths but in fixed time steps, 
outputting >60 variables.
So a run of 24 hour of every hour, or one of 3 days per 6 hours or 6 hours per 
10 minutes.

So the timestep are the same in one netcdf, it is just that I need to find out 
what the used 'timestep' is; actually to set the timecontroller timestep, 
because it is not set when I load a mesh using pyqgis (I have to download the 
model output zipped from some service endpoint, and put custom (logaritmic) 
classification styling on it...)

So the datasetMetadata (I think) does not give me that info? As it gives the 
timerange of the full dataset, but I would have to know the length of the 
variables then to know my timestep?

Thanks for your time!

Regards,

Richard Duivenvoorde


On 3/9/23 15:03, Vincent Cloarec wrote:

Hi Richard,

First, mesh layer time step is not supposed to be constant. Some dataset could 
have variable time steps, so there is not ONE time step available for each mesh 
layer or dataset group.

If you need one time step, you can deduced if by using one of these ways:
- QgsMeshLayer::datasetMetadata() that will return the metadata of the dataset, 
this metadata contains the method time() that will return the time of the 
dataset in hours from the reference time
- QgsMeshLayer::datasetRelativeTime() that will return a QgsInteval that is the 
time of the dataset from the reference time
- QgsMeshLayer::datasetRelativeTimeInMilliseconds(), same but return in 
milliseconds.

By soustraction of two dataset, you will have a time step, and if your data has 
constant time step it will be THE time step.
The reference time is not needed in your case but it can be obtained through 
the meta data of the dataset group.

Or you can also use your method with the temporalCapabilities that should give 
the same results, but it is more related to the data provider, and I would 
avoid using it as it could have some issues with dataset group indexes.

Note that the temporalUnit() of the temporal capabilities is not the unit of 
the time returned by the layer, but it the the data provider must considerer to 
read the times value. Default is hour for MDAL, but in certain case, when MDAL 
can't know the time unit, the user specify this unit.

Hope this helps.

Regards.

Vincent

Le mer. 8 mars 2023 à 10:42, Richard Duivenvoorde via QGIS-User 
mailto:qgis-user@lists.osgeo.org>> a écrit :

Ok, found it. It is in the temporalCapabilities...

So given a loaded netcdf/mesh with time.
Easiest is the firstTimeStepDuration(i) of 
QgsMeshDataProviderTemporalCapabilities:

   >>> p = iface.activeLayer().dataProvider().temporalCapabilities()
   >>> p
   
   >>> p.timeExtent()
   
   >>> p.temporalUnit()
      <<< ?
   # datasetTime() Returns the relative time in milliseconds of the dataset
   >>> p.datasetTime(QgsMeshDatasetIndex(0,0))
   360
   >>> p.datasetTime(QgsMeshDatasetIndex(0,1))
   720
   >>> p.datasetTime(QgsMeshDatasetIndex(0,2))
   1080
   # firstTimeStepDuration() Returns the duration of the first time step of 
the dataset group with index \a group
   # in milliseconds
   p.firstTimeStepDuration(0)
   360  == 3600 s = 1 hours
   p.firstTimeStepDuration(0)
   2160  == 21600 s == 360 minute == 6 hours

Only strange thing is that the temporalUnit() always returns 'hours', while 
the actual data time is relative in minutes...

Regards,

Richard Duivenvoorde

On 3/8/23 10:46, Richard Duivenvoorde via QGIS-User wrote:
 > Hi,
 >
 > (trying here too, sorry for cross posting)
 >
 > When loading (temporal) Netcdf files (as MeshLayers), the 'timestep'
 > that you see in the Temporal Controller does not change.
 >
 > I had a look at the api, but could not find any indication of knowledge
 > by the QgsMeshLayer of the size of the timesteps of the data.
 >
 > Within netcdf's it is common to define the timesteps as something like:
 > "minutes since 2022-11-27 16:00:00.0Z"
 > then the first set has 0, and then the next one for example 60 for
 > hourly data or 10 for 10-minute data.
 >
 > Question: IS a temporal mesh layer aware of the timesteps used?
 >
 > Or if not: I seem not to be able to inspect the data array of the 'time'
 > dimension. Should/can I?
 >
 > IF so, we could we could deduct from the first 2 or 3 timesteps, the
 > size of the timestep.
 >
 > Anybody a hint or idea?
 >
 > Regards,
 >
 > Richard Duivenvoorde
 >
 > ___
 > QGIS-User mailing list
 > QGIS-User@lists.osgeo.org 
 > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user 

Re: [Qgis-user] Timestep for (Temporal) Mesh/netcdf layers?

2023-03-09 Thread Vincent Cloarec via QGIS-User
Hi Richard,

First, mesh layer time step is not supposed to be constant. Some dataset
could have variable time steps, so there is not ONE time step available for
each mesh layer or dataset group.

If you need one time step, you can deduced if by using one of these ways:
- QgsMeshLayer::datasetMetadata() that will return the metadata of the
dataset, this metadata contains the method time() that will return the time
of the dataset in hours from the reference time
- QgsMeshLayer::datasetRelativeTime() that will return a QgsInteval that is
the time of the dataset from the reference time
- QgsMeshLayer::datasetRelativeTimeInMilliseconds(), same but return in
milliseconds.

By soustraction of two dataset, you will have a time step, and if your data
has constant time step it will be THE time step.
The reference time is not needed in your case but it can be obtained
through the meta data of the dataset group.

Or you can also use your method with the temporalCapabilities that should
give the same results, but it is more related to the data provider, and I
would avoid using it as it could have some issues with dataset group
indexes.

Note that the temporalUnit() of the temporal capabilities is not the unit
of the time returned by the layer, but it the the data provider must
considerer to read the times value. Default is hour for MDAL, but in
certain case, when MDAL can't know the time unit, the user specify this
unit.

Hope this helps.

Regards.

Vincent

Le mer. 8 mars 2023 à 10:42, Richard Duivenvoorde via QGIS-User <
qgis-user@lists.osgeo.org> a écrit :

> Ok, found it. It is in the temporalCapabilities...
>
> So given a loaded netcdf/mesh with time.
> Easiest is the firstTimeStepDuration(i) of
> QgsMeshDataProviderTemporalCapabilities:
>
>   >>> p = iface.activeLayer().dataProvider().temporalCapabilities()
>   >>> p
>0x7fa958267e20>
>   >>> p.timeExtent()
>   
>   >>> p.temporalUnit()
>  <<< ?
>   # datasetTime() Returns the relative time in milliseconds of the dataset
>   >>> p.datasetTime(QgsMeshDatasetIndex(0,0))
>   360
>   >>> p.datasetTime(QgsMeshDatasetIndex(0,1))
>   720
>   >>> p.datasetTime(QgsMeshDatasetIndex(0,2))
>   1080
>   # firstTimeStepDuration() Returns the duration of the first time step of
> the dataset group with index \a group
>   # in milliseconds
>   p.firstTimeStepDuration(0)
>   360  == 3600 s = 1 hours
>   p.firstTimeStepDuration(0)
>   2160  == 21600 s == 360 minute == 6 hours
>
> Only strange thing is that the temporalUnit() always returns 'hours',
> while the actual data time is relative in minutes...
>
> Regards,
>
> Richard Duivenvoorde
>
> On 3/8/23 10:46, Richard Duivenvoorde via QGIS-User wrote:
> > Hi,
> >
> > (trying here too, sorry for cross posting)
> >
> > When loading (temporal) Netcdf files (as MeshLayers), the 'timestep'
> > that you see in the Temporal Controller does not change.
> >
> > I had a look at the api, but could not find any indication of knowledge
> > by the QgsMeshLayer of the size of the timesteps of the data.
> >
> > Within netcdf's it is common to define the timesteps as something like:
> > "minutes since 2022-11-27 16:00:00.0Z"
> > then the first set has 0, and then the next one for example 60 for
> > hourly data or 10 for 10-minute data.
> >
> > Question: IS a temporal mesh layer aware of the timesteps used?
> >
> > Or if not: I seem not to be able to inspect the data array of the 'time'
> > dimension. Should/can I?
> >
> > IF so, we could we could deduct from the first 2 or 3 timesteps, the
> > size of the timestep.
> >
> > Anybody a hint or idea?
> >
> > Regards,
> >
> > Richard Duivenvoorde
> >
> > ___
> > QGIS-User mailing list
> > QGIS-User@lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
> ___
> QGIS-User mailing list
> QGIS-User@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Disable anti-aliasing on XYZ layer

2023-03-09 Thread Richard Duivenvoorde via QGIS-User

On 3/9/23 14:05, Stephane Goldstein via QGIS-User wrote:

Hi.
Is there a way to disable anti-aliasing of the png tiles loaded on an XYZ layer 
?


Hi Stephane,

From what do you conclude that there is anti-aliasing going on with XYZ layers?
I use xyz layers also but I'm not aware of such behaviour?

FYI: this is the code rendering the images:
https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmsprovider.cpp
(tried to search for 'alias' but could not find anything)

Note, I'm not an expert in this field, so just wondering...

Regards,

Richard Duivenvoorde


___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Disable anti-aliasing on XYZ layer

2023-03-09 Thread Stephane Goldstein via QGIS-User
Hi.
Is there a way to disable anti-aliasing of the png tiles loaded on an XYZ
layer ?
Thanks
Stephane
___
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user