13 votes
Accepted

Disabling on-the-fly projecting in Arcmap?

It's not particularly obvious but it can be done per data frame: Open your data frame properties; Click the coordinate system tab; Click the dropdown next to the coordinate system (globe) button; ...
user avatar
  • 51.8k
11 votes

Create a line perpendicular to an existing line in ArcGIS

Based on @Felix's answer, here's an approach that uses built-in methods on geometry objects. Supported on 10.3+. from math import atan2, pi # epsilon e = 1e-10 def tangentLine(line, dist): '''...
user avatar
  • 11.5k
10 votes

What's wrong with my ArcGIS - PostGIS setup?

Here are a couple of items to explore to determine why ArcGIS is not registering your PostGIS tables as feature classes: ArcGIS will refuse to acknowledge tables that have mixed geometry types. To ...
user avatar
  • 1,135
9 votes
Accepted

Passing token to ArcGIS Server REST service?

For Post Request You send it over inside a form in the body with the key token and the value is the token you received from this document explaining how to get token For Get Request You can send them ...
user avatar
9 votes
Accepted

Field calculator in ArcGIS 10.4 multiline python code

In the field calculator, your parser should be set to Python. With "Show Codeblock" checked, your function definition should go in the "Pre-Logic Script Code" and the expression box at the bottom ...
user avatar
  • 969
8 votes

How do I include 64 bit python with ArcGIS 10.4 install?

If you only have access to ArcGIS Desktop or Engine, you need to install the Background Geoprocessing for 64bit, check Python scripting with 64-bit processing at the ArcGIS Blog. If you have ArcGIS ...
user avatar
8 votes
Accepted

Using ArcGIS Field Calculator to populate number field from text field?

You are almost there. What you are trying to do is: Codeblock: def calc_speed(field_value): if field_value == 'S1100': return 65 if field_value == 'S1200': return 45 Speed field Speed =...
user avatar
8 votes
Accepted

Create a line perpendicular to an existing line in ArcGIS

Create midpoints, using one of multiple possible techniques. Buffer them by small number, e.g. 0.5 m Clip originals by buffer, output - SHAPEFILE Use this field calculator expression on field Shape: ...
user avatar
  • 21.4k
8 votes
Accepted

List layers from current view using Arcpy

A DataFrame object has an extent property, the extent property/object can be used in the basic spatial relationship methods of contains, within, equals, overlaps, touches and disjoint as well as ...
user avatar
  • 3,206
7 votes
Accepted

Geopackage Error - 'is mounted and in WAL mode, this combination is not allowed'

QGIS is made to use Write Ahead Logging (WAL) by commit https://github.com/qgis/QGIS/commit/f939e9cff598b95e95b0de099d0c9a92eed0ea9c The new behavior should be to open gpkg database file in WAL ...
user avatar
  • 51.5k
7 votes

List layers from current view using Arcpy

As a quick and dirty method, you could compare extents, as already answered. However (also mentioned), that doesn't necessarily indicate whether a feature is visible in the current view (e.g. if you ...
user avatar
  • 4,613
7 votes
Accepted

Disabling/hiding customize option from ArcMap menu bar

Click on Customize > Customize Mode When the window opens, just drag the Customize menu option from your toolbar. Now the Customize option will be gone from your menubar. To get it back you will ...
user avatar
  • 29.2k
7 votes
Accepted

Why doesn't the Python window in ArcGIS autocomplete arcpy.Describe objects?

Because the properties of a 'Describe' object are not a fixed list as they are for the other object types in your autocomplete examples. The list of properties depends on the type of object passed to ...
user avatar
7 votes
Accepted

Identify and delete all unrequired fields from Shapefile using ArcPy

