Tag Info

New answers tagged

0

You can do this using arcpy geometry objects and cursors. Each of PointGeometry, Polyline, and Polygon have a distanceTo(other geometry) method.


0

I would guess there's something wrong with your geometry. Try using RepairGeometry_management prior to your field calculation. If this doesn't do the trick, a workaround is probably needed. I would use FeatureToPoint_management, followed by AddXY_management, followed by SpatialJoin_analysis. Edit: The best method might be via an UpdateCursor. Then you ...


0

I know this can be done in R, but am not yet sure how. Different packages exist for doing it between points and (points, lines, polygons). This one does points to line, for example.


1

Try using IEnumLayer interfase: IEnumLayer pEnumLayer; pEnumLayer = map.Layers; layer = pEnumLayer.Next(); while (layer != null) { flayer = (IFeatureLayer) layer;


2

You've forgotten to add cur.updateRow(row) in the end of the loop, to save changes.


2

It is a well-studied problem, to estimate curvature from a digitized curve. There is no simple answer. See this paper for a comparison of several algorithms: Simon Hermann and Reinhard Klette. "A Comparative Study on 2D Curvature Estimators." CITR, The University of Auckland, New Zealand, 2006. (Author link).           ...


3

Arc 10.1 gives you access to the Maplex Labeling Engine which is pretty powerful and should allow you to automatically place your labels. There is a wide range of options for you to tweak and adjust but I would recommend starting with the point placement options and then look at the weighting: In the placement properties you can give the city labels ...


0

I came across this problem after an "IIS Web Platform" installer silently installed a separate version of Python27; uninstalling it of course didn't fix anything. Creating+running a registry patch file (i.e., text file with .reg extension) with the following contents fixed the issue for me: Windows Registry Editor Version 5.00 ...


0

I needed to save my Table View to disk in order for it to be usable by a join. CopyRows_management was the missing link. arcpy.MakeTableView_management(outGdb + "\myTable", viewName, sqlFilterForView ,outGdb) arcpy.CopyRows_management(viewName, saveViewPath) arcpy.AddJoin_management( shapeLayer , joinField, savedViewName , joinField,"KEEP_COMMON") ...


1

Try Hec-ras, there is an extension to use in ArcGis.


2

Your basic code is very good. As per my comments: arcpy.da.UpdateCursor(inFeatures, ('x','y',"shape@")) should be arcpy.da.UpdateCursor(inFeatures,['x','y','shape@']) The square brackets make it a list which is what the tool is expecting. Schema locks occur when you have the same data open in multiple sources or have left a cursor unclosed - using ...


0

I don't totally understand the output of your analysis, but it seems like that for each feature being evaluated you're doing a lot fiddling - copying datatsets, joining them, adding fields, deleting them. If you don't need to do them every time do them once outside your loop. Some benchmarking might help you figure out where the bottleneck is. You can do ...


2

Years and Months behave differently in several ways that make your expression work for years, but break for months. Any set of year ranges that are positive will work with the original years expression. No set of ranges across multiple years alone can select just dates from a given month. For months you have to set an overall range of all dates regardless ...


0

I found this post when trying to do something similar, determining the parish with the biggest area within a fishnet polygon. Since this hasn’t been answered I present the solution I adapted in ArcGIS 10.2. Using the command “Tabulate Intersection Overlay” the total of area of each parish with a fishnet polygon is determined (area and percentage). Using ...


1

Try this: for month in range (01,12): arcpy.MakeFeatureLayer_management("Sightings1995-2014", "test%s" %month,"DATE >= date'01.%s.1995' AND DATE < date'01.%s.2014'" % (month, month+1) When you did it for year you ended your for statement with a colon (:), but when you did it for month that was omitted.


1

You have this problem because the field names to be used when you have a join are not the original field names. If you don't need the join anymore, you can use the "remove join" tool. If you do need the values from the joined table, you must include the table name in the field name, like this : !table_name.field_name! If you want to make sure of the ...


1

Rather than a Join, try creating a Relationship. This will allow you to select one or more weed control blocks, then use the relationship to select the associated records in the table. Note that you may need to import your CSV file into a geodatabase in order to use the relationship, which relies on a unique Object ID for each record.


1

To accomplish this task, you'll need to make sure that the field you are calculating to is a text field. Right-click on the field's header in the layer's attribute table and click 'Field Calculator'. If the Field Calculator dialog box, choose 'Python' as your Parser. Then, in the Output = box, type: str( !FROM!) + " to " + str( !TO!) Hit OK you should ...


0

It depends what tool your Copy Raster tool is feeding into. If you look at the Syntax section of the help for the tool. The output is a Raster Dataset. Many tools take Layers as inputs so without actually seeing your model I suggest you pass the output of the Copy Raster tool into a Make RasterLayer tool then feed that into the downstream tool?


1

I would confirm as @Vince suggests if your input datasets have spatial indices. If your inputs are Shapefiles then these by default do not have spatial indices and need building. Another suggestion that will speed up your code is to replace the cursor you are using with a cursor from the da module as described here.


1

The long execution time is relatively normal. I had a script which I ran from the Python window inside ArcMap and that took more than two hours. I realized that when I converted the script to a script tool, the execution time went down to 12 minutes. A script tool is like a toolbox. You connect your script to the tool. You will need to add a few lines in ...


1

I agree with @Neil Ayres and urge you to fill in the metadata of the dataset as that will follow the data if you use ArcCatalog to make a copy of the dataset. The layer properties as you described above is for a FeatureLayer and any information entered there exists only in the MXD or the LayerFile if you create one. Entering information into the metadata ...


2

You mention ArcMap. The description you are providing there is only maintained within the mxd or layer file. If you want to update the meta data about the data, use the Description tab in ArcCatalog. This updates the meta data and saves it to an associated xml file.


0

not sure why it would work in the GUI - but according to the docs under 'Reasons joining tables may fail' - it does list "avoid starting field names with a number or an underscore" - and has similar warnings against the feature name as well.


3

With ArcGIS 10.1, the Python Win 32 extension is not included within the software installation exactable. Note: The PythonWin32 extension setup requires an existing installation of Python 2.7 which is installed after installing ArcGIS Desktop, ArcGIS Engine and ArcGIS Server setups. ArcGIS no longer installs PythonWin because the recommended ...


2

There is a 2 GB file size limit which is set by web browsers Firefox/IE. You should use Google Chrome. From Esri Help: If the service definition you are publishing includes source GIS datasets, the size of the data and your network bandwidth will impact the time it takes to publish. Service definitions over 2 GB in size cannot be published using ...


0

You asked for "suggestions for alternatives" so you may want to investigate an Esri Developer Network (EDN) subscription. The link from its home page to Learn more about EDN is currently broken but my recollection is that for an annual subscription you get access to all/most developer (including ArcGIS for Server) software and the option to include ArcGIS ...


3

Unfortunately you cannot. ArcGIS for desktop and ArcGIS for server are two completely different softwares, with different feature sets and different use cases. The gui to do arbitrary analysis is not present in ArcGIS for server and the ability to host and serve services is not present in ArcGIS for desktop.


0

Based on the edits to your original question, try something like this: import arcpy input = "featureclass or shapefile" arcpy.MakeFeatureLayer_management(input, "newlayer", "query") arcpy.MakeFeatureLayer_management(input, "newlayer2", "query") Make the input to the MakeFeatureLayer management tool the dataset rather than a layer created from the ...


0

If the class breaks were derived from the rasters rgb values, you might use arcpy.GetCellValue_management tool with the features centroid against the original raster? Saving polygon symbology as RGB values in the attribute table


0

I only need to get RGB values for polygon features. In particular solid fill vegetation and geology. I made a rough as guts ArcPy tool that fits my purpose. The tool gets the user to nominate their layer and symbology field in ArcMap. The tool then loops through groups of "like sybology" values exporting them as rasters and interrogating them for their RGB ...


3

[I'm guessing based on available information]: Your problem is with what you're passing in when running it in a an IDE (outside the app) try: arcpy.geocoder_geocoder('gc_01', 'J:/Postal/Postal/99_Geocode/01/composites/composite_1', 'J:/Postal/Postal/99_Geocode/01/composites/composite_2', ...


0

you should put some spaces before and after the AND when you concatenate. Like this: + " AND " + also you could try and add the parentheses "(" + whereclause1 + ") OR (" + whereclause2 + ")"


5

Without the Maplex label engine your only option using the Standard Label engine is to label each part of the feature: Maplex gives more functionality for labeling, to repeat the label go to label density and select the checkbox for Repeat Label: Hit the options button and specify how often you want the label to be repeated, either in map units or page ...


0

I think your error is with: rows = arcpy.SearchCursor(selectingLayer) for row in rows: arcpy.FeatureClassToFeatureClass_conversion(row, TEMP, "Zone2.shp", "", "ID \"ID\" true true false 4 Short 0 4 ,First,#,\\\\silver\\clients\\SYNCRUDE\\Projects\\P696\\8_BaseMine\\Processing\\TEMP\\trans1.shp,ID,-1,-1", "") FeatureClassToFeatureClass expects as its ...


2

I can answer the "how do I make it work?" part of your question, but I welcome the answer to "why doesn't this work?". Move the call to loop through cursor1 outside the call to create cursor2: For example: fc1 = r'path to feature class 1' fc2 = r'path to feature class 2' with arcpy.da.SearchCursor(fc1, ["OID@"]) as cursor1: for row1 in cursor1: ...


1

You may use the AddLayer method: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] addPoint = arcpy.mapping.Layer(r"C:\Temp\my.dwg\Point") # reference to point layer addPolyline = arcpy.mapping.Layer(r"C:\Temp\my.dwg\Polyline") # reference to Polyline layer arcpy.mapping.AddLayer(df, addPoint, "BOTTOM") ...


0

I done the very same thing a few months back. I used arcpy but the script is far too long to post here so I will give you an outline of what I did. I used a spatial join to detect which points/nodes were within a particular line feature. Because the spatial join does not take flow direction into account I used arcpy to ascertain which was the start point ...


2

If I understand correctly, your scenario is outlined in the ArcGIS help, entitled, "Generalization of classified raster imagery." As described on the linked page, you can remove single "noisy" cells using Majority Filter. If you decide that larger contiguous groups of pixels are "noisy," use Region Group to form pixel clusters, then Extract by Attributes ...


3

Sometimes it is better not to use out of the box solution. This is why I suggest Populate X an Y fields in node layer, convert them to integers, say cm. Create string field and populate it by concatenating string represantations of integers. Do similar thing in links table for first point in the shape. Join nodes table to links using latest created fields ...


1

As mentioned by @brichins in a comment there is ArcGIS documentation entitled "About joining and relating tables" which provides an excellent introduction and tips like: When using data where a one-to-many or many-to-many relationship exists, you should use a relate or relationship class to establish the relationship between the datasets.


2

To determine what the river currently is outside the existing river use Euclidean Allocation to 'spread' the value of the river out. Then add the river rise value and select cells less than that: RiverSmear = EucAllocation(Rivers,Arbitrary_Distance,RiverElevation) RiverRise = RiverSmear + HowHighTheRiver NewRiver = Con(DEM < RiverRise,1,0) If you don't ...


0

Not really sure have you fixed this issue. But have you seen this remarks on SOAP SDK documentation for NAServerODCostMatrixParams: You cannot set return both the ODLines and the ODMatrix. If you want to return the ODLines, ReturnODLines should be set to true, MatrixResultType must be set to esriNAODCostMatrixNone and ReturnODMatrix must be set to false. If ...


2

It would be much clearer with elif then with else: if: . Not that you could also group your condiftion with hierachical if (first test dy, then test dx =>you make 2 tests instead of up to 4 tests) ... print azimuth_gr if (dy>=0 and dx>= 0 ): #if should be aligned with print azimuth_fi = azimuth_gr elif (dy>=0 and ...


0

This is a service area analysis. You are not required to use more than one origin or multiple break values in the service area analysis solver. You can generate a polygon, detailed or not - the only thing to watch (since you mention county) is that any area completely surrounded by a road will be included, which may lead to misleading polygons depending on ...


3

Python loops need to be indented (precede by 2 or 4 spaces) to indicate to the software where the loop begins/ends. import arcpy import math arcpy.AddField_management("Parcelles_class_FeatureToPoi3","new_field","DOUBLE") cur = arcpy.UpdateCursor("Parcelles_class_FeatureToPoi3") for row in cur : row.getValue("POINT_X") row.getValue("POINT_Y") ...


1

I think there are two ways to fix this: If you have "C:\Users\User\Documents\GISProj\Map6.mxd" open then, instead of referencing r"C:\Users\User\Documents\GISProj\Map6.mxd", use "CURRENT"; or Run the code with ArcMap closed but include mxd.save() as its last line - the arcpy.RefreshTOC() is not then needed. I think of using mxd = ...


1

Guess I am gona answer my own question here. So basically I spent a little walk with the C# ArcObject coding. Steps are abstracted for understanding: 1. Open the stream shapefile, store the object id information; 2. Open the intersect shapefile, search for the record for each original object id, such as there are 68 reaches for stream id 1; 3. Use two ...


1

You can build pyramids in ArcGIS using the built-in tool Batch Build Pyramids (Data Management) or Build Pyramids (Data Management). It appears the ArcGIS tools do the same thing as the ENVI utility, except that ArcGIS stores the pyramid file as a ".ovr" file rather than an ENVI ".enp" file


0

I would (providing the TAB and tif files have exactly the same cells): extract the centre of each tif pixel as an xy coordinate write the xy file to csv (1. & 2. can be done together with gdal) read the xy file and TAB files into a program (R/python/whatever) stack the TAB file columns join/merge/rowbind the xy and TAB files and export to xyz read the ...



Top 50 recent answers are included