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

Missing water polygon #348

Closed
pnorman opened this issue Mar 3, 2018 · 5 comments
Closed

Missing water polygon #348

pnorman opened this issue Mar 3, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@pnorman
Copy link
Contributor

pnorman commented Mar 3, 2018

With TEGOLA_OPTIONS=DontSimplifyGeo and a self-built 08ddd8f (v0.6.0) I get

image

In tile 6/10/22 some of the water is missing.

If I zoom in to z7 all the water loads in 7/20/44
image

The

I checked the DB and the polygons are present in the data, and they are, with fid=1701

image

Weirdly, it doesn't precisely correspond to what's missing

The layer that produces the problem is

  [[providers.layers]]
  name = "lz_water"
  id_fieldname = "osm_id"
  geometry_fieldname = "way"
  sql = """
  SELECT
      row_number() OVER () AS osm_id,
      ST_AsBinary(way) AS way
    FROM (
      SELECT
          way
        FROM simplified_ocean_polygons
        WHERE way && !BBOX!
      UNION ALL
      SELECT
          way
        FROM planet_osm_polygon
        WHERE way && !BBOX!
          AND (waterway = 'riverbank'
            OR landuse = 'reservoir'
            OR "natural" = 'water')
          AND way_area > pixel_size(9)*4 -- working around tegola #343
    ) _
  """

...

[[maps.layers]]
name = "water"
provider_layer = "osm2pgsql.lz_water"
min_zoom = 6
max_zoom = 9

row_number() OVER () guarantees that this isn't #337, but a different bug.

To isolate it I tried some SQL

create table ocean_test as select * from simplified_ocean_polygons where fid=1701;

And changed the layer SQL to

SELECT
      row_number() OVER () AS osm_id,
      ST_AsBinary(way) AS way
    FROM (
      SELECT
          way
        FROM ocean_test
        -- WHERE way && !BBOX!-- tegola requires !BBOX! in the query, so give it one
    ) _

Hiding tile bounds to get a better view, I have

image

I highlighted some areas in the z6 tile
image

These are either interior rings (i.e. islands) like the top one or bays, like the bottom one, reproduced below

image

I checked and the geometry is both ST_IsValid and ST_IsSimple.

@gdey
Copy link
Member

gdey commented Mar 5, 2018

Paul,
Thanks for the report. This is an issue with MakeValid function.

screen shot 2018-03-05 at 11 56 59 am

I will look into this after I'm done with the current issue I'm working on.

@gdey gdey self-assigned this Mar 5, 2018
@gdey gdey added the bug label Mar 5, 2018
@gdey
Copy link
Member

gdey commented Mar 9, 2018

@pnorman I would like to recreate this on my laptop so that I can figure out what is going wrong with the makevalid function. What data set are you using?

Thank you,

Gautam.

@pnorman
Copy link
Contributor Author

pnorman commented Mar 9, 2018

simplified_ocean_polygons which is http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip with a last modified of Mon, 26 Feb 2018 08:30:25 GMT

I've uploaded the result of \copy ocean_test to ocean_test.csv which you can load in

ocean_test.txt

@gdey
Copy link
Member

gdey commented Mar 14, 2018

@pnorman just wanted to let you know I did start working on this, but I started having issues with my laptop, which Apple then took; so it will be around a week before I can get back to this.

@ARolek ARolek added this to the v0.8.0 milestone Aug 11, 2018
@ARolek ARolek modified the milestones: v0.8.0, v0.9.0 Oct 24, 2018
@pnorman
Copy link
Contributor Author

pnorman commented Feb 17, 2019

I've done a check of my tracked bugs, and this bug is no longer present in the 0.9.x branch.

@pnorman pnorman closed this as completed Feb 17, 2019
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

3 participants