I need to display huge GeoJSON file using OpenLayers. So I decided to use VectorTiles. Library geojson-vt.js works perfectly for me, but unfortunately it requires my GeoJSON file to be preloaded on client. As it is about 120MB, it's not possible. So I started to look for a way, how to serve the data from my web server. I can see 2 options:
- Serve it on fly like geojson-vt.js does. Is there a PHP library capable doing this? I haven't been able to find any.
Create vector tiles pyramid and serve the tiles per request. I was able to find only 1 way, how to split my GeoJSON to vector tiles - using GDAL - ogr2ogr. Is there another way? I installed GDAL on my Centos 7 box and on my Windows 10 PC. Running command
ogr2ogr -f MVT -dsco FORMAT=MBTILES -dsco MAXZOOM=18 previews.mbtiles previews.geojson
finishes with error "Unable to find driver `MVT'" on both of them. gdal-config --formats command gives me this result:
gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem jdem envisat elas fit vrt usgsdem l1b nitf bmp airsar rs2 ilwis rmf leveller sgi srtmhgt idrisi gsg ingr ers jaxapalsar dimap gff cosar pds adrg coasp tsx terragen blx msgn til r northwood saga xyz hf2 kmlsuperoverlay ctg e00grid zmap ngsgeoid iris map cals safe sentinel2 derived prf mrf grib bsb gif jpeg png pcraster zlib pcidsk rik ozi pdf postgisraster arg
I found a suggestion, that "./configure --with-spatialite --with-sqlite" should help on CentOS, but it didn't. Any idea how I can move forward? I don't care whether with ogr2ogr or other tool. I just need to serve my GeoJSON from my web server (without using special GIS server) as vector tiles.