Select to view content in your preferred language

Polyline 3D relative to ground with expression

287
0
09-21-2024 09:47 AM
Labels (1)
TfenDbg
New Contributor

Hello,

I want to elevated a pipeline from the ground with differentes heigth. Like house Pipes ... !

My polylines have Z values.

TfenDbg_1-1726937181371.png

 

I call them with geoserver wfs service

 

wMain3D = new WFSLayer({
          url: "http://127.0.0.1:8081/geoserver/wfs",  
          name: "r:wMain3D",  
            elevationInfo: {
              mode: "relative-to-ground",
              featureExpressionInfo: {
              expression: "Geometry($feature).paths[0][0].z"
               // 
            },  
            unit: "meters"
            },
        });

 

Response from the network seem good

 

{
            "type": "Feature",
            "id": "wMain3D.13",
            "geometry": {
                "type": "MultiLineString",
                "coordinates": [
                    [
                        [
                            35000.5836,
                            304238.1743,
                            0.5
                        ],
                        [
                            35001.225,
                            304239.1565,
                            0.5
                        ]
                    ]
                ]
            },
            "geometry_name": "the_geom",

 

But pipe stay at the ground 😞

TfenDbg_0-1726936923518.png

I think my expression is not good here :

 

"Geometry($feature).paths[0][0].z"

 

Maybe i need to iterate the linestring, but this method (elevationInfo) accept this kind of things?

I try this one :

When i want to see z value with label, nothing appears

 

 wMain3D.labelingInfo = [{
      labelExpressionInfo: {
           expression: "Geometry($feature).paths[0][0].z"  
         },
         symbol: {
           type: "text",  
           color: "red",
           haloColor: "white",
           haloSize: "1px",
           font: {
             size: "12px",
             weight: "bold"
           }
         }
      }];

 

 

If anyone have solution

Thanks

 

 

0 Kudos
0 Replies