Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 1419

Python is an open source interpreted programming language used in many GIS programs.

11 votes
Accepted

Detecting ArcGIS Pro version using ArcPy

You can use: arcpy.GetInstallInfo()['Version'] Strip the ['version'] and you'll get back the entire dictionary of ArcGIS Pro info.
KHibma's user avatar
  • 17k
8 votes
Accepted

Switching between background 64 bit processing and 32 (so I can use 3rd party ie XTools)

In short, you'll need to break up your script into pieces and call them against the version of Python they work with. …
KHibma's user avatar
  • 17k
8 votes

ArcGIS Pro Python Interpreter Setup with Visual Studio Code

Update the following (if the path I used below doesn't match, update as needed) Python > Auto Complete > Typeshed Paths : C:/Program Files/ArcGIS/Pro/bin/Python/envs/arcgispro-py3/python.exe Python > … Python > Python Path : C:/Program Files/ArcGIS/Pro/bin/Python/envs/arcgispro-py3/python.exe Finally, I do all my development in a specific folder, generally new to whatever I'm working on. …
KHibma's user avatar
  • 17k
7 votes
Accepted

How to return text from GP service?

You could return it as a parameter. outputAddress = #logic you already have to get this arcpy.SetParameterAsText(2, outputAddress) #2 being the index, since you have 2 inputs (0, 1), I say 2 bei …
KHibma's user avatar
  • 17k
7 votes
Accepted

ArcGIS Server Geoprocessing Service: Good Async, Bad Sync

Async writes to the Job directory and those results are persisted until the Server cleans them up. Sync sends the results back to the client. With a GP Service you should return a file or data, not a …
KHibma's user avatar
  • 17k
7 votes
Accepted

How to access current job id from geoprocessing script running on esri server?

I remembered an old script I use in testing so I thought I'd share. Maybe it'll help you or someone else. I added the logic to get the GUID. There's probably a better way to do it, but it works. imp …
KHibma's user avatar
  • 17k
6 votes

How can I programmatically get the path of "Python.exe" used by ArcMap

When installing ArcMap it will install Python if it can't find it. It looks in the registry to see if Python is already installed. … cant think of a reason when/why the value of this key would be incorrect, but you could always go this way: Inside the Esri\Desktop hive of the registry is a Python location. …
KHibma's user avatar
  • 17k
6 votes
Accepted

Python Code: Help with Printing a Message from an AddMessage Result?

There are are number of ways you can write out messages with AddMessage. I personally prefer this way: arcpy.AddMessage("Sheet count: {0}".format(count)) Sheet count: 11 You can contin …
KHibma's user avatar
  • 17k
5 votes

Does ArcPy leak memory when importing CSV files?

The following code is meant to be used as a script tool, but it looks like you know enough about Python to modify it to loop through files and output unique ones. …
KHibma's user avatar
  • 17k
5 votes
Accepted

Count rows of attribute table of a shapefile in ArcGIS with Python

arcpy.SelectLayerByAttribute_management("myfeatures", "NEW_SELECTION", "Y=0 and X=0") result = arcpy.GetCount_management("myfeatures") print(result.getOutput(0)) You're trying to use some (maybe) python
KHibma's user avatar
  • 17k
4 votes
Accepted

How to define projection when adding features to a feature service layer using its ArcGIS RE...

whatever matches your coordinates. sr = {"spatialReference" : {"wkid" : 4326}} {**dict(y = x['lat'], x = x['lng']), **sr} Output: {'y': 111, 'x': 222, 'spatialReference': {'wkid': 4326}} Note - The Python
KHibma's user avatar
  • 17k
4 votes

List Map Services and Publish/Delete Map Services using Python in ArcGIS 10.1

For the publishing of map services through Python (and arcpy), look here: http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000006q000000 …
KHibma's user avatar
  • 17k
4 votes

Reducing number of decimal places after X/Y coordinates in a FC

You just need the following in the expression (set the the expression type to PYTHON) round(!POINT_Y!, 2) and round(!POINT_X!, 2) Where 2 = the number of decimal places. …
KHibma's user avatar
  • 17k
4 votes
Accepted

Parsing GeoJSON in Python?

The following code should do what you want. There might be a slightly more elegant way to write it, but I understand your request to pull out each polygon into their own file. import json import os …
KHibma's user avatar
  • 17k
3 votes

How do I serve OSM map tiles (mbtiles) from a Raspberry PI 2?

There was a Ruby/Python implementation which may also suffice. …
KHibma's user avatar
  • 17k

15 30 50 per page