osgearth icon indicating copy to clipboard operation
osgearth copied to clipboard

FeatureImage rendering incorrectly with features that cross the dateline

Open jasonbeverage opened this issue 1 year ago • 0 comments

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.

jasonbeverage avatar Jul 14 '22 17:07 jasonbeverage