[gdal-dev] GDAL way to set open options in QGIS?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] GDAL way to set open options in QGIS?

Jeremy Palmer-3
I'm trying to open the new MBTiles vector tiles driver format in QGIS. Is it somehow possible to set GDAL open options either within QGIS or some sort of environment variable?

Cheers
Jeremy

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Even Rouault-2

Jeremy,

 

As far as I know, there's no GUI way of setting open options in QGIS.

One solution is to create a VRT that contains the open option in it

For example with ogr2vrt.py

https://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2vrt.py

 

python ogr2vrt.py your.mbtiles your.vrt -oo ZOOM_LEVEL_AUTO=YES

 

Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Jeremy Palmer-3
Thanks Even.

I get a warning message when using ogr2vrt.py on trunk 41534: 

jpalmer$ ogr2vrt.py --version
GDAL 2.3.0dev, released 2017/99/99

jpalmer$ ogr2vrt.py parcels.mbtiles parcels.vrt -oo ZOOM_LEVEL_AUTO=YES
Warning 6: driver MBTiles : type 'booleean' for ZOOM_LEVEL_AUTO open option is not recognized.

Also looks like a spelling mistake in the message.

jpalmer$ ogrinfo parcels.vrt -so
INFO: Open of `parcels.vrt'
      using driver `OGR_VRT' successful.
Metadata:
  bounds=174.1821636,-37.3637475,175.0829141,-36.6128647
  center=174.6325388,-36.9883061,0
  format=pbf
  maxzoom=14
  minzoom=0
  name=parcels
  scheme=tms
  type=overlay
  version=2
  ZOOM_LEVEL=14
Warning 6: driver MBTiles : type 'booleean' for ZOOM_LEVEL_AUTO open option is not recognized.
1: parcels (Multi Polygon)

Cheers
Jeremy


On Mon, Feb 19, 2018 at 2:41 AM, Even Rouault <[hidden email]> wrote:

Jeremy,

 

As far as I know, there's no GUI way of setting open options in QGIS.

One solution is to create a VRT that contains the open option in it

For example with ogr2vrt.py

https://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2vrt.py

 

python ogr2vrt.py your.mbtiles your.vrt -oo ZOOM_LEVEL_AUTO=YES

 

Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com



_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Jürgen E. Fischer
Hi Jeremy,

On Mon, 19. Feb 2018 at 08:39:45 +1300, Jeremy Palmer wrote:
> jpalmer$ ogr2vrt.py --version
> GDAL 2.3.0dev, released 2017/99/99
>
> jpalmer$ ogr2vrt.py parcels.mbtiles parcels.vrt -oo ZOOM_LEVEL_AUTO=YES
> Warning 6: driver MBTiles : type 'booleean' for ZOOM_LEVEL_AUTO open option
> is not recognized.
>
> Also looks like a spelling mistake in the message.

Wasn't just in the message - the typo is fixed in r41535.


Jürgen

--
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden             http://www.norbit.de

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

signature.asc (844 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Jeremy Palmer-3
Hi  Jürgen,

On 19/02/2018 09:18, "Jürgen E. Fischer" 

Wasn't just in the message - the typo is fixed in r41535.


Thanks. Make sense now.

Cheers
Jeremy

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Jeremy Palmer-3
I've now added the VRT layer to QGIS 3.0 dev with GDAL 2.3dev, but it doesn't recognise it as a spatial layer - it just shows up with QGIS table icon. Here's the VRT file I'm trying to add and the result of ogrinfo: https://gist.github.com/palmerj/eb25a396fecc181b2da5023c70078198. Could the invalid geometries be causing the issue?

Note I can add the mbtiles file directly but then it shows all the data from every zoom level.

On Mon, Feb 19, 2018 at 9:47 AM, Jeremy Palmer <[hidden email]> wrote:
Hi  Jürgen,

On 19/02/2018 09:18, "Jürgen E. Fischer" 

Wasn't just in the message - the typo is fixed in r41535.


Thanks. Make sense now.

Cheers
Jeremy


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Even Rouault-2

Hi Jeremy,

 

> I've now added the VRT layer to QGIS 3.0 dev with GDAL 2.3dev, but it

> doesn't recognise it as a spatial layer - it just shows up with QGIS table

> icon. Here's the VRT file I'm trying to add and the result of ogrinfo:

> https://gist.github.com/palmerj/eb25a396fecc181b2da5023c70078198. Could the

> invalid geometries be causing the issue?

>

 

No, I did reproduce the issue. The reason was that the path to the mbtiles in the VRT was not tagged as relative. So either add the -relative switch in your ogr2vrt.py invokation, or grab its latest version that should now automatically set it.

 

> Note I can add the mbtiles file directly but then it shows all the data

> from every zoom level.

 

Normally only the maximum zoom level

 

Even

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDAL way to set open options in QGIS?

Jeremy Palmer-3
Hi Even,

On Tue, Feb 20, 2018 at 1:31 AM, Even Rouault <[hidden email]> wrote:


No, I did reproduce the issue. The reason was that the path to the mbtiles in the VRT was not tagged as relative. So either add the -relative switch in your ogr2vrt.py invokation, or grab its latest version that should now automatically set it.


 

> Note I can add the mbtiles file directly but then it shows all the data

> from every zoom level.

 


Ok thanks good to know.

Cheers
Jeremy



_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev