osgearth
osgearth copied to clipboard
FeatureImage rendering incorrectly with features that cross the dateline
We noticed large polygons at low zoom levels when rendering the osm-oceans layer, which you can reproduce with this
<FeatureImage name="Water"
features="data:osm-oceans">
<styles>
<style type="text/css">
default {
fill: #ffbf6f;
}
</style>
</styles>
</FeatureImage>
<XYZFeatures name="data:osm-oceans">
<url>http://readymap.org/readymap/mbtiles/osm-oceans/{z}/{x}/{-y}.pbf</url>
<min_level>0</min_level>
<max_level>9</max_level>
<profile>spherical-mercator</profile>
<format>pbf</format>
</XYZFeatures>
I've isolated one of the bad features which crosses the dateline and it's in this shapefile badmercator.zip which can be rendered like this
<FeatureImage name="Water">
<OGRFeatures url="badmercator.shp"/>
<styles>
<style type="text/css">
default {
fill: #ffbf6f;
}
</style>
</styles>
</FeatureImage>
The features probably need to be split across the dateline before rendering but where that needs to happen in the pipeline needs to be assessed.