Tag Info

New answers tagged

0

Here's an arcpy solution. Run it within the ArcMap Python window. You need to change the three variables at the top (counties, hospitals, and field) to match your data. The output is an in-memory copy of the counties layer called Counties_output with all the fields from the hospital layer joined to it for the maximum value. If there are multiple occurrences ...


1

Success! For tables other than the FeatureLayer, you have to do the following: Create a StandaloneTableClass, set the Table property, you may now access and setup any properties you like from the IFieldInfo interface. After that you have to add the StandaloneTable to the map by casting IMap to IStandaloneTableCollection. ITable = ...// Create your ...


1

Note: Edited answer based on additional info provided by OP Try the following: 1) Combine the county and hospitals datasets, either via a spatial join or with identify (I personally prefer identify so I have a new layer to work with, but either should work). This should give you a single point dataset with all your hospital info, but with the addition of ...


0

The following code uses the approach of calling a subprocess and piping the text to the clipboard. A couple of things to note: I use the onMouseUpMap event, this returns the XY coordinates in map units. I placed a comma between the numbers so there is no space between them. Wrapped the code up in a try-except to capture any failures. import arcpy import ...


2

I am going to write this in VB.Net since that is what I know, and hopefully you can figure out the C# way to do it: To find all the layers, use IEnumLayer interface: Dim pEnumLayer As IEnumLayer = My.ArcMap.Document.ActiveView.FocusMap.Layers(Nothing, True) The second argument determines if this drills down into composite layers. To get the layer from ...


0

You could have all of your connections previously established. When you want to run the script as "SDE" you could then establish your workspace using the connection file as "SDE". If you wanted to run the script as "DATA" you could then establish your workspace using the connection file as "DATA". That would be an effective way to utilize different ...


0

I think I worked out the issue--I replaced the ArcGIS\Desktop10.2\bin\libpq.dll file with one for postgresql 9.3 (32-bit): http://get.enterprisedb.com/postgresql/postgresql-9.3.5-1-windows-binaries.zip I replaced it, restart ArcMap and I am now able to label.


0

I would create a new field for the length of each line segment. Using calculate field with Python, you can run this: !shape.length@feet! This will calculate feet from the shape.length of each line segment. Then you can label the line like any other geodatabase object. If need be, you could create an annotation feature class to display the labels at ...


1

Set the category attribute on your tool. class MyTool(object): def __init__(self): self.label = "This Particular Tool" self.description = "This tool" self.category = "This tool's grouping"


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


0

Take a look at terrain datasets inside a file geodatabase if you also have your LiDAR in vector format. Otherwise I think you will find Mosaic Datasets useful. That allows you to combine multiple DEMs or other image types on the fly and allow you to apply functions on the fly to create hillshades or slope rasters, etc. ArcGIS help has a very good section on ...


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


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


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


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


0

Try to save as .dbf file your record sheet and then add to ArcGIS, and create Event layer.


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

The easiest way to dock is double clicking TOC.


0

The UK government provides a dataset on all UK postcodes under a modified UK OGL license. http://opendatacommunities.org/data/postcodes Some factors you may want to consider in your analysis: Distribution Reference: Population or Occupied Housing Units Variables: Land Use/Zoning Gross Domestic Product (GDP) per capita Government Subsidized Housing ...


0

Do you try to edit event layer created from XY coordinates excelsheet? Try first to export the event layer to shapefile (or feature class into geodatabase).


0

Well I can think of the following approach. I assume that you don't have access to the whole dataset of the entire postcodes. In general spatial distribution of postcodes will be similar to the population density or to the density of buildings. You can easily get most of the buildings of the UK from the OpenStreetMap. Converth them to points. Create a kernel ...


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

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


3

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 convert(!OriginalString!)


6

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


0

You do not mention the version of ArcGIS for Desktop that you are using, but I am guessing that it is 10.0 because I recall an issue similar to this at that release, which was resolved by MapsurroundElement (arcpy.mapping) being enhanced at 10.1 (or possibly at one of the later service packs to 10.0) to handle the scale bar anchor point more predictably. ...


0

Do you have access to the Spatial Analyst extension? ArcToolbox > Spatial Analyst Tools > Neighborhood > Focal Statistics


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


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.


0

You will need to track the current active view and unhook the old active view (required|optional ?) and hook the new active view whenever it changes. Note that ViewRefreshed is not called every time the view is actually redrawn, but it does seem to be called whenever the code explicitly calls Refresh or PartialRefresh and when the redraw toolbar button you ...


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

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