You are listing field objects with ListFields, not the field names which should be input to DeleteField. So change: [field for field in fields if field != "FID" or field != "Shape"] to: [field.name ...
user avatar
  • 51.4k
6 votes
Accepted

Calculate all 'Null' integer fields to '0'?

You can do this for many fields with some Python. This is a stand alone example, but it'd be easy to write this into a script/Python toolbox. Or you could embed this into another loop and do this on a ...
user avatar
  • 6,146
6 votes

ArcGIS crashing with Tkinter?

Tkinter is not compatible with any version of Arcmap desktop. As a script you are running pure python, and not using the ArcMap desktop application at all, which is why you are seeing different ...
user avatar
6 votes

Labels outside polygons in ArcMap?

You can set the placement properties which should take care of this. Go into your layer properties and click on the Labels tab across the top. Click on Placement Properties... and then check the ...
user avatar
  • 986
6 votes
Accepted

Convert shapefile to WKT using ArcPy

Firstly, "SHAPEFILE@WKT" should be "SHAPE@WKT". Secondly, your WKT will be in exactly the same coordinate system as your shapefile. If you're getting strange results, your data is probably not in ...
user avatar
  • 51.8k
6 votes
Accepted

Exporting geodatabase feature class to shapefile changes the attribute table

There is a bug discovered in ArcGIS 10.3, so it probably applies to newer versions since it hasn't been solved: Bug BUG-000084520 - Field values in a shapefile attribute table are corrupted when ...
user avatar
  • 9,567
6 votes
Accepted

Choosing cell size in LAS Dataset to Raster Tool

Esri provides a guide on how to choose CELLSIZE, Assessing lidar coverage and sample density For sampling, choose CELLSIZE. You might think the average point spacing is a good cell size for the ...
user avatar
  • 11.8k
6 votes

Transferring mxd file from one system to another using ArcGIS Desktop?

Data is not stored in the MXD, so if you move only the MXD the data will not be moved as well. If the data is moving with the MXD, then under File > Map Document Properties check off "Store relative ...
user avatar
  • 115
6 votes
Accepted

Adding python packages to ArcGIS?

In your answer screenshot you opened the python interpreter in your command prompt by typing python. This is similar to the ArcGIS (or QGIS) python consoles. This is where you can write python code, ...
user avatar
  • 3,184
6 votes
Accepted

Python Toolbox - Only update parameter when specific parameter changes

The "arcpy way ™" is to check if parameters[0].altered and not parameters[0].hasBeenValidated: According to the documentation: altered altered is true if the value of a parameter is ...
user avatar
  • 51.8k
5 votes
Accepted

How do I include 64 bit python with ArcGIS 10.4 install?

The download for the 64 bit geoprocessing installation is not freely available. I found it in my.esri.com under My Organizations -> Downloads -> ArcGIS for Desktop 10.4 -> ArcGIS for Desktop ...
user avatar
  • 773
5 votes
Accepted

How to aggregate a list of raster in Composite Bands arcgis

I tried this code and it worked. import arcpy arcpy.env.workspace = r'C:\GIS\MyRasterFolder' #My directory of rasters rastList = arcpy.ListRasters() myNewRast = arcpy.CompositeBands_management(...
user avatar
  • 365
5 votes
Accepted

Losing data when updating ArcGIS for Desktop?

Personally, I would not store any important data in my Documents folder. However, I would not expect an ArcGIS for Desktop upgrade to overwrite the folder named ArcGIS within it. I would be more ...
user avatar
  • 63.7k
5 votes

What is M-aware polyline in ArcGIS Desktop?

An m-aware polyline has the ability to store m-values (in addition to x and y values). M-values are 'measurement' values, for example the distance along a given line. They are often used in linear ...
user avatar
5 votes
Accepted

Numpy Array to ArcGIS GRID gives ValueError?

Assuming r"E:\depthtester2.npy" is a saved array, use numpy.load to avoid the ValueError, and as noted in the comments, you need to pass a point object to NumPyArrayToRaster or you'll get a TypeError. ...
user avatar
  • 51.8k
5 votes

Export summary statistics to other format than Excel

Use Table To Table which says that it: Converts an input table to a dBASE or geodatabase table. Name your output table *.csv, for example outtable.csv
user avatar
  • 51.4k
5 votes
Accepted

Calculating distance from point to polyline

Script below designed to run from mxd. It assumes that you have empty a table (“nearLines”) to populate in mxd: Where pointID and lineID are fields to store OIDs of input layers (type long), ...
user avatar
  • 21.4k

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