Tag Info

New answers tagged

0

IMap.Layers returns an enumerator over all layers in the map document. This includes group, raster, vector, graphics layers, and non-root layers in the TOC (i.e. it recurses into group layers). If you have any non feature layers in the map document, casting the ILayer to IFeatureLayer will throw an exception. To handle this, either do a dynamic cast and null ...


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


1

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


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


1

you can also modify the environment settings (bottom of your tool) of your tool and set a pixel size (raster analysis tab) of 6 m or select "minimum of input"(the default is maximum of input). This way you don't have to create a new raster. Of course, the advantage of resampling by yourself is that you have full control on the resampling method (within ...


2

You need to resample your 12m raster to 6m in order for the division to work. The basic way is to use Resample tool in the Data Management library.


1

Create numeric field (double) in the table of ballots and try this with field calculator. Code block: def TotalDist(shp ): p=shp.firstPoint mxd = arcpy.mapping.MapDocument("CURRENT") layers=arcpy.mapping.ListLayers(mxd, "facilities") lr=layers[0] g=arcpy.Geometry() geometryList=arcpy.CopyFeatures_management(lr,g) s=0 for f in geometryList: ...


0

If your file is an .xls or .xlsx file these should open correctly in ArcMap. Clearly this isn't happening though, but my experience of using Excel is that it simply stuffs up csv exporting and the resulting file isn't usable. Does opening the .xls or .xlsx file in LibreOffice Calc then saving as a text csv (with commas as a field separator) and importing ...


4

you can make some computation using the report designer. Open a report in the Report Designer. From the Design Elements list, click TextBox and drag the element into position on the report layout. Enter an expression in the Data Field area in the Element Properties grid. Expressions always begin with an equals (=) sign In you case, the ...


1

This is a correct procedure. You can then use summarize table to get the sum of distance based on the ID's of your Ballot Boxes, and join this table. The point distance indeed provides distances based on the coordinate system, so in your case it will be meters, and if you don't specify a distance it will work on the full extent. As a remark, if you have a ...


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


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.


3

there is no such thing as the "sum" operator for difference (which is not permutable), so you should test the validity of each item to decide how you run the substraction. def stack(item1,item2): if item1 != None and item2 != None: return item1-item2 elif item1 != None: return item1 elif item2 != None: return -item2 ...


0

Actually, I tried finding our license numbers today in ArcGIS Admin and gave up and called ESRI. They said the only way I could see license numbers is going to the My ESRI website logging in to the account who purchased the licenses. From there navigate to products and there should be a report system to filter your license numbers. Be advised the ESRI ...


1

I agree to have scale dependency set in your layers use an online mapping service or map server. the easiest and free is https://github.com/klokantech/tileserver-php QGIS Server or QGIS Cloud


6

Negative. Adobe Acrobat or Professional is not the program to achieve what you are trying to do. PDF's are meant to be sheets of paper on your screen, that's why they are hard to edit and reproduce. I've done a similar thing with Zoomify, but that doesn't change the layers based on zoom level. Really I think you need a web application to do this. If you ...


0

Efficiency might not be my strong suit, but here is the process I came up with: In the code below, I first create a point feature class from the vertices of my input shapefile. From here I iterate through each feature in the input shapefile. I select each vertex in the point feature class associated with that feature, and then perform a distance selection. ...


0

In case someone has the same issue, this is my solution. import arcpy fc = "C:\mygdb\myfile" f1, f2, f3 = "EDITOR", "SPECIES", "OBJECTID" clause = arcpy.AddFieldDelimiters(fc, f3) + "= 1" for row in sorted (arcpy.da.SearchCursor (fc, [f1, f2], clause)): print ("{0}_{1}".format(row[0], row[1])) name =("{0}_{1}".format(row[0], row[1])) ...


3

In ArcMap, add both the buffer feature class and the cable feature class to your table of contents. Then go to the Selection tab and choose 'Select by Location'. A dialog box will open. With this, you'll be able to select buffer features that intersect the cable features. Once you have made your selection, right-click on the buffer layer in your table of ...


-1

Make sure 'Data Frame Properties > Annotation Groups > Default' is checked on.


4

Look into Data Driven Pages. You can use your areas as your layer, and using a Definition Query, can exclude all the other areas.


0

For ArcGIS 10.0: Steps: 1. Click the Label Manager button Label Manager on the Labeling toolbar. 2. Check the check box next to the layer you want to label. 3. Choose a label class under the layer. 4. Click the Properties button. 5. Click the Label Position tab. 6. Choose River Placement from the drop-down list. The label position can change when ...


0

An alternative option for your first question would be to use IProgressDialogFactory Interface for the processing dialog. The link above has a sample code for your reference.


2

You want ListFields: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001p000000 in_data = "test" out_data = "testFC" fields = arcpy.ListFields(in_data) for f in fields: print f.name # join prefix and desired field names with an _ new_name = '_'.join([out_data, fields[0].name, fields[1].name]) # data_type is usually optional... ...


2

Since 10.1, you can use the image analysis tools (Windows > image analysis) to create a mask function that will perform the masking on the fly Using the Mask function, you will specify one or more NoData values or a range of valid pixel values. The inputs for this function are the following: Input Raster / NoData Interpretation / NoData ...


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


1

You will not be able to delete a feature class which participates in a topology. You should first exclude this one from the topology. You can either use a GP tool Remove Feature Class From Topology (Data Management) or do it manually via Removing a feature class. If you don't really need to recreate/replace a geodatabase object (such as a feature class), ...


1

A non-ESRI option might be to use GDAL. The nearblack tool will convert nearly black or nearly white pixels to all black or all white. Though, again, this doesn't meet your requirement to not create duplicate files.


2

