|
POST
|
Well, I don't worry about testing your API (and I'm glad that you do this), but I worry about all the developers who want to write testable code with your SDK. Therefore I was hoping for some examples and recommendations. The server mocking functionality would be a start for sure, and I hope you can bring it back soon for the TDD guys out there.
... View more
03-02-2015
12:38 AM
|
1
|
2
|
2794
|
|
POST
|
Although the DuckTyping approach looks interesting, it still leaves it to the developer to hand-write all the interfaces. Moreover, when doing so, any typo will compile and lead to exceptions at runtime. I fully agree with Juho that unit testing of applications based on the Runtime SDK for .NET is currently very cumbersome. It is obvious that design goals for testability didn't play a part when the Runtime SDK was developed. The result is a lack of seams where original classes can be replaced with stubs: The SDK does not define interfaces, and most of the classes are sealed and/or have non-public constructors. If at least classes were not sealed, it would be possible to create stubs for them with common isolation or mocking frameworks such as Moq, FakeItEasy or NSubstitute. I also would like to see a sample project of unit tests for the API. How do you isolate the class under test from its dependencies? How do you create stubs for parameters that you pass to the tested method, if that parameter is of a sealed type with no public constructor?
... View more
02-27-2015
07:03 AM
|
1
|
5
|
2794
|
|
POST
|
Drew, a search on support.esri.com only returns this thread. I got the information through my local Esri software distributor. Maybe you can get more information by opening a support incident at Esri.
... View more
09-23-2014
11:40 AM
|
0
|
0
|
8013
|
|
POST
|
Dear all, Can anybody tell me how to read the Caption, Message and Tooltip properties of an ArcMap Add-in Button programmatically? The properties are defined in the Config.esriaddinx file and are shown correctly in ArcMap. However, when I try to query them, say, in the Button's OnClick method, I only get an empty string: public class DummyButton : Button { protected override void OnClick() { MessageBox.Show(string.Format("Button '{0}' was clicked!", this.Caption)); } } On the other hand, it is possible to change the properties Message and Tooltip programmatically, and the update is reflected both in ArcMap and in code. The Caption can be changed too and will be available in code, although in ArcMap the button's caption won't be updated. But how to get the values that are defined in the config file? Btw, I'm using ArcGIS for Desktop 10.2. Thanks for any hints, Fridjof
... View more
06-12-2014
01:14 AM
|
0
|
2
|
2345
|
|
POST
|
Hi All, I am having the same issue and it's random. [...] Due to govt policy I am not able to remove/add anything and I am hoping that there is an easy solution. Thank you Allison Do you have MS Security Essentials installed on your computer? If so, try to talk to a system administrator to see if they can exclude the path to your data from being scanned.
... View more
09-13-2013
01:03 AM
|
1
|
1
|
2263
|
|
POST
|
This didn't help in my case. Instead, I learned that I had to exclude the FGDB path from being scanned by MS Security Essentials. There seems to be a bug #NIM088911 "When using background processing while Microsoft Security Essentials is running real time protection, the process fails. By either turning off background processing, OR turning off Microsoft Security Essentials, the process works.", but the bug document is only visible to ESRI (and the NSA of course). Why?
... View more
07-02-2013
08:23 AM
|
1
|
2
|
8013
|
|
POST
|
Tim, Apparently the Intersect tool now has an additional "Rank" value that can be optionally set. This seems to have changed the syntax a bit, but I couldn't find an example for use in ArcObjects in the documentation. However, when you run the Intersect tool in interactive mode, you can see that when not entering rank values, some "#" characters are inserted at the end of each input dataset path. Maybe this will work for you too? intersect.in_features = pathToFirstInputFeatureClass & " #;" & pathToSecondInputFeatureClass & " #" Otherwise you'd probably have to set a 2nd column for the value table, but it will also involve setting the right data type for each column etc... too much code in my opinion if you can use a String-based approach.
... View more
05-18-2013
11:24 PM
|
0
|
0
|
627
|
|
POST
|
However, IFeatureSelection doesn't work with IEnumFeature. What to do? I have to use ISelection instead. Are there any other ways? If you start from a FeatureLayer, cast it to IFeatureSelection and get IFeatureSelection.SelectionSet. ISelectionSet.Search returns a search cursor that you can use to loop over all selected features in the layer.
... View more
05-18-2013
12:32 PM
|
0
|
0
|
1002
|
|
POST
|
I haven't tried it yet but seems like instead of using this-: private Queue<IGPProcess> _myGPToolsToExecute = new Queue<IGPProcess>(); ... _myGPToolsToExecute.Enqueue(bufferTool); _myGPToolsToExecute.Enqueue(clipTool); _gp.ExecuteAsync(_myGPToolsToExecute.Dequeue()); why not this - private Queue<string> _myGPToolsToExecute = new Queue<string>(); private Queue<IVariantArray> _myGPToolsParams = new Queue<IVariantArray>(); ... _myGPToolsToExecute.Enqueue(bufferTool); _myGPToolsParams .Enqueue(bufferParams); _myGPToolsToExecute.Enqueue(clipTool); _myGPToolsParams .Enqueue(clipParams); _gp.ExecuteAsync(_myGPToolsToExecute.Dequeue(),myGPToolsParams.Dequeue()); Why not write a small class MyTool with 2 public properties string Name and IVariantArray Parameters, and then define the queue as Queue<MyTool>? I'm still curious about my 2 questions re: converting the .tbx to a DLL though if anyone has thoughts on that. I've been using the ArcGIS Toolbox References in some integration tests, but actually I'm not happy with them, therefore I'm going back to the previous syntax with tool name + IVariantArray. I also observe that the tool DLL uses the .NET runtime 4.0, but what's worse in my case is that the assembly builder seems to hardcode the toolbox location into the DLL. Therefore, if you move the toolbox somewhere else, the DLL won't help you any more.
... View more
05-18-2013
08:50 AM
|
0
|
0
|
966
|
|
POST
|
One way I think that might work: 1. Call IProximityOperator::ReturnDistance to find the distance between the polyline and polygon. 2. Call ITopologicalOperator::Buffer with the distance as the input to create a polygon. 3. Find the touch point on one geometry to the boundary of the buffer polygon. This will be the nearest point of the geometry. 4. Using the same steps or call ReturnNearestPoint to find the nearest point on the other geometry. Thanks Weifeng! I had the same task, and you got me on the right track. I Just tried a slightly modified implementation that should work for other high-level geometries as well: 1. Call IProximityOperator::ReturnDistance to find the distance between the polyline and polygon. 2. Call ITopologicalOperator::Buffer on the first geometry with the distance as the input to create a polygon. 3. Call ITopologicalOperator::Intersect to find the touch point(s) of the buffer with the second geometry. 4. Call IHitTest::HitTest on the first geometry with all touch points as query points to find the closest point on the first geometry. 5. Call IHitTest::HitTest on the second geometry with the result of 4. that has the shortest distance (if there is more than 1 point, actually the distance should be always the same).
... View more
05-16-2013
06:00 AM
|
0
|
0
|
2507
|
|
POST
|
Toly, TextFileWorkspaces changed slightly in the 10.1 release of ArcGIS, if you modify your code in this way it should work in 10.1. Type factoryType = Type.GetTypeFromProgID("esriDataSourcesFile.TextFileWorkspaceFactory"); Hope this helps, -Brent Brent, Thanks for the hint. I just found this thread because I had the same issue. It would be helpful if the pages http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Interacting_with_singleton_objects/00010000043p000000/ and http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//000100000408000000 reflected the change. Cheers
... View more
05-08-2013
10:37 AM
|
0
|
0
|
1472
|
|
POST
|
Hi, I've been observing the same issue. We have a bunch of integration tests that operate on a file geodatabase. All tests run successfully in 10.0, but in 10.1 SP1 some tests randomly fail with the above message. The file geodatabase was created in 10.0, but the Upgrade Geodatabase button is greyed out.
... View more
03-28-2013
03:23 PM
|
0
|
0
|
8013
|
|
POST
|
Hi, I just installed the X-Ray for Geodatabases Add-In on a machine with ArcGIS Desktop 10.0 SP5. The Add-In appears in the Add-In Manager, but there is no X-Ray Extension in the Extensions window, there is no X-Ray dockable window, and there is no Show X-Ray window button (not even an Add-In Controls category) in the Customize window. What am I missing...?
... View more
03-15-2013
03:06 AM
|
0
|
0
|
848
|
|
POST
|
ISpatialReference sRef;
ifMerged = fcMerged.GetFeature(1);
IPoint pt = new PointClass();
pt = (IPoint)ifMerged.ShapeCopy;
sRef = pt.SpatialReference;
IPoint fromPoint = new PointClass();
IPoint toPoint = new PointClass();
fromPoint = pcTempPair.get_Point(0);
toPoint = pcTempPair.get_Point(1);
IPolyline5 ipPairLine = new PolylineClass();
ipPairLine.ToPoint = toPoint;
ipPairLine.FromPoint = fromPoint;
ipPairLine.Project(sRef);
IGeometry igPairLine = (IGeometry)ipPairLine;
IRelationalOperator relOperatore = (IRelationalOperator)gbBaseMap;
Boolean contain = relOperatore.Contains(igPairLine);
Insu, It seems that you are projecting the polyline without assigning its spatial reference first. Try to assign sRef to ipPairLine.SpatialReference first and then project it to gbBaseMap.SpatialReference (if required). See if that helps. You might also want to check for ipPairLine.IsEmpty after applying ipPairLine.SnapToSpatialReference() and a Simplify as suggested by Dubravko. Regards, Fridjof
... View more
11-22-2012
04:15 AM
|
0
|
0
|
513
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-16-2022 09:21 AM | |
| 1 | 05-19-2025 12:15 AM | |
| 2 | 03-27-2023 07:31 AM | |
| 1 | 03-01-2023 10:59 PM | |
| 1 | 11-18-2022 06:55 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-26-2025
11:19 PM
|