0

In this situation, I would use the "Change Layout" tool on the Layout Toolbar. Open the MXD that contains the data frame you want to use and then use the "Change Layout" tool. In the tool, choose the MXD that contains the layout, scale bar, etc. that you want to use as your template and click Finish. This will insert the data frame you want onto the map ...


0

I was able to copy the scale bar I wanted to use, activate the data frame I needed it for, then paste. The new one retains all the formatting of the old. You can then set aside or delete the old one.


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


0

Whenever I have seen this option grayed out it is because the shapefile (or feature class) does not have a spatial index. To address this from a script I would use the Add Spatial Index (Data Management) tool. To do it on every shapefile (feature class) I would use arcpy.da.Walk to visit every workspace and run the tool on any shapefiles (feature classes) ...


5

Exp( 3.394 + ( 4.717 * "elev" ) + ( -2.602 * ("elev" ^ 2) ) ) In Raster Calculator syntax, the '^' operator is for 'Boolean XOr', not 'raise to power of' (see Raster Calculator operators here). Instead, you could use: Exp( 3.394 + ( 4.717 * "elev" ) + ( -2.602 * ("elev" ** 2) ) ) or Exp( 3.394 + ( 4.717 * "elev" ) + ( -2.602 * ("elev" * "elev") ) ) ...


1

You can change font size of tables in ArcMap: Customize/ArcMap Options/Tables tab. CHange font type and size, cell ht, etc. However, I also have my settings in Windows 7 set at 125%: control panel/display/click radio button by 'medium - 125%. I have no idea if it works the same in 8. Same with internet browser - lower right corner to change to 125%'. ...


1

I too would suggest using column/formula in Excel. I am assuming that you have columns labeled like: INCOME_1995, INCOME_1996, INCOME_1997, etc I would suggest appending another set of columns labeled like: PRCHNG_1996, PRCHNG_1997, etc (note no need for 1995 since it would be 0%) I would then assign a formula to the second set of columns such that they ...


1

I would generally recommend having the ratio in a field, especially since in this case you're interested in a proportional change between two years. A general alternative to calculating, however, is to use Symbology. It's useful if you expect the data values to change, more data to be added, or just don't want to add/calculate a new field. This is ...


1

I had the same problem. The solution I found was to go into Data Frame Properties click the Coordinate System tab and then double-click on the projection you are using to bring up the Projected Coordinate System Properties window and change the Linear Unit (it's a drop down near the middle) to feet or yards or whatever unit you want. It will still be greyed ...


6

You could calculate the field beforehand in Excel, or you can also do this in ArcMap. You need to add a field to your table (make sure you aren't in an edit session, thanks Sara). This will be for the % change. calculate the percent change in that field, using the Field Calculator. Possibly something like: ((table.INCOME_2005 - table.INCOME_1995)/ ...


2

You can only set the transparency if you symbolize say a point feature as a chart which in your case is pie chart. Please see the Symbology tab of your feature class. After this, you can set the transparency of your feature class from the Display tab and this will reflect on the pie charts.


1

Thank you everyone for your help on this! I knew that this had something to do with how ArcMap performs its internal tool validation and I noticed the hasBeenValidated property for Parameters. I now have my update functions set up as follows and the tool works the way I've wanted it to: def updateParameters(self, parameters): if parameters[2].value == ...


0

Since this is an ArcSDE geodatabase, consider using database views for queries that do not include spatial columns, or spatial views for those that do, to join related tables via their FKs as needed to flatten them into single logical 'tables', then you can publish those views/spatial views via ArcGIS Server as either map layers (spatial views) or tables ...


2

If you are using ArcGIS for Server, there are a couple of steps you need to take. Register your ArcSDE Database Create Map/Feature Service with layers and setup the Related Tables to the layers Once published and accessible, you will need to setup your JavaScript to query the service AND the related records. The links I provided for you are for the ...


0

Since you can't work with indexed views, your next best solution is to build a regular spatial view that joins up your tables. Only use necessary columns (NO SELECT *!) Publish as a service. Then use QueryTask, Query and FeatureSet from the JS API to call the results. If you know you will only need a subset of the joins for a certain situation (i.e. there's ...


0

You're going to need some sort of middleware which can expose the geodatabase to the JS application. There are a number of options. ArcGIS Server is the most logical, having the best integration, though of course it's expensive. GeoServer has an extension for ArcSDE geodatabases but in my experience it can be a little tricky to use. - ...



Top 50 recent answers are included