|
POST
|
Using ArcGIS Runtime for .NET 100.0 and WPF. I have a geometry created using the sketch editor ... _traceGeometry = await Mapview.SketchEditor.StartAsync(SketchCreationMode.Polyline, true); Then later I want to create a feature using this geometry. However, the feature class has z values. So when I try to save it via ... await table.AddFeaturesAsync(features); I get an exception: "The shape must have a Z value." My question is how can I add z values to this geometry? Do I need to recreate a new geometry using PolylineBuilder and adding a z-value for each point? Initially all points can (and should) have 0 for a z-value, but eventually, we will run a calculation that adds z-values based on underlying elevation. Alternatively, will the sketch editor create a z-enabled geometry if there is underlying elevation data included as a map layer?
... View more
01-13-2017
06:56 AM
|
0
|
1
|
2296
|
|
POST
|
Another anecdote that might be helpful here. We had a developer using Visual Studio 2012 that ran into this error. I am running Visual Studio 2015, so I didn't get the error ... because the C++ redistributable libraries were already installed. Bottom line is if you are running a version of Visual Studio prior to 2015, you will most likely see this error, and the solution (as you stated above) is to install the restributable libraries.
... View more
01-10-2017
10:29 AM
|
1
|
1
|
1679
|
|
POST
|
My application is a map-based planning tool. The user can create a "plan" using the same kind of workflow you might use for something like MS Word, where our "plan" is similar to a Word document. User creates a new plan, adds or edits features and can save the plan. The key is if the user quits or opens a new plan before saving, we don't want to keep any of the changes he's made in the interim (e.g. edits, new features or deleting existing features). Ideally, a transaction mechanism on the geodb would be the best thing if it existed. Then we can just commit or rollback changes as needed. Since that doesn't exist, my current solution is to use graphics as temporary "work in progress" items. When the user saves, graphics are converted to features. When the user opens a new plan, existing features are queried and displayed as graphics. Other ideas I have include: Using a local server and re-syncing the geodb, but I don't know if that's possible. If so, how might I do that? I don't want to user a temp geodb since that is something we did once with ArcObjects, and it was a very unstable. What are the methods to find changes on FeatureTable? Is there a property I can change or other way to reset that sync point without actually re-syncing? Thanks!
... View more
12-22-2016
12:59 PM
|
0
|
1
|
1202
|
|
POST
|
Alternatively, if there was a way to rollback changes, that would work too.
... View more
12-20-2016
12:31 PM
|
0
|
3
|
1202
|
|
POST
|
I have generated a runtime geodatabase from a sync-enabled feature service as described on this page ... Create an offline map—ArcGIS Runtime SDK for .NET | ArcGIS for Developers . That works OK, but is somewhat unreliable in that I had to try multiple times to get it to download. Maybe I'll post a separate question on that. In code I do something like this to setup my map ... var gdb = await Geodatabase.OpenAsync(master.GeodatabasePath); foreach (var table in gdb.GeodatabaseFeatureTables) { await table.LoadAsync(); var layer = new FeatureLayer(table); layer.Id = table.TableName; mapView.Map.OperationalLayers.Add(layer); } Then later ... var attributes = new Dictionary<string, object>(); attributes.Add("PlanId", 1); attributes.Add("PlanGuid", Guid.NewGuid()); var layer = Mapview.Map.OperationalLayers["Aoi"] as FeatureLayer; var newFeature = layer.FeatureTable.CreateFeature(attributes, _aoiGeometry); await layer.FeatureTable.AddFeatureAsync(newFeature); ... That works fine too. However, I noticed that the feature is written immediately to the attached geodatabase. Is there a way to delay writing to the database until I make an explicit call? I suppose I could initially create graphics, and then when I want to persist them, create features from the graphics. That's a simple enough concept but seems convoluted in that I would also have to created a bunch of graphics from existing features every time my query criteria changes. Or is there a better workflow instead? My goal is to work offline only. We will never sync back to the server after creating the initial (empty) geodatabase. I do need to be able to perform all of the basic create, update, insert, select operations on the feature data. Would FeatureCollection be a viable alternative?
... View more
12-20-2016
08:23 AM
|
0
|
4
|
1699
|
|
POST
|
Thanks!! I can send you my test code if you need it.
... View more
12-14-2016
12:30 PM
|
0
|
1
|
800
|
|
POST
|
Morten Nielsen, you nailed it! After some testing and debugging, it looks like my draw button still has focus. If I force focus to the map view (i.e. MyMapView.Focus() ), the behavior goes away. Now the next question is why doesn't the MapView gain focus automatically when I do SketchEditor.StartAsync() and start drawing?
... View more
12-14-2016
12:05 PM
|
0
|
0
|
800
|
|
POST
|
Thanks again! It's seems counter-intuitive that Enter/Return key press would cancel the operation. It seems more logical that Enter would complete the operation, while ESC would would be more appropriate for cancel. But the confusing thing to me is that Enter does nothing while editing in runtime 10.2.7 or in ArcMap. Michael Branscomb, is any particular reason for the change in v100.0 and more specifically choosing Enter to cancel the operation instead of ESC?
... View more
12-14-2016
07:48 AM
|
0
|
2
|
800
|
|
POST
|
This has gotten me on the right track, but I have a quick follow-up .... If I have this line of code to sketch a shape, it throws an exception if the user presses the Enter/Return key while the shape is editable. I've tried capturing the key press on both the map view and main window, but this happens before the key down or up events. _geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Polyline, true); I'm attaching a screenshot of the exception details.
... View more
12-14-2016
06:53 AM
|
0
|
4
|
2611
|
|
POST
|
Awesome! Such a small detail made a huge difference. Thanks!!
... View more
12-13-2016
09:28 AM
|
0
|
1
|
2611
|
|
POST
|
I have code that I wrote in .NET runtime 10.2.7 using the MapView.Editor that allows the user to draw a polyline on the map. I'm sure it came from one of the samples. I'm trying to do the same thing in Quartz (WPF only), and it doesn't seem to work as expected. When I click my button, the map is clearly in editor mode, and I can click to draw the polyline. However, there doesn't seem to be a way to end the editing mode. Typically this is a double-click, but that does nothing. I'm left with the polyline in edit mode. Maybe I'm missing a step, but I couldn't find an example in the docs or in the sample code. Here is my button click code: private async void Button_Click(object sender, RoutedEventArgs e)
{
var geometry = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Polyline);
GraphicsOverlay graphicsOverlay;
if (MyMapView.GraphicsOverlays.Count < 1)
{
graphicsOverlay = new GraphicsOverlay();
MyMapView.GraphicsOverlays.Add(graphicsOverlay);
}
else
graphicsOverlay = MyMapView.GraphicsOverlays[0];
var outlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Colors.Black, 1.0);
var line = new Graphic(geometry, outlineSymbol);
graphicsOverlay.Graphics.Add(line);
}
... View more
12-12-2016
01:25 PM
|
0
|
15
|
5109
|
|
POST
|
First thing I would try is to see if you can open the database with something other than code. Since the .geodatabase is just a SQLite database, I would suggest using DB Browser for SQLite. That should let you determine whether or not your database is corrupted, etc. Then make sure both the database and the folder it's are readable by everyone on windows. If you want to rule out permissions all together, then grant all privileges to all uses on the file and folder. Or you can try running your code as administrator. I had a similar problem after installing a .geodatabase into the C:/Program Files/ folder that was only accessible by the administrator.
... View more
04-19-2016
09:01 AM
|
0
|
0
|
2950
|
|
POST
|
Thanks for the replies Michael and Morten. We are currently using the map package approach with WPF 10.1.1, and I was investigating impact and changes needed to move to .NET 10.2.4. I have the server software, but it's not installed. I will investigate that route sometime soon because the packages can be a little cumbersome at times. Is there a ballpark timeframe for runtime geodbs from desktop? Next release, next quarter, next year? Thanks!
... View more
10-28-2014
08:02 AM
|
1
|
0
|
1327
|
|
POST
|
We're not using Server, but we do have Standard licensing. Is that the only way to get an editable geodatabase?
... View more
10-23-2014
06:38 PM
|
0
|
3
|
1327
|
|
POST
|
A couple of questions regarding local geodatabase ... Can I access a .gdb directly (e.g. Geodatabase.OpenAsync) or do I need to package for runtime via ArcMap to get a .geodatabase file? Also, is access to the .geodatabase file read-only or can I make edits?
... View more
10-23-2014
02:14 PM
|
0
|
5
|
4218
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-16-2019 09:01 AM | |
| 1 | 08-16-2019 10:47 AM | |
| 1 | 01-18-2019 08:48 AM | |
| 1 | 01-10-2017 10:29 AM | |
| 1 | 10-28-2014 08:02 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|