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.

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
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
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
2 votes

Starting and stopping ArcGIS Server map services using Python?

For ArcGIS 10.7, and some earlier versions, a complete set of python scripts to stop, start, delete and a bunch of other things can be found here: http://www.arcgis.com/home/item.html? … id=12dde73e0e784e47818162b4d41ee340 (there is also a .exe inside this if you absolutely need a full executable) Or dive into the help and read about the many options (out of the box command line, python
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
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
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
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
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
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
1 vote

How to provide a default value in an arcpy script?

To answer the 'default' part of your question, you could: make the input parameter optional. if no input was given, do something like the following to set a value Input__DEM_ohne_Hecke = arcpy.GetP …
KHibma's user avatar
  • 17k
0 votes
Accepted

Deploying localization files for Geoprocessing service in ArcGIS Server

Take a look at the Authoring Geoprocessing Services with Python help, specifically the section on Importing other modules. This is essentially the same scenario you're working on. …
KHibma's user avatar
  • 17k
2 votes

Is there a reason why empty .json files can not be feature classes or shapefiles when conver...

If there is no geometry, how do you suppose the tool would know what geometry type to create? No geometry "featureclasses" are tables. The only way you can set the geometry type is if you happen to h …
KHibma's user avatar
  • 17k
3 votes

What Python libraries are installed with ArcGIS Desktop 10.x

I don't believe there is a documented comprehensive list, because simply, the Python requirements for ArcMap 10.8 were: Python 2.7.16 NumPy 1.9.3 matplotlib 1.5.2** (might only be a server requirement … ) Yes, Python came with the installer and was laid down, but you could make use of your own Python as long as you met those requirements. …
KHibma's user avatar
  • 17k
1 vote
Accepted

Is it possible to publish a geoprocessing services that uses another dll?

Yes. But the publishing process will NOT copy the dll. You'll get an analyzer error. You'll need to register the DLL directory with the datastore so ArcGIS Server doesn't try to copy it. See this lin …
KHibma's user avatar
  • 17k

15 30 50 per page