I found a work around to this by using Rick Brewster's suggestions. First, I modified Rick's class by adding a constructor public ToolStripEx() : base() { } Then in my dockable window's designer class "MyClass.Designer.cs" I changed the toolstrip's declared type from System.Windows.Forms.ToolStrip to ToolStripEx. Next, in the InitializeComponent() method ...


0

Unfortunately I do not have a 50 reputation yet to comment on posts so I had to post this here. category="" <-- will place your command or tool under the Misc. category under Customize>Commands. I do not know how to fully hide a custom tool like you are wanting to do.


0

ESRI.ArcGIS.Controls.ToolbarControl class is for ArcEngine Application and you shouldn't use it in ArcMap with ArcObject. To Remove a command from a toolbar: You just need the name or UID of the command you want to remove from a toolbar. Suppose you want to delete fullExtent command from the Tools toolbar: var fullExtent = ...


0

I use GIMP 2.8 Open pdf and export as tif or whatever you perfer.


0

You can get the normal angle or tangent angle or the compliment to either of those angles for any point event along a Route. You can then use the Bearing and Distance to Line tool to set lines extending from your event on that angle bearing and extract the To End Point of the line with the Feature Vertices to Point tool to get a new point. If you just want ...


2

Use the data driven pages tool in ArcGIS. You can point the tool at your shape file and it will automatically generate a new page for each of your parcels. It is then possible to export each of these as separate PDF or as a single PDF from the normal export map dialog.


0

As pointed out by @radouxju the search for symbols functionality was introduced at ArcGIS 10.0 and from a blog enitled Symbols and styles in ArcGIS 10.0: Finding appropriate symbols to apply to your features and graphics is easy in ArcGIS 10 because you can search for and use symbols without having to know to which style they belong, nor have that ...


2

Essentially you can't. All of the formatting and display of basemap layers is pre-set by the basemap creator (in this case Esri). They've gone through and designed the layer to look a particular way at a given scale and you can't alter this. You could create your own annotations to sit on top of the map (using either the labeled or unlabeled version) that ...


0

I think you used the Define Projection Tool or the shapefile's property page (in ArcCatalog) to change the coordinate system to Asia Lambert conformal conic. That updated the metadata but didn't change the data's coordinate values. Redefine it as WGS 1984. Use the Project Tool to make a copy. However, don't use Asia Lambert conformal conic, use Asia Albers ...


0

You have to initialize the axToolbarControl like below //Add a toolbardef by passing a UID UID uID = new UIDsClass(); uID.Value = "esriControls.ControlsMapNavigationToolbar"; axToolbarControl1.AddToolbarDef(uID,-1,false,0,esriCommandStyles.esriCommandStyleIconOnly); After that you can get the object as IToolbarControl2 and thereby edit the toolbar.


0

Try exploding the polygon shapefile first. If they are stored as a single multipart feature the statistics will be computed for the combined polygons. Edit: missed the overlapping part of the question, but unless they are all overlapping then you should get statistics for each non-overlapping polygon.


0

I like to encourage the use of better string formatting and better ways to join paths. By getting rid of all those plus signs, etc., it will be less likely to encounter such errors - here is a much cleaner approach and it's much nicer to read: import os os.path.join(r"C:\Users\Kakemphaton\Desktop", "{0}.png".format(df.name))


0

Ok, I figured it out. I can just create a polyline, make sure it remembers z values and do a stack profile with the "stack profile tool". It stored my data in a table which I could export into Excel. Did it for all the different rasters. Worked like a charm. Many thanks anyway!


1

List the dataframes, then iterate through them (untested): import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") dataframes = arcpy.mapping.ListDataFrames(mxd) for df in dataframes: ar = df.extent.height / df.extent.width arcpy.mapping.ExportToPNG(mxd, r"C:\Users\Kakemphaton\Desktop\" + df.name + ".png",df, 1024, 1024*ar, 96, True)


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


2

Assuming that based on the question in my comment above, you are able to edit your layer in ArcMap, there is a direct way of creating points that are in a common alignment. Start editing the layer Create your first point In order to create your next point, in the Create Features popup, instead of choosing Point in the Construction Tools, choose Point at ...


1

I would draw them in using the distance direction tool. You can specify the angle you want to draw them at by pressing "D" and typing it in, then press "D" again to enter the distance. If you use the same direction and distance you can create an evenly spaced set of points along any azimuth you choose.


0

1) Make them in excel would be easiest. 2) In ArcGIS right click while editing and you have bearing and distance options, so 90,90 would give you a bearing of 90 an d90 units.. 3) Make a line between two points and create points (via vertices) every x distance. I would just do (1) and verify the x by your desired unit why holding y constant.


1

(Edit: The distance direction method mentioned in the other answer sounds like the way to go. Here is more detailed help on how to use that method. However, for a huge number of points on a line I would use the Distance Direction method to create a two point line at the angle you want with a length that is the multiple of the spacing distance you want and ...


0

Worked it out, I just drew a polygon around the catchment, added a field called HEIGHT, and then used the field calculator to give me the height I wanted (872m). I then generated a tin from that polygon and then used the surface difference function with the reference surface being the tin I created from the contours to find out where the new tin was above, ...


2

The best option is to use a query to get back the corresponding feature: IQueryFilter queryFilter = new QueryFilterClass(); queryFilter.WhereClause = "NAME = '<featureName>'"; using (ComReleaser comReleaser = new ComReleaser()) { ICursor cursor = table.Search(queryFilter, true); comReleaser.ManageLifetime(cursor); IRow row = null; while ((row ...


4

def slope_correct(slope, avg): if avg > 25: return "holly crap" elif 0 < avg <= 25: return "easy peasy" else: return "unknown"



Top 50 recent answers are included