Skip to content
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

Issue Loading GML Layer in osgEarth #2707

Open
Shreyansh-prog opened this issue Feb 17, 2025 · 1 comment
Open

Issue Loading GML Layer in osgEarth #2707

Shreyansh-prog opened this issue Feb 17, 2025 · 1 comment
Labels
support Support questions

Comments

@Shreyansh-prog
Copy link

osgEarth Version (required): 3.7.1

Description of the problem:

I am trying to load the attached GML file in osgEarth using OGRFeatureSource. The GML file loads successfully, and I can query features from OGRFeatureSource.

However, nothing renders in the map viewer. Upon investigation, I found that the layer's SRS/featureProfile is empty, which might be causing the issue.

When I load the same GML file in QGIS, it displays correctly using its own SRS (srsName="urn:ogc:def:crs:EPSG::2871").
Image

Could you please help me resolve this issue and properly read the GML layer in osgEarth?

Thanks!

What you have tried:

Screenshot, code block, or data file that will help reproduce the issue:

Gml Dataset.zip

@gwaldron
Copy link
Owner

In osgEarth you need to reference your feature data, and then create a stylesheet describing how to display it.
Here's an example:

    <FeatureModel name="GML Samples">
        <OGRFeatures>
            <url>Reaches_689.gml</url>
        </OGRFeatures>
        <styles>
            <style type="text/css">
                default {
                    stroke: #ffff00;
                    altitude-clamping: terrain;
                    render-depth-offset: 1m;
                }
            </style>
        </styles>
    </FeatureModel>

The OGRFeatures block loads the GML data itself.

Then the styles block describes how to render that data. In this case, draw yellow lines clamped to the terrain, and add an offset to prevent the line from "fighting" with the terrain itself.

The tests folder in the repository contains loads of examples of how to style feature data.

Hope this helps!

@gwaldron gwaldron added the support Support questions label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support questions
Projects
None yet
Development

No branches or pull requests

2 participants