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

Powerlines no longer displayed after refactoring #2702

Open
devil-darkside opened this issue Feb 6, 2025 · 10 comments
Open

Powerlines no longer displayed after refactoring #2702

devil-darkside opened this issue Feb 6, 2025 · 10 comments
Labels
defect It's busted

Comments

@devil-darkside
Copy link

osgEarth Version (required): 3.7.1 build 167

Description of the problem:
With the refactoring of the powerline layer, the powerlines are no longer displayed with OGRFeature. The error displayed is
[osgearth warning] ASSERTION FAILURE (createFeatureCursor @ FeatureSource.cpp:374) !query.buffer().isSet() ...Buffer not supported for non-tilekey queries; ignoring

What you have tried:

 <OGRFeatures name="powerlines-data">
    <url>D:\vector\powerlines.shp</url>
    <build_spatial_index>true</build_spatial_index>
</OGRFeatures>

<PowerlineModel name="towers" max_range="8000" attenuation_range="2000" enabled="true">
        <features>powerlines-data</features>
        <tower_model>
            <uri>power_tower.osgb</uri>
            <attachment_points>
                LINESTRING(6.400827 -0.031 26.068, -6.3926 -0.039 26.068, 3.981 -0.01 29.88, -3.854 0.39 29.89, 6.385 0.0 21.077, -6.35 -0.01 21.077)
            </attachment_points>
            <!-- maximum sag or droop of a single cable -->
            <max_sag>15.0</max_sag>
        </tower_model>
        <layout>
        <tile_size>15000</tile_size>
            <crop_features>true</crop_features>
            <paged>true</paged>
        </layout>
        <styles>
            <style type="text/css">
                cables {
                    stroke: #080808;
                    stroke-width: 0.10m;
                    render-transparent:  true;
                    render-min-alpha:    0.15;
                }
            </style>
        </styles>
    </PowerlineModel>
@devil-darkside devil-darkside changed the title Powerlines no longer displayed after refactorig Powerlines no longer displayed after refactoring Feb 6, 2025
@gwaldron gwaldron added the defect It's busted label Feb 6, 2025
@gwaldron
Copy link
Owner

gwaldron commented Feb 6, 2025

Ah, I didn't think anyone (besides the sponsor) was using this feature :)
The issue is that the refactor assumes you will provide point shapes for tower locations.
We need to complete it to continue supporting implied towers. Defect noted

@gwaldron
Copy link
Owner

gwaldron commented Feb 6, 2025

This is now fixed. If using a shapefile, you must turn on tower location per point with

        <infer_tower_locations>true</infer_tower_locations>

@devil-darkside
Copy link
Author

Still not working.
Same warning:
[osgearth warning] ASSERTION FAILURE (createFeatureCursor @ FeatureSource.cpp:374) !query.buffer().isSet() ...Buffer not supported for non-tilekey queries; ignoring

@devil-darkside
Copy link
Author

devil-darkside commented Feb 7, 2025

pl_test.zip

test_pl_earth.zip

Only 1 tower and no cables are displayed.

@gwaldron
Copy link
Owner

Thanks.
This bug (which I didn't test against) pertains to geographic profile data.
(The assertion is actually a red herring - it does not affect the bug.)

The workaround is to reproject your shapefile data into something like Mercator or UTM.

You may also need to use a simplify filter if your data has too many points along the lines:

    <OGRFeatures name="power-lines" url="sourcedata.shp">
        <filters>
            <simplify tolerance="100m" preserve_all_features="true"/>
        </filters>
    </OGRFeatures>

@devil-darkside
Copy link
Author

Thanks... changing the projection from Geographic/LATLON to UTM solved the issue, but now I can see only three wires not six.

It seems that the wires were splitted when sharing a point along the same line feature.

Image

@gwaldron
Copy link
Owner

Since you extracted this from OSM data there is a cables attribute that designates the number of cables on a run.

And, yes. When inferring tower locations you are going to get a tower at every vertex in the source data.

@devil-darkside
Copy link
Author

It is ok to have at every vertex.

For the cables... i think there is an issue...
For the moment I'm processing all the powerlines without looking at the number of wires.
I expect always 6 wires...

@gwaldron
Copy link
Owner

You can override the cable expression with

<num_cables>6</num_cables>

or any javascript expression, like

<num_cables> feature.properties.cables </num_cables>

@devil-darkside
Copy link
Author

It seems there is always a problem.
Sometimes the number of cables does not reflect the value in the cables attribute.
I'll upload a new sample as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect It's busted
Projects
None yet
Development

No branches or pull requests

2 participants