# Tag Info

17

First, a little background to indicate why this is not a hard problem. The flow through a river guarantees that its segments, if correctly digitized, can always be oriented to form a directed acyclic graph (DAG). In turn, a graph can be linearly ordered if and only if it is a DAG, using a technique known as a topological sort. Topological sorting is fast: ...

14

With your background I would suggest that a .NET language using ArcObjects would be most familiar and VB.NET most familiar of all. Also, if you are looking at wider career opportunities beyond this project, then my gut feel is still with the .NET environment with a leaning towards C#, just based on the requirements I see employers asking for most often. ...

13

There are many ways to weight distances for constructing Thiessen polygons. The basic idea in constructing them is based on comparing the distance between an arbitrary point x and two fixed points p and q; you need to decide whether x is "closer" to p than to q or not. To this end--at least conceptually--we consider the distances dp = d(x, p) and dq= d(x, ...

11

Kirk Kuykendall's recommendation to construct a spherical Voronoi diagram (Thiessen polygons) is a good one, but might have some technical hitches to work out. In the meantime, as an alternative, one can apply the standard raster solution as described in another thread. Use spherical distances instead of Euclidean distances. Here is an example using five ...

10

If you are only interested in the MAX value you can use the interface IDataStatistics. Using it you can get a simple statistical result, with min, max, mean, etc. http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeoDatabase/IDataStatistics_Example.htm

9

What you want is a weighted Voronoi diagram: http://en.wikipedia.org/wiki/Weighted_Voronoi_diagram also know as a circular Dirichlet tessellation when done with multiplicative weights in a 2d plane. Someone seems to have built an arcgis 9 extension to build these: http://arcscripts.esri.com/details.asp?dbid=15481 With a user guide available here http://...

8

I've never tried this but it seems like this would work: Create a 3D voronoi diagram of the sphere. This resulting polygons will be roughly centered on the original existing (seed) points. Loop through each resulting vertex to find the one that is farthest from its closest existing point. This point should be the most remote point on the globe.

8

If you know row, column, cellsize and extent, X & Y can easily be calculated. Note this assumes a North up raster. If the raster is rotated you'll need to know the other two affine transformation coefficients (or geotransform in GDAL speak). Also note that the column/row coordinates in the below are from (0.0,0.0) at the upper left corner of the upper ...

7

VB.NET vs C# really does come down to, mostly, a matter of opinion. Mine would be strongly in the C# camp, as VB.NET's predecessors (VB & VBA) actively encouraged horrible coding practices ("On Error Resume Next", anyone?) and they live on, in the culture surrounding the language and in gestures towards backwards compatibility. However, given your ...

7

If the layer implements the IDataLayer interface (most layers do), you can access its IDataLayer.DataSourceName property. For example, for a feature layer, this property will return the FeatureClassName object, which provides various interfaces to examine the data source.

7

You can use the IFieldInfo::Visible property. Here's one way Dim pFieldInfo As IFieldInfo Dim pLayerFields As ILayerFields pLayerFields = pMxDoc.FocusMap.Layer(0) pFieldInfo = pLayerFields.FieldInfo(lIndex) pFieldInfo.Visible = False

7

I did not per se figure it out becuase i don't really understand what is going on here but I was trying different things until it worked. I am not sure whether it is suppose to work or whether this crudity can even be called a workaround but here it goes: Keep both "ESRI.ArcGIS.AddIns.targets" and "ESRI.ArcGIS.AddIns.11.targets" in the "C:\Program Files (...

6

The easiest way is to cast the Map to IMapLayers and call the IMapLayers.ClearLayers method.

5

I have been working with PolylineZ, PolygonZ, and PointZ feature classes for a long time now, and my experience is that the SHAPE_Length field is strictly XY. Because I do not have 3D Analyst (My employer has not seen fit to get it), I have had to do some fancy geometry to work with elevations. (Yes, vector equations would theoretically be easier, but I'm ...

5

Use System.Runtime.InteropServices.Marshal::ReleaseComObject to destroy the ArcObjects before you disassociate their reference.

5

You've declared mxApp, but you haven't actually set it to anything. If you're using an addin, you can set that with the line mxApp = My.ArcMap.Application

5

There are a few concepts that I see you are missing. I will try to explain them. 1- The first one has to do with spatial filter usage. You should pass a filter when you are using it, otherwise, just pass nothing. You have this code: Dim pSpatialFilter As ISpatialFilter Set pSpatialFilter = New SpatialFilter Dim pBlockBoundaryCursor As IFeatureCursor Set ...

5

Yes, since you are presumably using VB.NET (not VB, which is 20+ years old and no longer supported), you need to use the Imports statement to import namespaces. Specifically you want to put Imports ESRI.ArcGIS.Geometry at the top of your code files. Alternatively you could fully qualify the IPoint type every time you use it (ESRI.ArcGIS.Geometry.IPoint) ...

5

If you create an ancillary table with the attributes (fkey,xcell,ycell), populated from the objectid and a gridding of the maximum Y coordinate (or centroid coordinate or upper-center envelope coordinate), then you could use SQL to update the table, with something like: UPDATE poly SET num = vtab.rownum FROM ( SELECT row_number() over (order ...

4

A better way to execute tools in VB, VBA, or .NET is to use the IGeoProcessor interface, rather than the dispatch object. This link will take you to a sample of using the IGeoProcessor in VB/VBA to execute tools and return the tool messages: http://edndoc.esri.com//arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Geoprocessing/1B3C4460-293A-4E3B-9972-...

4

Solved, as per George's comment... Using ComReleaser As ComReleaser = New ComReleaser Dim pFCursor As IFeatureCursor = pFClass.Search(Nothing, False) ComReleaser.ManageLifetime(pFCursor) Dim pFeature As IFeature = pFCursor.NextFeature Do Until pFeature Is Nothing ... Try 'Start edit operation ...

4

VB.NET is a good language, much better than the old VB, but still I am strongly in the C# camp. For someone entering the .NET world, it's better to take advantage of the fact you are essentially in a learning process and incorporate taking on C# in it as well. I will not compare the two languages here as there has been plenty written about them, as well as ...

4

Could you experiment with a known grid...here is a suggestion for implementation using Python, numpy and arcpy. >>> import arcpy >>> npArray = arcpy.RasterToNumPyArray("c:/temp/x") >>> import numpy >>> print numpy.sum(npArray) 45763093 >>> EDIT Additional comments on the above. You have to be careful when ...

4

(Converting my comment to an answer) If you already have bounding polygons created for all of your landform features, the vertices of those polygons should already be ordered consistently, assuming they are topologically valid. If so, you should be able to solve this using GP tools: Use Feature Vertices to Points to convert the polygons' vertices to ...

4

Not to be meant as a serious complete answer, but rather just an idea to toss around - I wonder if Thiessen polygons could perhaps be of any use in this case. Now, the trick is to find a reliable algorithm to identify those polygon boundary segments which form the centerline. Once you have the centerline, it is easy to decide on which side a point lies. ...

4

I believe that is an indication that VBA is not installed correctly or at all. See this ESRI help document: http://support.esri.com/en/knowledgebase/techarticles/detail/17844

4

You need a function that returns the selection set count property on your layer. If the count is >0 than you can enable your button. ISelectionSet.Count Property

4

Instead of checking for a selection directly in the button's OnUpdate routine, which runs very frequently, I would write an extension that uses event handlers to respond to selection events and caches the selection state of your layer, and then in the OnUpdate routine check the extension's cached state. Of course this is probably overkill if there is only ...

4

The syntax for combobox (as well as other controls) is different in VB.NET. You should review the help to see the changes. cmbBox.ListCount --> cmbBox.Items.Count cmbBox.List(l) --> cmbBox.Items.Item(l) cmbBox.AddItem(sItem, l) --> cmbBox.Items.Insert(l, sItem) cmbBox.AddItem(sItem) --> cmbBox.Items.Add(sItem)

4

Rather than try to pick apart your code I will just offer some general suggestions: You will probably want to use a list or dictionary data structure or XML to store your layer names/workspaces and use data binding to bind the list to your user interface. You might consider using a dropdown list or list view instead of radio buttons if there are more than a ...

Only top voted, non community-wiki answers of a minimum length are eligible