Tag Info

Hot answers tagged

12

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: ...


11

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, ...


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

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


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

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 ...


5

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.


5

Kirk Kukendall'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 on another thread. Use spherical distances instead of Euclidean distances. Here is an example using five ...


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) ...


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

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: ...


4

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.


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 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 ...


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)


3

You can use Field Calculator for the same. See the code snippet below. Dim dblLength as double Dim pCurve as ICurve Set pCurve = [shape] dblLength = pCurve.Length Refer the online link for more information. Cheers!


3

I was trying to think up a solution to this interesting problem but I could only generate more problems! I think there is a scenario that must be considered when stringing the points together to form a polyline and these are spikes as shown in the image below. If this is a sceanrio that never exists then my thought process was: Select points that code ...


3

Like Goldorak84 said, you're missing a spatial reference. Might I suggest making a utility method, that's like this. Sorry using C# here. static public ISpatialReference GetSpatialReference() { ISpatialReference spatialReference; ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass(); spatialReference = ...


3

The documentation says you have to add a valid spatial reference to your geometryDefEdit object. Add these lines after the creation of your geometryDef object (taken from http://resources.esri.com/help/9.3/ArcGISengine/ArcObjects/esriGeodatabase/IFeatureWorkspace.CreateFeatureClass_Example.htm) Dim spatialReferenceFactory As ...


3

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 ...


3

With the Microsoft .NET Framework, VB and C# are both CLR languages, and are technically equivalent. There are a few differences, but they both offer similar features like exception handling, etc. Furthermore, documentation from Esri and Microsoft typically provide examples for equivalent operations in both VB.NET and C#. It really comes down to the ...


3

Well "C:\Dan\Data\geodatabase.mdb" is just a string so you can use a string variable set to some other value. How you get the current gdb depends on what other objects you have. For example if you have a IDataset its has a Workspace that has a PathName. Also just to note, I believe that using "esriGeoprocessing.GPDispatch.1" is older syntax, you could use ...


3

From the IFeatureClassLoad Manual: Remarks IFeatureClassLoad is an optional interface supported by feature classes in ArcSDE and feature classes and tables in File Geodatabase. It improves performance of data loading. With ArcSDE, putting a feature class in load-only mode disables updating of the spatial index while data is loading. In a File ...


3

The explanation is over on the ICursor interface (which FeatureCursor implements). You need to move Set pFCursor2 = pFeatureClass.Search(Nothing, True) into your first loop. Or set your recycling cursor to false, make one pass over your pFCursor2 cursor to create a collection of IFeature (List, Dictionary, etc) and then iterate over the collection. ...


3

You should be able to use the AccessWorkspaceFactory co-class even though it's not a personal geodatabase. You could also use ADO.NET. I am not sure why your code isn't working but I do know that working with property sets is an exercise in frustration.


3

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