-
Notifications
You must be signed in to change notification settings - Fork 822
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
Low-zoom ocean shapefile not rendered correctly on some setups #2101
Comments
Have you tried running ./get-shapefiles.sh? We switched from land-polygons to ocean-polygons, this might have something to do with this. I also saw some blue tiles in Europe on the openstreetmap.org servers, so there might also be a data problem. |
yes. The flow was:
if I use: |
The shapefiles are not rendering on either 2.39.0 or master for you. On master go to the same directory as
The results should be
Check that the feature count is approximately the same. Also, post the result of |
simplified_water_polygons.shp output is identical to above.
|
I'm using this to import GB.pbf to the db:
|
Problem is still there, even with ogr2ogr for all shape files to fix possible inconsistencies. |
I cannot reproduce this. @codebrane Did you already find the cause of this problem by any chance? |
@springmeyer Do you perhaps have any idea what might cause this rendering glitch? The screenshot above looks quite particular. |
The image shown looks like an 180-degree-meridian reprojection error. Keep in mind what i wrote in http://blog.imagico.de/on-slicing-the-world-news-from-openstreetmapdata-com/ on the simplified water polygons - that you should not attempt to reproject them, not even a simple round trip conversion Mercator->Geographic->Mercator. This will fail since the polygons slightly extend over the 180-degree-meridian. I assume if the coordinate system you have set in Mapnik and the coordinate system in the shapefile are formally different you get a coordinate system conversion and therefore a failure. I am not familiar enough with Mapnik to know if and under what conditions this happens. |
Projection is EPSG:3857 / WGS 84 Pseudo Mercator and in project file it is EPSG:900913 - so the google one. Should be no problem at all. @springmeyer: Did you test it with planet import? |
Can confirm this problem with Mapnik 3.0.11 and Mapnik 2.2 and the current openstreetmap-carto pulled earlier this week. All of the global level maps (through level 5 or so) are malformed. I see exactly the same image as reported by tds4u earlier. Note that OSMBright from MapBox works correctly using Mapnik 3.0.11, but it doesn't use water-polygons, it only uses simplified-land-polygons-complete-3857 and land-polygons-split-3857. |
Thanks for the confirmation. Certainly something we need to look at. @pnorman Any idea why some users suffer from this and other don't? |
No. I'll see if I can reproduce. |
Followup. I was able to get clean world level images by changing project.mml to use the ocean color for the background and land-polygons-split-3857/simplified-land-polygons-complete-3857. Have only tried the first few zoom levels so far. This was the only change made to the mml file - replacing background color and the two layers from water to land. From this experiment, I have to conclude that there is something squirrely about the water polygons as they are processed by Mapnik. |
Having tried recent water polygons on several versions of Mapnik, I'm unable to reproduce, so I'm concluding that the issue is something local or a problem specific to some version of Mapnik, neither of which are fixable in this repo. |
Note that we have three people reporting the same problem, so I'd still like to keep an eye on this. I wouldn't like to see this problem suddenly showing up on production without us having an idea of what might cause it. |
Those that are able to replicate: does the problem go away if you delete the |
I don't know what would cause this. |
Let me think...
So the problem maybe is not inside Mapnik, maybe inside conversion or rendering tool chain. Maybe OGR or similar libraries? But how to check this? |
Mapnik doesn't read CartoCSS, it reads Mapnik XML. Carto converts CartoCSS to Mapnik XML. You could rule it out by building the XML on a known good machine, but I can't see any way for it to be a cartocss problem with that last picture of inverted water bands. |
So, I tested further. With my workaround (#2101 (comment)) I had some blocks on the 180° meridian. That happen if rendering was made till level 10 via MapProxy - rendering till level 8 won't generate such blocks!!! After that all is fine for rendering from 8 to maximum level. |
As @imagico commented, could it be related to the reprojection? Is mapnik making any reprojections here? If so, is it using any libraries which might change the behavior depending on version? @codebrane what zoom range did you observe problems on? |
If you're seeing them on zoom 10+, that means you're seeing problems with both the What OS are you using, as well as what geos and proj versions is your Mapnik linked against? |
Which software would that be? |
Apparently the setups used by @codebrane and @tds4u. But since the discussion in this issue was not particularly goal oriented overall so far it is not really clear under what conditions exactly Mapnik performs a reprojection. It is possible that this can be prevented reliably (at least by making sure there isn't any other proj4 string involved than the one in this style) although some applications might be hardwired in a way that makes this impossible. |
And therefore this issue can be closed. |
While this issue is currently closed, it's disappointing that we never confirmed the cause, though it is most likely related to round-trip reprojection of the simplified ocean polygon shape file. Andy Alan seemed to think it was a problem with incorrect setup on the affected servers, since this reprojection should not be allowed: "It appears to me to be a fairly straightforward problem - the There were some thoughts that the shapefiles were a problem, but changing to shape files to add @pnorman what are your thoughts? Do you agree with Andy's comments that this was due to inappropriate setups on the affected servers? |
It has been a long time since this was closed, so it might be worth invastigating this again. |
Thanks for the comment, I was about to ask you if you could test it. If water polygons are generally working elsewhere, I think we could take the risk to go this way too, because the stakes are high enough. As @Adamant36 said, it's possible to revert this if something will go wrong. I would start with making test code branch and asking again affected users if they still see the problem. If not, we could merge it soon after release, so there will be plenty of time to do additional testing. |
If this is done - and i don't want to prejudice the opinion of other maintainers in any way here - it would be important to come to a consensus how long to wait afterwards before changes that depend on ocean polygons are made (which would prevent a simple revert). |
@rrzefox thank you for the update, and for maintaining that archive! I believe if the German fork is rendering properly, we are likely to be able to implement the same.
I'd suggest merging the changes to Master right after the next release, which will give current contributors and other interested parties several weeks for testing before the changes are released. Then we should wait 1 more month after the water polygons are in production before merging PRs that depend on this change. Example: if the new release is tomorrow, we should submit a PR using the split and simplified water polygons; and hopefully we can merge this in a week or two. Then we will have 3 or 4 weeks with the water polygons merged to master, but not yet released. Assuming the next release after that is in mid-March, we would then wait till mid or late April before merging any PRs that depend on the change. Does that sound like enough time for testing? |
We are considering changing to ocean polygons again, which risks reintroducing this issue. See PR #3694 - however @rrzefox has reported that he no longer has the problem. @codebrane , @xan-der and @tds4u - would you be able to test the new branch from the PR to see if this will now work on your current system? The branch name is If anyone else had seen this bug back in 2016, please let us know if the shapefiles are now working for you. |
On my local machine with a fresh download of all shape files, the ocean polygons do not render. I can fix this by deleting the .index files. I've done this also for the low-zoom boundaries (otherwise the rendering eats all the memory and crashs) and for ice shields. What is the role of the .index files? Are there side-effects deleting them? If not, could we do this automatically in our shapefile download script? |
We should automatically be building new ones as part of the download. |
When building new ones (with default options: |
@StyXman pointed out in imagico/poly_grid#1 (comment) that this might be specific to mapnik master and does not occur in released versions. |
It's also broken for mapnik-3.1.0, which is the one that Rendering those shapefiles with |
Does it work fine without shapeindex as @sommerluk described? |
Indeed it does with |
This could maybe be a missmatch of the Mapnik package of the Linux distribution (which provides also the program that generates the index files) and the node-mapnik version used by kosmtik? |
Given that #4092 has been merged in the meantime, which loads the shapefiles in the database. Does this have an effect on this issue. Can it be closed? |
We were never able to solidly isolate what was going on, and since the issue was reported, we've completely redone how shapefiles are handled, loading them into the DB. |
Using Mapnik 3.0.9 with openstreetmap-carto 2.39.0 produces tiles with a blue tint. The coastlines are not visible. Using the version from master, the land and inland water is fine but the sea isn't rendered. This tile shows the issue with 2.39.0. I'm using polytiles.py with osm.xml generated by carto from project.mml. If I use the default Mapnik osm.xml on the same data it renders fine but of course with the older OSM style.
The text was updated successfully, but these errors were encountered: