Search Results
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 |
Python is an open source interpreted programming language used in many GIS programs.
1
vote
Compatibility of Python 2 and Python 3 environments with ArcPy
To get both Python 2.x (comes with ArcMap) and Python 3.x (comes with ArcGIS Pro) working on a machine which is having any difficulties I do this:
Uninstall both ArcGIS Pro and ArcMap
Reinstall both ArcGIS … Pro and ArcMap
I am no expert in Python installs so I try to keep them simple, and this method sets the paths to a state enabling both Python 2.x to work with ArcMap and Python 3.x to work with ArcGIS …
7
votes
Accepted
How to ensure centroid is calculated within polygon?
You do not say whether you are using ArcPy with the ArcGIS Pro or ArcMap application of the ArcGIS Desktop product so I'll assume that it is ArcGIS Pro and reference that documentation.
In the PointGe …
1
vote
AssertionError: Invalid MXD filename
One way to address that is by using Python string formatting. …
2
votes
Accepted
Set the feature class for a Python script to act upon in ArcMap
To do this I would just use ArcPy, a SearchCursor from its Data Access (arcpy.da) module and Python list comprehension. …
2
votes
Importing otbApplication in Python?
As commented by @gene you appear to be getting this error:
Because otbApplicationis not in the PYTHONPATH of QGIS (you can use
import processing.algs.otb)
2
votes
After upgrading ArcGIS Pro getting "Failed to Initialize Python Interpreter" error
However, with the Python window failing to initialize I think the quick fix will be to uninstall/reinstall ArcGIS Pro which should make sure that it can find Python 3.6.5 in the expected location. …
0
votes
Click on a point and perform a geoprocessing tool?
As commented by @KHibma:
If you want an example, the script tool here makes use of input
featuresets:
http://www.arcgis.com/home/item.html?id=efacb13eced948b6b006079f13fb9b0b
(makeBallDiamon …
3
votes
Indentation error while converting csv to shapefile
Your last two lines need to be indented:
for i,row in enumerate(i):
shp.record(row[i])
shp.save("conv.shp")
PEP 8 convention is to indent using four spaces
4
votes
Adding python packages to ArcGIS?
To install using pip, if it is correctly installed, I think all that you need to do is:
Make sure that C:\Python27\ArcGIS10.4 is in your Path environment variable
Use python -m pip install <module> from …
1
vote
Accepted
Debugging function takes exactly 3 arguments (1 given)?
When you call it using:
numSchools("There are a total of: "),count
you are only providing one parameter value i.e. the string "There are a total of: "
The above is why Python reports:
numSchools … () takes exactly 3 arguments (1 given)
Your error is pure Python and nothing to do with ArcPy, which you can see by running:
def numSchools(work, shapefile, sTyp):
print work
numSchools("There …
0
votes
Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error
If you're rolling
your own python, the numpy and matplotlib installs should find the
64bit python install and put them in there when installing. …
0
votes
Copying content from one Portal for ArcGIS to another using Python?
To do this I suggest looking at Esri's portalpy which is:
A module that allows you to administer Portal for ArcGIS and ArcGIS
Online.
5
votes
Can a feature class be stored as a shapefile?
I found a Spatial Times blog entitled Shapefile vs Feature Class by searching Google:
A Shapefile is a Feature Class. Although the intended question
probably wasn’t answered here. But let’s go a …
6
votes
Accepted
How can I turn a python list into a table?
To do this you should use a combination of ArcPy and Python.
You can use Python's enumerate function to get a number for each item in your list. …
-1
votes
Checking for number of shapefiles in directory using Python?
To answer this question nowadays (since ArcGIS 10.1 SP1) I would recommend the answer from @djq in conjunction with using arcpy.da.Walk to walk the folder structure:
Generate data names in a direc …