POST
|
Hello, I implemented geoprocessor in add-in. when I run this Add-in in ArcMap, the result of "result = gp.Execute("FeatureToLine_management", parameters, null);" is automatically added in current view as a new layer. But I want to implement more geoprocessor, and make those results are not appeared at current view. How can I do this? I don't mean background running. I just want resulting featureclass is not appear at view. Thnks. namespace Convexpath_mk2 { public class runConvexPath : ESRI.ArcGIS.Desktop.AddIns.Button { IGeoProcessor2 gp; IGeoProcessorResult result; IVariantArray parameters; public runConvexPath() { gp = new GeoProcessorClass(); parameters = new VarArrayClass(); } protected override void OnClick() { ConvexPathForm newForm = new ConvexPathForm(); newForm.Text = "Test"; newForm.ShowDialog(); Dictionary<string, string> fcDict = new Dictionary<string, string>(); fcDict = newForm.caDi(); string path = fcDict["path"]; gp.SetEnvironmentValue("workspace", path); gp.OverwriteOutput = true; List<string> oriList = new List<string>(); List<string> desList = new List<string>(); Dictionary<pair, pairData> pairDict = new Dictionary<pair, pairData>(); List<pair> pairList = new List<pair>(); Dictionary<string, string> belongDict; FCUtils fcUtils = new FCUtils(); //Making Map boundary (polyline) string strBoundaryline = "boundaryline"; parameters = new VarArrayClass(); parameters.Add(fcDict["fcBoundary"]); parameters.Add(strBoundaryline); result = gp.Execute("FeatureToLine_management", parameters, null); MessageBox.Show(result.GetMessages(0)); } }
... View more
11-07-2012
10:34 AM
|
0
|
2
|
567
|
POST
|
Thank you suggesting Python idea. but I already coded my function in C#, and I don't have time to convert it (as I said, I have limited experience in programing). Also, from my experience, python is slower than C#, and for my function, computing time is important. So, I need way to make simple GUI with C#. In ESRI walkthrough, they just mentioned about tools and buttons. How can I create simple tool window with GUI, just like ArcTool??
... View more
10-25-2012
08:34 AM
|
0
|
0
|
289
|
POST
|
Hello, I'm looking for how to create new tool in ArcGIS. I developed console application with C# using ArcObject. I want to make it as new tool in ArcMap, like new tool in arctoolbox. I want make GUI for open dataset for several input data for my tool, and also output, just like plain Arctool. I already checked walkthrough like this http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000001ms000000 but I didn't get it. How do I make simple GUI like below? [ATTACH=CONFIG]18699[/ATTACH] I thought about convert my code to Python and add it as new tool in ArcToolBox. But some part of my code cannot be converted to Python. So that's not an option. I have very little experience with programing with C# and ArcObject, so please consider that. Thank you.
... View more
10-24-2012
06:05 PM
|
0
|
5
|
749
|
POST
|
Hello, I suffer from error HRESULT E_FAIL has been returned from a call to a COM component in .Net. I developed code that work through large dataset iteratively. It repeats almost same function for each iteration. But in the middle of iteration, I meet HRESULT E_FAIL has been returned from a call to a COM component. The point of error looks random. Sometimes it crashes here, next time in there. It crashes at such as fc2Poly.in_features = inBoundary + ";" + pairline; fc2Poly.out_feature_class = "polyMerged"; gp.Execute(fc2Poly, null); or fcOuterBarriers = gpUtils.OpenFeatureClassFromString("polyMerged_erased"); Error occurs at data open or writing, so I think it could be problem with GDB that I use for process. Each iteration, I make several temporary featureclass files at GDB, and overwrite those in next iteration. Is it possible overwriting repeatedly cause problem of GDB? Please help me. Thnks. Insu
... View more
07-07-2012
01:04 PM
|
0
|
1
|
1504
|
POST
|
Hi, I have a problem with clipping feature. I have a large featureclass in GDB, and I want to clip it with buffers of some points. With clipped data, I want to calculate area for a certain category by attribute data. Currently I do it using Clip tool (geoprocessor). But input data is too large, clipping is too slow. It tool almost 200s per each buffer. How can I speed up this?
... View more
06-29-2012
01:54 PM
|
0
|
0
|
309
|
POST
|
Yes. I tried, but failed. Here's my code for that.
IPolyline plConvexHullLine = (IPolyline)igConvexHullLine;
for (int e = 0; e < pcVertices.PointCount; e++)
{
IPoint ptIn = pcVertices.get_Point(e);
int f;
int g;
Boolean k;
plConvexHullLine.SplitAtPoint(ptIn, false, true, out k, out f, out g);
}
is there any problem with my code?
... View more
06-28-2012
01:36 PM
|
0
|
0
|
326
|
POST
|
Hi, How can I split polyline at its vertices? There is SplitLine tools in geoprocessing, but generate geoprocessing object and execute it is slow. Is there any other way to split? Thanks. Insu
... View more
06-27-2012
01:52 PM
|
0
|
3
|
600
|
POST
|
Hi, How can I extract vertices from IPolygon or IPolyline or IGeometry object and insert those vertices to existing feature? I extracted vertices from IPolygon to IPointCollection, but IPointCollection object failed at below codes
using (ComReleaser comReleaser = new ComReleaser())
{
IFeatureBuffer fcBuffer = fcTotalVertices.CreateFeatureBuffer();
comReleaser.ManageLifetime(fcBuffer);
fcBuffer.Shape = (IGeometry)pcVertices;
curTotalVertices = fcTotalVertices.Insert(true);
comReleaser.ManageLifetime(curTotalVertices);
curTotalVertices.InsertFeature(fcBuffer);
curTotalVertices.Flush();
}
pcVertices is IPointCollection object. How can I do this? Thank you.
... View more
06-27-2012
12:43 PM
|
0
|
1
|
563
|
POST
|
Thanks. It works!! Thank you. It's great help for me.
... View more
06-27-2012
10:33 AM
|
0
|
0
|
287
|
POST
|
Hi, I'm trying to convert IGeometry object to IPolyline. Specifically, IGeometry, that is polygon, and convert its boundary to IPolyline object. I tried IPolyline plObject = (IPolyline)IGeometryobject; but it was failed. How can I do that? Thanks. Insu
... View more
06-26-2012
08:52 PM
|
0
|
2
|
671
|
POST
|
Hello, How can I convert IGeometry object like IGeometry or IPolygon or IPolyline to IFeatureClass ? I make IPointCollection from existing IFeatureClass, then do some job. After that I want convert result IPointCollection and IPolyline to IFeatureClass in the file geodatabase. How can I do that? Thank you. Insu
... View more
06-24-2012
01:40 PM
|
0
|
3
|
3040
|
POST
|
Hello, I'm trying to create polyline object and then want to do some geoprocessing with that polyline with other featureclass. this is process 1. Create point object from other IFeatureClass object by select by attribute IGeometry geo = new MultipointClass(); IPointCollection5 mtpCollection = geo as IPointCollection5; ISpatialFilter sFilter1 = new SpatialFilterClass(); sFilter1.GeometryField = fcMerged.ShapeFieldName; sFilter1.WhereClause = "id_f = '" + tempPair.getOri + "' OR id_f = '" + tempPair.getDes + "'"; IFeatureCursor curMerged3 = fcMerged.Search(sFilter1, false); IFeature ifMerged = null; while ((ifMerged = curMerged3.NextFeature()) != null) { IPoint ptIn = new PointClass(); ptIn = (IPoint)ifMerged.ShapeCopy; mtpCollection.AddPoint(ptIn); } 2. Create ILine or IPolyline from Point (1) : ilPairLine IPoint fromPoint = new PointClass(); IPoint toPoint = new PointClass(); fromPoint = mtpCollection.get_Point(0); toPoint = mtpCollection.get_Point(1); ILine ilPairLine = new LineClass(); ilPairLine.FromPoint = fromPoint; ilPairLine.ToPoint = toPoint; 3. Do some operation like this: (fcBoundary is Ifeatureclass Polygon) IFeature ifBaseMap = fcBoundary.GetFeature(1); IGeometry igPairLine = (IGeometry)ilPairLine; IGeometry igBaseMap = ifBaseMap.Shape; IRelationalOperator relOperatore = (IRelationalOperator)igBaseMap; Boolean contain = relOperatore.Contains(igPairLine); if (contain) { vgDict[tempPair] = Convert.ToDouble(ilPairLine.Length.ToString()); Console.WriteLine("contained: {0}",vgDict[tempPair]); } with above codes, operation was failed. What's the problem? I need to make polyline from give two points, and then with that line need to do several geoprocessing. Currently, I create IFeatureClass line using geoprocessing tool 'Create line from points', but calling geoprocessing object is to slow. So I want to use ILine or IPolyline for newly generated line for my process. I can make line object, but that line can be applied to other operation like spatialFilter or TopologicalOperator. Thnks.
... View more
06-22-2012
12:13 PM
|
0
|
3
|
2156
|
POST
|
Hello, I'm looking for the way to construct visibility graph (not visibility analysis) in ArcGIS. visibility graph is: "v.net.visibility computes the visibility graph of a vector map containing lines, areas (boundaries) and points. The visibility graph is the graph where the nodes are the end point of the lines, boundaries or simply the points. There is an edge between two nodes if they are 'visible'. Two nodes are visibible if there is no segments in between them, i.e. the edge doesn't intersect any line or boundary in the vector map. This is useful to compute the sortest path in a vector map from any two points. To do this, first you need to compute the visibility graph and from it compute the shortest path using v.net.path or d.path." (from manual of GRASS GIS) There are huge amount of research in the field of computational geometry, but they are just about algoritm itself.
... View more
06-11-2012
11:10 AM
|
0
|
2
|
2496
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|