Projection artifacts when drawing polygons #1399

Closed
gravitystorm opened this Issue Aug 16, 2012 · 7 comments

Comments

Projects
None yet
4 participants

I get small projection artefacts when drawing polygons. The source is a shapefile in epsg:27700 (osgb), and the destination is spherical mercator.

http://thunderflames.org/temp/mapnik-projection-mod-tile.png
http://thunderflames.org/temp/mapnik-projection-tilemill.png

The projection "wedges" appear in both TileMill and when using mod_tile. They appear to occur in the corner of every metatile, so the ones from mod_tile are larger and further apart - so I don't think that it's related either to the underlying data nor to tilemill/mod_tile

I've found this in 2.1-stable commit 2375fcd . The source files are open data from Ordnance Survey, and I'll try to get some simple steps to reproduce.

Owner

artemp commented Aug 16, 2012

@gravitystorm - can you try turning clipping off e.g clip="false" ?

@artemp - indeed, the artefacts disappear with clip="false".

Owner

springmeyer commented Aug 20, 2012

We likely need to inflate the clipping extent more when reprojection is happening and the layer bbox is not square against mercator. This will be tricky to get right, so yeah, turning off clipping manually seems like a good workaround for now.

@springmeyer springmeyer pushed a commit that referenced this issue Aug 23, 2012

Dane Springmeyer avoid clipping polygons if reprojecting to work around #1399 until we…
… have a more proper solution (refs #1282)
c3dae01
Owner

springmeyer commented Aug 23, 2012

I've replicated with this shapefile (wget http://www.wfas.net/maps/data/fdc_f.zip) which is in +init=EPSG:2163. (Interestingly this shapefile also suffers from a different problem where data in New England disappears at <= z2).

So in c3dae01 I have disabled clipping for polygon rendering when reprojecting. This seems like the safest thing to do for the 2.1 release until we figure out a better method for avoiding this problem.

Owner

springmeyer commented Aug 23, 2012

moving to 2.1.1 milestone to revisit then.

@springmeyer springmeyer pushed a commit that referenced this issue Aug 23, 2012

Dane Springmeyer fix test failure after c3dae01 - refs #1399,#1282, and #1433 769fc89
Contributor

strk commented Dec 21, 2012

this sounds like an issue similar to the simplify geometry #1639 (ie: dependency of a feature on reprojection taking place). We could handle in the same way there (disable if reprojecting).

Owner

springmeyer commented Dec 21, 2012

@strk, this is because the clipping bbox is in geographical coordinates and so when the source data is in a different projection, the clipping box may take away the wrong data. This was handled by disabling clipping when reprojecting. So, this is done/fixed. Discussion of better ideas that wholesale disabling of clipping should take place at #1433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment