Select to view content in your preferred language

Create a 3D Polyline

1217
5
08-04-2017 09:00 AM
ManelKEDDAR
Deactivated User

Helloe , i'm trying to create a 3D polyline , i used the following code

public static Polyline CreatePolyLine3D(MapPoint pointDepart , MapPoint pointArrive)
{
var stops = new MapPoint[] { pointDepart, pointArrive };
//Create a new Polyline

var mypolyLine = new Polyline(stops ,SpatialReferences.Wgs84);
return mypolyLine;

}

i'm looking for any interface or method that can help me to say if the geometry have a Z value or not for example in arcObject there's the interface IZAware that identifies geometries that can have persistent Z values attached to their vertices .  IPolyline polyline = new PolylineClass();
(polyline as IZAware).ZAware = true;
how can i do that with arcGis run time v 100.1 
thanks in advance

cheers

0 Kudos
5 Replies
NagmaYasmin
Esri Contributor

Hi Manel,

You may use Polyline.HasZ property to know whether that geometry has the z value.

Polyline Properties 

Hope that helps.

Nagma

0 Kudos
ManelKEDDAR
Deactivated User

This property is used just for read not write

Envoyé de mon iPhone

Le 4 août 2017 à 18:06, Nagma Yasmin <geonet@esri.com> a écrit :

GeoNet

Re: Create a 3D Polyline

reply from Nagma Yasmin in ArcGIS Runtime SDK for .NET - View the full discussion

Hi Manel,

You may use Polyline.HasZ property to know whether that geometry has the z value.

Polyline Properties

Hope that helps.

Nagma

Reply to this message by replying to this email, or go to the message on GeoNet

Start a new discussion in ArcGIS Runtime SDK for .NET by email or at GeoNet

Following Re: Create a 3D Polyline in these streams: Inbox

Following Nagma Yasmin in these streams: Inbox

This email was sent by GeoNet because you are a registered user.

You may unsubscribe instantly from GeoNet, or adjust email frequency in your email preferences

0 Kudos
NagmaYasmin
Esri Contributor

You can use the PolylineBuilder.AddPoint(Double, Double, Double) method to add x,y and z value 

PolylineBuilder Class --> AddPoint(Double, Double, Double)

MultipartBuilder(T).AddPoint Method (Double, Double, Double) 

Hope that helps.

Nagma

0 Kudos
ManelKEDDAR
Deactivated User

Hello Yasmin ,

Thanks for your answer , i don't know if what i'm doing is correct actually i created a 3D MapPoints ans with this two 3D MapPoint i'll create a 3D PolyLine , i don't know if this will work , nowi  want to know how i can do to display this 3D PolyLine on a Scneview here's my code :

MapPoint pointDepart = new MapPoint(-79.337936, 8.638903, 6.796, SpatialReferences.Wgs84); //start
MapPoint pointArrivee = new MapPoint(-80.035568, 9.432302, 5.8769, SpatialReferences.Wgs84);//arrival
var poly = CreatePolyLine3D(pointDepart, pointArrivee);

SceneView.Scene = new Scene();

//Create a new Graphic with the composite symbol , add it to the graphics overlay
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
SceneView.GraphicsOverlays.Add(graphicsOverlay);
Camera newCamera = new Camera(pointDepart, 1500, 0, 80, 0);
SceneView.SetViewpointCameraAsync(newCamera);

Please Help

Thanks

0 Kudos
ManelKEDDAR
Deactivated User

Hello Yasmin ,

Thanks for your answer , i don't know if what i'm doing is correct actually i created a 3D MapPoints ans with this two 3D MapPoint i'll create a 3D PolyLine , i don't know if this will work , nowi  want to know how i can do to display this 3D PolyLine on a Scneview here's my code :

 

MapPoint pointDepart = new MapPoint(-79.337936, 8.638903, 6.796, SpatialReferences.Wgs84); //start
MapPoint pointArrivee = new MapPoint(-80.035568, 9.432302, 5.8769, SpatialReferences.Wgs84);//arrival
var poly = CreatePolyLine3D(pointDepart, pointArrivee);

SceneView.Scene = new Scene();

//Create a new Graphic with the composite symbol , add it to the graphics overlay
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.SceneProperties.SurfacePlacement = SurfacePlacement.Relative;
SceneView.GraphicsOverlays.Add(graphicsOverlay);
Camera newCamera = new Camera(pointDepart, 1500, 0, 80, 0);
SceneView.SetViewpointCameraAsync(newCamera);

 

Please Help

Thanks

0 Kudos