Which local service layer we can use to load a sceneLayer

828
11
08-25-2017 01:52 AM
ManelKEDDAR
New Contributor III

hello ;

for displaying featureLayers as feature Tables we use ServiceFeatureTable , i'm trying to edit a sceneLayer with creating 3D geometry but i don't know how to load the table for example when i work with feature layers and 2D Features  i use the following code :

 

ar featureTableUri = new System.Uri(" URI");
var table = new ServiceFeatureTable(featureTableUri);
await table.LoadAsync();
var layer = new FeatureLayer(table); 

MyMapView.Map = new Map();
MyMapView.Map.OperationalLayers.Add(layer);
var builder = new PolygonBuilder(SpatialReference.Create(2154));

var partOne = new Part(builder.SpatialReference);
//add a line segment going from (0,0) to (0,7)
partOne.Add(new Esri.ArcGISRuntime.Geometry.LineSegment(0,1670.82, 1500, 1400));
//add an other segment from (0,7) to (3,6)
partOne.Add(new Esri.ArcGISRuntime.Geometry.LineSegment(new MapPoint(1500,1400), new MapPoint(1300, 1200)));
builder.AddPart(partOne);
Esri.ArcGISRuntime.Geometry.Polygon polyGeom = builder.ToGeometry();

var description = "description";
var attributes = new Dictionary<string, object>();
attributes.Add("SHAPE", polyGeom);
if (table.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{

var template = table.FeatureTemplates.FirstOrDefault() ?? table.FeatureTypes.FirstOrDefault(t => t.Templates.Any())?.Templates?.FirstOrDefault();
// var couchesCarte = MyMapView.Map.OperationalLayers[0] as FeatureLayer;
// var selectedFeatures = await couchesCarte.GetSelectedFeaturesAsync();
var feature = table.CreateFeature(template,polyGeom);
await table.AddFeatureAsync(feature);
// push this update (apply edits) to the feature service
IReadOnlyList<EditResult> editResults = await table.ApplyEditsAsync();
// check the results for errors
foreach (var r in editResults)
{
if (r.CompletedWithErrors)
{
Console.WriteLine("Edit to Object '" + r.ObjectId + "' failed: " + r.Error.Message);
}
}
}

this code works perfectly , now i need to know what i should use in case that i have 3D features and a sceneLayers i have 3DFeature class with multipatch geometry and i have created with my own code a 3D cone (3D feature )(3D geometry ) and i have to add this geometry to my feature class till now i 'm using (.slpk) to load the URI of my sceneLayer i need to know how to edit my sceneLayer with creating a new 3D feature ?  

here's how i load my sceneLayer 

Uri sceneURI =new Uri(@"C:\Users\mkeddar\Documents\scene\scene3D.slpk");
ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(sceneURI);

MySceneView.Scene.OperationalLayers.Add(sceneLayer);
await sceneLayer.LoadAsync();

any one can show me how to do that 

thanks

Michael BranscombNagma YasminJennifer NeryMorten NielsenDan Patterson

Tags (1)
0 Kudos
11 Replies
dotMorten_esri
Esri Frequent Contributor

A SceneLayer and a FeatureLayer are two very different things. SceneLayer editing is not something the Runtime supports at this time.

0 Kudos
ManelKEDDAR
New Contributor III

When will it be supported ? is there any calendar for that , cause we want to migrate our software from the ArcObjects to the run time and there's a lot of functionalities that are missing for example extruded geometries , editing scene Layers with 3D features , i need to know if in the next updates   of the run time will support theses functionalities so we can decide if  we will be able to move to the run time version 100.1 or not ? thanks for your answer 

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Editing a scene layer from the runtime is not currently on the roadmap for the near future.

0 Kudos
ManelKEDDAR
New Contributor III

So how to display 3D geometries ? since the runtime allows user to create 3D geometries why there's no possibility to display it ?

0 Kudos
dotMorten_esri
Esri Frequent Contributor

> Since the runtime allows user to create 3D geometries why there's no possibility to display it ?

I'm not sure what you mean by that. We support creating points, lines and polygons, and these can have Z values. The Z value in a GraphicsOverlay will be used to render as an offset from the terrain or the ellipsoid (settable on the graphics overlay). That's all you get. 

There is no support currently for creating true 3D meshes like spheres, cubes etc. You can however use a 3D Model to represent a MapPoint in the GraphicsOverlay, so in that way you can get some sort of 3D rendering dynamically.

You cannot do 3D rendering with FeatureLayer at this point. Feature layer always drapes geometry to the terrain (we're working on improving that for an upcoming release, but still it will support 3D meshes - just point, line, polygon).

0 Kudos
ManelKEDDAR
New Contributor III

sorry for not beeing clear , i want to create 3D meshes (Multipatch geometry) cubes ,Cone ,..ect , and i was thinking that the fact theat adding a Z value to a mapPoint i can create a multipatch geometry .  depending on your answer i think that ArcGis runtime is not yet a mature product to replace arcObjects and for this we will not be able to migrate our software  to the runtime

0 Kudos
dotMorten_esri
Esri Frequent Contributor

The ArcGIS Runtime isn't meant to be a replacement of ArcObjects, and it will never be able to do every single thing AO can do. The goals of the two products are quite different (albeit with some overlap).

0 Kudos
ManelKEDDAR
New Contributor III

ArcObjects will no longer be maintained , that's why we are considering a solution for this .

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Who told you that? ArcObjects powers ArcGIS Server and ArcGIS Pro.

Are you referring to Engine?

0 Kudos