systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.42k stars 228 forks source link

Smaller GeoJSON polygons not showing up #659

Open rebrancher opened 6 months ago

rebrancher commented 6 months ago

Hello - I am getting geojson polygons from geoJSON.io - I have found that when I make a much smaller polygon - i.e. a train station - I get the layer showing up in the schema, but no polygon.

When I have a larger polygon, like an airport, the polygon shows. Is there a limit on how small a geoJSON polygon can be?

Working GeoJSON:

{
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {"name": "NJT-NEC-NB"},
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -74.19641252412858,
                40.713775117742614
              ],
              [
                -74.19641252412858,
                40.66745519679765
              ],
              [
                -74.15040513796141,
                40.66745519679765
              ],
              [
                -74.15040513796141,
                40.713775117742614
              ],
              [
                -74.19641252412858,
                40.713775117742614
              ]
            ]
          ]
        }
      }
    ]
  }

Not working geoJson

{
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {"name": "NJT-NEC-NB"},
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -74.44628431075762,
                40.49657860258549
              ],
              [
                -74.44612245103329,
                40.496481303180786
              ],
              [
                -74.44588551327968,
                40.49671044944435
              ],
              [
                -74.44604897556118,
                40.49680713009951
              ],
              [
                -74.44628431075762,
                40.49657860258549
              ]
            ]
          ]
        }
      }
    ]
  }

Could this be an issue in lat2latp in geojson_processor.cpp?

systemed commented 6 months ago

Could you paste the line you've added to your config JSON to include this file?

rebrancher commented 6 months ago

Could you paste the line you've added to your config JSON to include this file?

Sure:

"NJT-NEC": { "minzoom": 11, "maxzoom": 14, "source": "geoJson/NJT-NEC.geojson", "source_columns": ["name"]},
systemed commented 6 months ago

(deleted my previous erroneous comment)

If I create a tileset of New Jersey with the New Brunswick station geojson, and with the above line added, I can run vt2geojson successfully and see the feature:

galibier:~ richard$ vt2geojson http://peyresourde.local:8080/14/4803/6173.pbf
{
  "type": "FeatureCollection",
  "features": [
// ...lines skipped...
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -74.44628834724426,
              40.49658245672458
            ],
            [
              -74.44605231285095,
              40.496810899558795
            ],
            [
              -74.44588601589203,
              40.49671299558224
            ],
            [
              -74.44612741470337,
              40.49648455241464
            ],
            [
              -74.44628834724426,
              40.49658245672458
            ]
          ]
        ]
      },
      "properties": {
        "name": "NJT-NEC-NB",
        "vt_layer": "NJT-NEC"
      }
    },

Same works at all zoom levels:

vt2geojson http://peyresourde.local:8080/11/600/771.pbf
vt2geojson http://peyresourde.local:8080/12/1200/1543.pbf
vt2geojson http://peyresourde.local:8080/13/2401/3086.pbf
vt2geojson http://peyresourde.local:8080/14/4803/6173.pbf

Does that not work for you?

rebrancher commented 6 months ago

I was unaware of vt2geojson previously, I will use that from now on.

I was relying on the browser tileserver-gl schema to show me the added information, but I believe there was a caching issue on my end. Sometimes if I open in a new browser, or wait long enough (around 30 minutes), I see the updated information.

I wonder if there is a way to slightly modify the updated files so that servers can tell there is new information. But that may be out of the scope of tilemaker.

Thanks for looking into this.

systemed commented 6 months ago

No problem at all. vt2geojson is a huge help for debugging, particularly if you use it in conjunction with tilemaker-server which is pretty barebones and should guarantee there's no caching getting in the way.