I have some vector layers in a shapefile that I would like to display in the Google Maps Javascript API. I recently learned that you can generate GeoJSON from shapefiles in the correct CRS using QGIS: Convert Shapefiles to GeoJSON? that worked well for me, but the problem is that the file is large - the resulting JSON is 250MB in my case. So I'd like to have it as a collection of tiles instead. I discovered that the Google Maps API can load tiles from GeoJSON as described here
https://stackoverflow.com/questions/27284251/vector-tiles-with-google-maps-v3
But I can't find a way to actually generate tiled GeoJSON like that. I noticed that both QGIS and MapTiler have an option to write vector tiles in the XYZ structure, but the individual files come out as .pbf, which Google Maps can't handle. So I am looking to create them as GeoJSON. Is there a way to do that?
Edit: In searching around, I also discovered tippecanoe and was able to run it, but it looks like it also generates pbf files. I want the individual tiles in geoJSON.
Edit 2: I then discovered that I could run tippecanoe-decode on the very same pbf files that tippecanoe itself had created. While a little weird, it seemed to work and generated JSON that looked like below, which is throwing errors in Google, I'm assuming because of the nested FeatureCollection...
{
"type": "FeatureCollection",
"properties": {
"zoom": 18,
"x": 42016,
"y": 91728
},
"features": [
{
"type": "FeatureCollection",
"properties": {
"layer": "sea",
"version": 2,
"extent": 4096
},
"features": [
{
"type": "Feature",
"properties": {
"autocad_el": 0,
"autocad_th": 0,
"autocad_wi": 0,
"autocad_co": 106,
"autocad_la": "C_1CON_ROAD_CURB",
"autocad_li": "ByLayer"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-122.299832,
47.442148
],
[
-122.299805,
47.44213
],
[
-122.299647,
47.442021
],
[
-122.299621,
47.442003
]
]
}
},
{
"type": "Feature",
"properties": {
"autocad_el": 0,
"autocad_th": 0,
"autocad_wi": 0,
"autocad_co": 106,
"autocad_la": "C_1CON_ROAD_CURB",
"autocad_li": "ByLayer"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-122.299832,
47.442153
],
[
-122.299805,
47.442135
],
[
-122.29964,
47.442021
],
[
-122.299613,
47.442003
]
]
}
}
]
}
]
}




