Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiles missing data when multiple rows have same id #337

Closed
pnorman opened this issue Feb 26, 2018 · 5 comments
Closed

Tiles missing data when multiple rows have same id #337

pnorman opened this issue Feb 26, 2018 · 5 comments
Labels
Milestone

Comments

@pnorman
Copy link
Contributor

pnorman commented Feb 26, 2018

Some tiles are empty with no apparent reason. Although only one rendered tile is visible here, others are scattered around.

image

In an effort to debug I ran with TEGOLA_OPTIONS=DontSimplifyGeo SQL_DEBUG=EXECUTE_SQL and had no changes.

After a bit of debugging, I looked at the geojson, and it's odd. I got this, where translucent green is polygons in the tile

image

The lower-left is the only data from the water layer.

image

There's something odd going on when I zoom in close, with several things happening

image

The purple polygons overlap on the tile edge. This is intentional, but makes it look more complex.

Red dots are on vertexes of the original data, but you can see the vector tile has introduced additional ones. Coordinates look slightly off but that could be because it's zoomed in so much the vector tile grid resolution matters.

Shell commands for converting were

curl 'http://192.168.1.1:8080/maps/bolder/7/19/43.pbf?debug=true' -o 7_19_43.pbf
vt2geojson -z 7 -x 19 -y 43 7_19_43.pbf > 7_19_43.geojson
@pnorman pnorman changed the title Empty tiles in preview Tiles missing data Feb 26, 2018
@pnorman
Copy link
Contributor Author

pnorman commented Feb 26, 2018

Oh, for SQL-side debugging, I checked that particular tile with

select osm_id, st_area(way::geometry) from (SELECT
      0::bigint AS osm_id,
      ST_AsBinary(way) AS way
    FROM simplified_ocean_polygons
    WHERE way && ST_MakeEnvelope(-1.4093765021372069e+07,6.57969939387207e+06,-1.3770895013940427e+07,6.25682938644043e+06,3857)) as _;

Results were

┌────────┬──────────────────┐
│ osm_id │     st_area      │
├────────┼──────────────────┤
│      0 │ 359223880333.241 │
│      0 │ 15631132.2569061 │
│      0 │ 377659.520064561 │
│      0 │ 5031.66775602203 │
│      0 │ 632656537.448886 │
│      0 │ 53202350.4275055 │
│      0 │ 155817611103.982 │
│      0 │ 17527459038.9674 │
│      0 │ 607717.938907239 │
│      0 │ 856719.443274425 │
│      0 │ 6386050769.74848 │
│      0 │ 60422364.8476324 │
│      0 │ 13837482.8106902 │
│      0 │ 1479355.45746988 │
└────────┴──────────────────┘

For scale, at traditional z7 pixel is 1490116 square Mercator meters, and a 4096 grid square is 5776. Several of the rows there are of significant size.

@ARolek
Copy link
Member

ARolek commented Feb 26, 2018

@pnorman as always, thanks for the detailed submission. I'm wondering if the fact that all the features have the same osm_id might be causing the issue? I believe that the feature ID needs to be unique or it can cause problems. If this is the case, then we need to add a log statement when this occurs.

@pnorman
Copy link
Contributor Author

pnorman commented Feb 26, 2018

I believe that the feature ID needs to be unique or it can cause problems.

Having a unique ID is only a SHOULD in the spec, it's not required at all. Many data sources don't have an ID, or don't have a unique one.

@pnorman pnorman changed the title Tiles missing data Tiles missing data when multiple rows have same id Mar 3, 2018
@ARolek ARolek added the bug label Sep 25, 2018
@ARolek ARolek added this to the v0.8.0 milestone Sep 25, 2018
@ARolek
Copy link
Member

ARolek commented Oct 2, 2018

@pnorman this has been fixed on the v0.8.x branch.

@ARolek ARolek closed this as completed Oct 2, 2018
@pnorman
Copy link
Contributor Author

pnorman commented Feb 28, 2019

Confirming fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants