gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.48k stars 774 forks source link

TerrainConstraint - does not work properly with a projected map #2478

Closed gwaldron closed 5 months ago

gwaldron commented 5 months ago

Describe the bug TerrainConstraints are buggy with a projected profile map.

To Reproduce Load this earth file into osgearth_imgui.

<map>
    <options>
        <profile srs="+proj=utm +zone=31 +units=m +datum=WGS84 +no_defs"
                 xmin="615900.00"
                 xmax="616100.00"
                 ymin="5444175.00"
                 ymax="5444375.00"/>
    </options>

    <TerrainConstraint min_level="1">
        <remove_interior>true</remove_interior>
        <OGRFeatures>
            <profile srs="+proj=utm +zone=31 +units=m +datum=WGS84 +no_defs"
                 xmin="615900.00"
                 xmax="616100.00"
                 ymin="5444175.00"
                 ymax="5444375.00"/>
            <geometry>POLYGON((615950 5444225 0, 616050 5444225 0, 616050 5444350 0, 615950 5444350 0))</geometry>
        </OGRFeatures>
    </TerrainConstraint>
</map>

Expected behavior The earth file above should have a cut-out hole.