Tag Info

Hot answers tagged

5

Here's a go at it. Use Python as the parser and check show Codeblock. Enter this in the top Pre-Logic Script Code box: def getints(field): integers = [] for char in field: try: value = int(char) integers.append(str(value)) except ValueError: break return "".join(integers) And put ...


4

Yes, if you just want to do it with selections you need to run multiple selections and change the method/initial set. First Select by Location using within your smallest boundary. Or if you've got two that overlap somewhat, you select everything within one then run another selection using the method 'select from currently selected features in', as discussed ...


3

If your bathymetric data are current in the form of survey points then you should interpolate them onto a raster grid of the same resolution and extent as your LiDAR data. There are several methods for interpolating these points available in ArcGIS such as splining, IDW and kriging. The most appropriate method to use will depend on your data characteristics ...


3

You mention Python scripting, which would be a good way to approach this. However, if you're not already familiar with Python you could look at Model Builder, as this will give an easier GUI to get you started. Here is a quick example of a model which uses Select By Attributes to narrow down a layer, then uses the output of this to Select By Location: ...


2

GetFeature() is a method of IFeatureClass, not IFeatureLayer. Change this: Dim feature as IFeature = pFLayer.GetFeature(1) to this: Dim feature as IFeature = pFLayer.FeatureClass.GetFeature(1) Looks like you're creating a featureclass object but not using it.


2

Here is a field calculator method that incorporates itertools.takewhile. While ian's solution writes the new values to a text field, this is suited for writing to a numeric field. import itertools def convert(x): try: return int("".join(itertools.takewhile(str.isdigit, str(x)))) except: pass


2

You might notice that when you manually change between Data View and Layout view, the scale changes. I would suggest changing to Layout view before you set the scale i.e. something like: mxd.activeView='PAGE_LAYOUT' df.zoomToSelectedFeatures(); df.scale = 2400.0


1

I do not believe there is a tool or function that allows you to export a table with reordered fields. If anyone knows better please enlighten me! I've always felt it has been a bit of a limitation that the geo-processing tools do not honour the reordered fields. Especially the conversion tools . In the past I had attempted to create a tool that did it. The ...


1

I always recommend to check for null values when you are geting features from feature classes, feature class from feature layers, etc. That will prevent you this type of errors, and in the future will be easier to find bugs. Dim pFLayer As IFeatureLayer pFLayer = pMap.Layer(layerNum) Dim featureClass As ESRI.ArcGIS.Geodatabase.IFeatureClass = ...


1

These answers are both technically correct. Length can be calculated automatically in a GDB in the Shape_Length and I agree that clipping to the polygon and the buffer might help to keep things straight. It sounds to me like you are not having any problem calculating the length manually if/when needed but that summarizing the data is what is giving you ...


1

I second the first answer and may add something. In case you keep your data within a Geodatabase, the length will be recalculated automatically. One more thing... Depending on what you want, you might be better of with a clip instead of an intersection. I do things like this for a couple of thousand buffers and the roads I clip are much more than there a ...


1

The length of each polyline objekt in the intersect result should be in the field Shape_Length. Intersect copies the attribute values from the input data, and as the field "LENGTH" is not tied to geometry length in arcmap it won't automatically update. Based on the Shape_Length field you should be able to summarize this.


1

From your screenshot it looks like you're editing a fiber network, so I assume you're using a geometric network. You need to add the Geometric Network Editing toolbar Highlight the line you want to disconnect from the geometric network and press the second button from the left (Disconnect). You can only disconnect one feature at a time. After you move it ...


1

Sometimes feature classes that participate in geometric networks or composite relationship classes in geodatabases tend to move and delete together during editing. Maybe check to see if your lines participate in a geometric network, or a composite relationship class? If so, try deleting the geometric network or the relationship class in question and attempt ...


1

I understend that you are trying to create a empty feature class. You have to create a new shapefile ( or feature clases inside geodatabase) and define the type of geometry that will be store. To define the fields you can import the schema from your record sheet.


1

If you want an arcpy solution: import numpy as np #not sure how arcpy imports numpy r = arcpy.RasterToNumPyArray('your raster name') for val in np.unique(r): area = np.sum(r == val) #multiply this by your pixel area print 'value ', val, ' : ', area alternatively you can write the values to a csv/text file.


1

The easiest way to dock is double clicking TOC.


1

I realize this question was closed long ago, but I have some old tools that this was newly a problem for and the SendKeys solution no longer seems to work, so I rolled my own solution after experimenting. It doesn't disable drawing, but creates the performance equivalent of that by disabling layers and reenabling them when done. Having the script run in the ...



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