[gdal-dev] driver MVT, no tiles generated

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] driver MVT, no tiles generated

Maria Ibarra

Hello,


I tried to use the recently released MVT (Mapbox Vector Tiles) driver of GDAL 2.3 to write vector tiles in pbf format, but I get an output folder with nothing but a metadata.json file. No tile is generated. I tried different source formats, and different creation options, but I cannot manage to make it work.


I tried exactly the same command shown as an example in the driver documentation (http://www.gdal.org/drv_mvt.html) with a valid non empty .gpkg file :


ogr2ogr -f MVT ./batiment source.gpkg -dsco MAXZOOM=10


But I get the same result: no error message, and an empty folder with a metadata.json 


This is the content of the metadata.json file created :


{
  "name":"
batiment",
  "description":"",
  "version":2,
  "minzoom":0,
  "maxzoom":5,
  "center":"2.4607491,48.7742768,0",
  "bounds":"2.3087879,48.6877737,2.6127104,48.8607799",
  "type":"overlay",
  "format":"pbf",
  "json":"{\n  \"vector_layers\":[\n  ],\n  \"tilestats\":{\n    \"layerCount\":0,\n    \"layers\":[\n    ]\n  }\n}"
}


What am I missing ? The driver seems to be enabled since I get no error message and a folder with a metadata file is created. Do I need some extra configurations ?


Thanks,


María


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

Re: driver MVT, no tiles generated

Even Rouault-2
On vendredi 8 juin 2018 12:26:06 CEST Maria Ibarra wrote:
> Hello,
>
>
> I tried to use the recently released MVT (Mapbox Vector Tiles) driver of
> GDAL 2.3 to write vector tiles in pbf format, but I get an output folder
> with nothing but a metadata.json file. No tile is generated. I tried
> different source formats, and different creation options, but I cannot
> manage to make it work.

How did you build GDAL / where did you get it from ?
I assume your buid has PROJ support, otherwise you would get a warning
message.

Can you retry by adding "--debug on" (double dash before debug) at the end of
your ogr2ogr command line, and include the output of this ?

Can you also include the output of "ogrinfo -al -so source.gpkg" ?

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: driver MVT, no tiles generated

Maria Ibarra
I downloaded GDAL from this package http://download.osgeo.org/gdal/2.3.0/gdal-2.3.0.tar.gz
Built with this command :
./configure --with-geos=yes with-pg=/usr/bin/pg_config
sudo make install

* This is the result of the command with the "--debug on"

ogr2ogr -f MVT ./batiment source.gpkg -dsco MAXZOOM=10 --debug on
GNM: GNMRegisterAllInternal
GNM: RegisterGNMFile
GNM: RegisterGNMdatabase
GPKG: GeoPackage v1.2.0
GDAL: GDALOpen(source.gpkg, this=0xe33f90) succeeds as GPKG.
GDAL: GDALDriver::Create(MVT,./batiment,0,0,0,Unknown,0xe3a8e0)
GPKG: ResetStatement(SELECT m."fid", m."geom", m."altitude_s", m."hauteur", m."nature", m."nom" FROM "batiment" m)
MVT: Creating temporary database...
GPKG: finalize 0xe7dc38
GDALVectorTranslate: 450768 features written in layer 'batiment'
GDAL: GDALClose(source.gpkg, this=0xe33f90)
MVT: Building output file from temporary database...
GDAL: GDALClose(./batiment, this=0xe3b470)


* This is the result of the command "ogrinfo -al -so source.gpkg"
INFO: Open of `source.gpkg'
      using driver `GPKG' successful.

Layer name: batiment
Geometry: Polygon
Feature Count: 450768
Extent: (257013.000000, 6222050.000000) - (290846.000000, 6251270.000000)
Layer SRS WKT:
PROJCS["WGS 84 / Pseudo-Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["X",EAST],
    AXIS["Y",NORTH],
    EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
    AUTHORITY["EPSG","3857"]]
FID Column = fid
Geometry Column = geom
altitude_s: Real (0.0)
hauteur: Real (0.0)
nature: String (0.0)
nom: String (0.0)


* I am not sure how to check if my build has PROJ support, I dont get a warning message with my previous command, but I do have an error message if I try to specify a TILING_SCHEME:

ogr2ogr -f MVT ./batiment source.gpkg -dsco MAXZOOM=10 -dsco TILING_SCHEME="EPSG:3857,-20037508.343,20037508.343,40075016.686"
ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of OGRCoordinateTransformation failed.


Maria
________________________________________
De : Even Rouault [[hidden email]]
Date d'envoi : vendredi 8 juin 2018 15:01
À : [hidden email]
Cc : Maria Ibarra
Objet : Re: [gdal-dev] driver MVT, no tiles generated

On vendredi 8 juin 2018 12:26:06 CEST Maria Ibarra wrote:
> Hello,
>
>
> I tried to use the recently released MVT (Mapbox Vector Tiles) driver of
> GDAL 2.3 to write vector tiles in pbf format, but I get an output folder
> with nothing but a metadata.json file. No tile is generated. I tried
> different source formats, and different creation options, but I cannot
> manage to make it work.

How did you build GDAL / where did you get it from ?
I assume your buid has PROJ support, otherwise you would get a warning
message.

Can you retry by adding "--debug on" (double dash before debug) at the end of
your ogr2ogr command line, and include the output of this ?

Can you also include the output of "ogrinfo -al -so source.gpkg" ?

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: driver MVT, no tiles generated

Even Rouault-2
On vendredi 8 juin 2018 14:17:25 CEST Maria Ibarra wrote:
> I downloaded GDAL from this package
> http://download.osgeo.org/gdal/2.3.0/gdal-2.3.0.tar.gz Built with this
> command :
> ./configure --with-geos=yes with-pg=/usr/bin/pg_config
> sudo make install

OK, the error message shows that GDAL doesn't find PROJ. In your particular
case where your input dataset is already in WebMercator, no reprojection
should normally occur, so that shouldn't matter.
But it would be saner to build GDAL with PROJ support by adding --with-proj to
configure, make clean and re-make

So as that won't likely solve the issue, do you mind sharing your input
dataset, or anyone that would show the issue ? (you can email it privately to
me if you wish)

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: driver MVT, no tiles generated

Even Rouault-2
In reply to this post by Maria Ibarra
Okay, I've reproduced the problem. It is due to your input geometries being
POLYGON Z, and the driver currently only expects XY geometries. I've just
pushed a fix so it is more tolerant.
You can workaround the issue by adding -dim 2 to your ogr2ogr command line.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev