POST
|
Two easy changes to get your IF block to work: 1. You only need to do the Describe once; it returns a Describe object from which you can get the basename and feature type, rather than repeatedly returning to the feature class. 2. Use the ShapeType property of the Descibe object to determine if it's a polyline feature class. Your IF block would start like this: for fc in features:
Desc = arcpy.Describe(fc)
if Desc.shapeType == "Polyline":
outFC = Desc.baseName + "INT.shp"
outFC2 = Desc.baseName + "INT_sp.shp"
# and so on....
... View more
02-24-2020
01:44 PM
|
2
|
0
|
529
|
POST
|
It sounds like you are expecting to find a table or layer containing all possible address points in your study area, as part of your address locator, is that correct? Street address locators don't work like that. To oversimplify: When you geocode an address, the locator first finds a street segment with a matching name and range of address numbers that encompasses the address number you're looking for. Then it interpolates the distance along that street segment where that address would be found. So for example, searching for "125 Main St", the geocoder finds a street segment named "Main St.", with an address range of 100 - 199. 125 Main St is 25% of the difference between 100 and 199 Main St so the geocoder calculates a point location 25% along the length of that segment. So the points you get when you geocode a table are interpolated from the address ranges of the street segments, and calculated on-the-fly as needed. Creating an address locator is basically creating a bunch of compressed tables and indexes that make this process extremely fast. There is no "master" point layer or table. Apologies if I'm misunderstanding your question.
... View more
03-29-2018
08:50 AM
|
0
|
0
|
1080
|
POST
|
No need to convert to a raster to do what you are trying to do: On one or the other of your feature classes, add a field called "HelicopterMinutes" or "TruckMinutes" and calculate it to the value of the minutes field (assuming the fields are named identically now; this will help you keep track of which time field came from which layer later.) Use the Union command to merge the two feature classes. This will create a new polygon for every unique area of overlap between polygons in the two layers, and will also keep any areas that don't overlap. The output feature class will have both of your minutes fields in it. Now add a field to indicate which vehicle is fastest to each polygon, as you described above. You can do this with a simple Python script, or just select for "HelicopterMinutes < TruckMinutes", then calculate the field value to 0 or 1, then repeat with "TruckMinutes < HelicopterMinutes" (or just reverse the selection on the layer). Then symbolize based on the new field.
... View more
12-09-2016
05:25 PM
|
1
|
0
|
770
|
POST
|
The "Buffer" command as you're using it doesn't work on a feature-by-feature basis. It buffers every feature in your feature class by a fixed distance, in your case, buy 100 meters. If I read the indentation correctly in your code, what is happening is this: For each feature in the cursor: Get the Light type Set the buffer distance based on light type next feature Run "Buffer" The last feature you read in the cursor just happens to be type "SV", so you get an output where all the lights are buffered by a distance of 100. Darren points you in the right direction: You will need to add a field to your lights layers, then fill it with the buffer distance for each light type. Then, when you run the buffer command, give it this field instead of a fixed distance.
... View more
09-30-2016
11:04 AM
|
1
|
0
|
365
|
POST
|
A couple of things: First, In your code snippet, it looks like your using lower case "i" for the field variable in your loop, but you're using an upper case "I" on the DeleteField_management command. Second, the DeleteField_management command wants a list of field names to delete, not a single field. It would be more efficient for you to first construct a list of field names to delete, then delete them all with a single call to DeleteField_management. Take a look at the examples here: DeleteField_management Example 3 shows how to programatically build lists of fields then delete them.
... View more
04-28-2016
09:28 AM
|
1
|
0
|
411
|
POST
|
Take a look at the "Transfer Attribute" tool, in the "Conflation" toolbox. It's designed to do what you are trying to do here. You might need to add attribute fields to your "target" features to receive the values from the source features. Transfer Attributes—Help | ArcGIS for Desktop
... View more
02-25-2016
10:17 AM
|
1
|
0
|
609
|
POST
|
If you need to do this just once, the simplest way is in the field calculator: Open the table, right-click on the heading of the field you want to store your result in, and select "Field Calculator" Select "Python" for the parser. In the expression window,, enter the expression that Luke gave you above, but replace the string "C000004N_37" with your input field name, surrounded by "!" signs. For my test, the expression looked like this: int(!RouteID!.split("_")[1]) If you need to do this in a Python script, on the other hand, you'll need to use an Update Cursor to step through the records, read the initial value, parse it using the "split" method, then write the results back to your output field. There are some good examples in the ArcPy help, under "Data Access Module".
... View more
09-17-2015
04:21 PM
|
2
|
1
|
2050
|
POST
|
John - The CLIP command that Rickey references in his link does what you are asking. The diagram in the documentation might be a little misleading because it shows only a single polygon in the "clip" feature class, but it can contain many polygons, as in your parcel layer.
... View more
09-17-2015
03:43 PM
|
0
|
0
|
598
|
POST
|
Here's one way, but you have to make a copy of your feature class to do it: Open the "Copy Features" tool in the "Data Management" toolbox. Select your original feature class as the input, and set the output feature class (this will be a new one). Click the "Environments..." button at the bottom of the tool dialog. Click the "down arrows" next to the "Z Values" on the environment settings page. Under "Output has Z Values", select "Enabled". Click OK to close the environment settings page. Click OK on the Copy Features tool to copy the features. The output feature class will be Z-Aware. Note that you can also use the environment settings to set a default Z value, resolution, and tolerance on your new feature class if you want. The same environment settings are also available from ArcMap's "Geoprocessing > Environments" menu, if you want them to apply globally, and not just to this specific tool. This does not appear to work if you just copy/paste the feature class from the Catalog window; you need to run a tool like Copy Features.
... View more
09-15-2015
02:31 PM
|
2
|
0
|
316
|
POST
|
Take a look at the "Join Field" tool in the Data Management toolbox. It will append any or all of the attribute fields from one feature class onto another. Use "ObjectID" for the input and output Join Fields. There do not need to be any records in either of the feature classes (the tool works on tables, too). Any domains attached to fields in your first feature class will be attached to those fields when they are added to the second feature class. A couple of other useful tools if you find you need to duplicate a large domain are "Domain to Table" and "table to Domain", also in the data management toolbox.
... View more
08-27-2015
11:40 AM
|
2
|
0
|
642
|
POST
|
I believe you're passing the wrong variable to DeleteField_management. You want to pass the current feature class in your loop ("delete"), not the list of feature classes you're looping over.
... View more
02-02-2015
03:20 PM
|
1
|
1
|
315
|
POST
|
GeoEvent Processor uses its own set of logins, and there's a default manager ID and password created upon installation. It's documented here: ArcGIS GeoEvent Processor for Server Install Guide for Windows You will, of course, want to change the default password, at least, after logging into manager.
... View more
09-16-2014
02:08 PM
|
1
|
1
|
236
|
POST
|
You can do this completely in model builder. To calculate the mean length, use Summary Statistics, as you described above. Do not specify a "case" field. The result of Summary Statistics will be a table containing a single row, with a field named "MEAN_LENGTH" or something similar. Add a "Get Field Value" tool to the model (it's on the Modelbuilder toolbar, under Insert > Model Only Tools > Get Field Value). Use the summary statistics results table as your input table, and select the MEAN_LENGTH field. The output of this tool will be the value of MEAN_LENGTH, in a variable that you can then use in the rest of your model.
... View more
09-16-2014
12:54 PM
|
0
|
0
|
701
|
POST
|
It sounds like you're trying to summarize one or more of the fields that are automatically added by ArcGIS, such as Shape_Length, Shape_Area, etc. An in_memory feature class doesn't have these attributes. I suspect they are created when the feature class is actually witten to disk. To summarize any of those fields, you'll need to direct the output of "multipart to singlepart" to your scratch workspace or to some other persistent geodatabase.
... View more
09-16-2014
12:41 PM
|
0
|
1
|
527
|