Questions tagged [python-2.7]

Version 2.7 of the Python programming language

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Adding tool from Python script

I am trying to add Python script as a tool in ArcMap 10.6. I have the result or outcop3 saved in the folder Outputs. I added a output folder in the parameter and made the direction as output but i am ...
0
votes
1answer
28 views

How can I create random points with “CreateRandomPoints_management()” function, from ArcPy library, with minimum distance?

I've been trying to create random points to sample some locations based, at first, on a field which contains the number of samples I want. But when I tried at first, in almost every feature it was ...
0
votes
1answer
38 views

Removing empty dataset from gdb

I want to delete about 25 datasets that are empty from my gdb file which consists 30 datasets. I am invoking pPthon window and trying to execute this script: import arcpy from arcpy import env env....
1
vote
2answers
92 views

Extracting values of some columns with ArcPy

I've been trying to run some code to extract the values from a column and random sample some of them. The problem is when I try to append values from the cursor to a list. When I append values to the ...
0
votes
1answer
52 views

Cannot use “CalculateGeometryAttributes_management()” tool to calculate the centroids of features with Arcpy

I've been trying to run some code in Python with ArcPy library. Everything is working fine, but in the end of the code there is a part that I want to calculate the centroids, x and y, with ...
1
vote
1answer
18 views

Cannot generate subsets of feature class with arcpy (ArcGIS library in Python 2.7)

I'm having a hard time here on processing GIS data in Python, using library arcpy. I've been trying to generate independent features from a feature class based on a field of the attribute table which ...
0
votes
1answer
52 views

Python 2.7 stand alone script for compounded with statement. Errors 'column specified does not exist - but it does

I'm writing a standalone Python script to use for labeling ArcMap 10.7 data. (Want to avoid label expressions for portability, etc). I'm attempting to use ID attribute to label based on ADMIN_ORG ...
0
votes
0answers
31 views

py2exe executable packaging with ArcPy: “The following modules appear to be missing …”

I am trying to create a working executable, and here's what I did: I followed the instructions found in the ESRI community, here: https://community.esri.com/thread/164101 I follow these steps and ...
0
votes
0answers
42 views

How do I assign values of a field, to another empty field when a conditional statement pertaining to a third field is considered?

When I run the code below I don't get the output I'm seeking. The "max_proportion" field is assigned the text LEVELMEAN instead of the values for each row within the "LEVELMEAN" ...
3
votes
0answers
100 views

.exe Packaging for Python files with ArcPy?

I've written a little program that's meant to function as a stand-alone, not as an add-in. I'd like to be able to pack it up as an .exe, rather than ask my users to run the script. It does import ...
0
votes
0answers
23 views

How to pass multiple values from one sample to nc variable?

I am using the following script to write the date and the snow cover values from each of the 258 files into a single NetCDF file. But python is not letting me add these for some reason. The code is ...
2
votes
2answers
57 views

Cannot calculate length of roads

I would like to calculate the lenght(km) of each line in shapefile of roads in a study area. I tried to use "Calculate Geometry" but it doesn't work! I cannot select 'Units', and 'Property' for '...
1
vote
1answer
29 views

Invalid Syntax on Update Cursor update

I'm using a dictionary created by a search cursor from one feature class to update another feature class with an update cursor. I'm getting an invalid syntax error for the cursor.updateRow(row) and.....
1
vote
1answer
35 views

Multiprocessing ERROR 000210 Cannot create output 'name' Failed to execute Intersect

I am trying to use multiprocessing to process intersects between polygons and points for a list of states and territories (the data sets for the points are large, so my hope was that the ...
0
votes
0answers
22 views

Create a loop to run and store the r.stats output of several viewsheds?

I have 15 viewsheds (view 0-14) from which I would like to export the cell count. I can do this for one viewshed through: count=[] i=0 viewshedSize=grass.read_command("r.stats", overwrite=True,flags=...
0
votes
1answer
23 views

Adding multiple fields for multiple feature classes in a single geodatabase

I am trying to add multiple fields to a list of feature classes in a geodatabase for NextGEN911. I am having trouble executing this line of code because I am getting the following error #Import ...
2
votes
0answers
14 views

Determining raster points inside polygon

I am trying to perform zonal statistics on a input DEM and a polygon shapefile using ArcPy in Python 2.7. I have done this in Python 3, but want to be able to do it using ArcPy tools in Python 2.7. So ...
0
votes
0answers
46 views

No response from addPart operation when trying to upload parts of .tpk to AGOL (Python, requests, ArcGIS REST API)

Trying to automate the updating of a large .tpk on AGOL. When the .tpk is updated on my servers I do the following: Break into parts Call updateItem operation with multipart = true Make a request to ...
1
vote
0answers
60 views

ArcPy for loops increase duration with each iteration

I am running an ArcPy script with IDLE 2.7 For each line in a geometric network, it traces the path to a fixed location from that input line. For each input line, it does this trace with all other ...
0
votes
0answers
17 views

Get the count of no. of polygons after intersecting shapefiles

There are 2 shapefiles: 1. A polygon shapefile 2. Grid shapefile(which needed to be run in a loop) Need to intersect the above 2 shapefiles and to get the count of no. of intersected polygons(which ...
0
votes
0answers
70 views

Handling nodata values in raster in Python

I would like to set value of raster -999.0 as NaN in crop_image function, while reading/cropping file: for band_path in range_bands: # open raster as numpy array by rater.io in content manager(...
0
votes
0answers
19 views

Creating Shapefiles from Feature Classes based on field names as lists in a Dictionary

My project is to take specific feature classes in a geodatabase and export them with only a selection of fields as a shapefile into another folder. Accomplishing that is easy enough. Doing it in a ...
0
votes
0answers
55 views

Extract related tables of a feature class to excel?

I have a feature class and a bunch of table connected to each other with relationships (please see the scheme of them down below). My goal is to extract the attribute table of fc as well as all ...
1
vote
0answers
24 views

Translating OMI(AURA) HDF5 To GeoTIFF?

I have omi (aura satellite) level 2 data sets for the aerosol product in he5 file format. Now I want to read that he5 file and save it as geotiff format in python. Could you help me anyone regarding ...
0
votes
1answer
38 views

Can an input be the same as the target with arcpy.Append?

I am basically trying to append the records of one feature class to another using arcpy.Append_management. They have similar but different schemas (they both have a uniqueid column but they also have ...
1
vote
2answers
70 views

Delete duplicate records from feature class in Python

I saw some examples with for loop to find duplicates. I had 1.5 million records in feature class, what would be fastest way to find duplicates and delete that particular rows. Based on three fields, ...
1
vote
0answers
32 views

Listing items using QGIS combo box from PostgreSQL

I am building a plugin for QGIS which will have a combo box listing data from PostGreSQL. I have already connected PostGreSQL. Now I would want to make this a plugin and add the list of jobs to the ...
0
votes
0answers
28 views

Reading multiple rasters via fileinput.input()

I want my ArcGIS-related python2 script to run on several tiffs in a separate directory. I need to provide the filenames in the interpreter so that my script recognizes them as filenames and loads the ...
0
votes
0answers
30 views

Alternatives to ArcGIS' “RegionGroup” a raster

I'm using the ArcGIS Python 2.7 interpreter in my PyCharm as I need several algorithms of the ArcPy package. However, I am having trouble with the RegionGroup of ArcGIS 10.7, as it sometimes crashes ...
0
votes
0answers
196 views

Displaying projection with IMSHOW()

I am having an issue displaying satellite data on the correctly projection using cartopy and imshow. I am unsure of the initial data projection, but I am trying to put it into Plate Carree with a ...
1
vote
1answer
59 views

How to disconnect a feature from Geometric Network using Python ArcGIS

I am creating a Python add-in for ArcMap, which on click, will disconnect the feature from Geometric Network and then delete it from the feature class. But ArcPy doesn't have any method to disconnect ...
0
votes
0answers
18 views

To create a custom user login for DB manager tool in QGIS using Python console of QGIS

I am able to access the db manager window using Python - QGIS for giving db parameters, but I want to open a dialog box when user clicks on the db manager tool (the user should be able to give ...
0
votes
0answers
88 views

Import error with Mapnik in Anaconda 2

I'm using Anaconda to write geographic programs, so I need to use packages like Mapnik. After installing Mapnik in Anaconda2, it started to error. First about Mapnik itself and after do some actions ...
0
votes
1answer
54 views

Remove layer assertion error

I am using below code to remove any layer if it has zero features in it. mxd = arcpy.mapping.MapDocument("CURRENT") aDF = mxd.activeDataFrame namE = ["No_Work_Done"] if int(arcpy.GetCount_management(...
1
vote
2answers
43 views

ArcPy Tool Validator error with defined parameter value

I am using ArcMap 10.3.1. I have two parameters for my script tool. The first is the type of product to be created, the second is the scale of the product. Digital Map / No scale required are the ...
1
vote
0answers
26 views

Getting (0,0) instead of the intersecting co-ordinates value

This code works below fine when line(The Circle I mean) intersects more than two new lines but fails when both the intersection falls in the middle of the same line polygon_path = iface.activeLayer() ...
1
vote
0answers
46 views

Renaming pre-existing table Field name using PyQGIS

I am using PyQGIS with QGIS 2.84. This is the code I have used: layer = iface.activeLayer() parking_layer_field_names = [str(i.name()) for i in point_layer3.pendingFields()] layer.startEditing() ...
0
votes
1answer
41 views

Run code on pressing a key in Pythonaddins

I tried making an addin having below code where I want the user to press a predefined key and the "required_code" should run on the selected features. import arcpy import pythonaddins class Key1(...
4
votes
1answer
1k views

Unable to install plugins in QGIS 3.10 for Mac. No python support detected

I'm aware this question has already been asked numerous times in various forms, but I'm not finding any solutions that work for me. "No python support detected" in QGIS. Issue: Tried: 1. Updating ...
1
vote
1answer
65 views

Why will arcpy.Project_management not create output?

I have 2 feature datasets in a .gdb (CNMS_Inventory and CNMS_Inventory_Albers). I set the dataset for CNMS_Inventory to 4269(NAD83) when I created it and it contains a feature class called ...
0
votes
1answer
52 views

Applying field mapping during Merge using ArcPy

I am trying to merge 10 stream feature classes together using arcpy. But I need to limit the number of fields in the output (all feature classes share the same fields). working_dir = r"C:\Projects\...
1
vote
1answer
59 views

How to specify fields to use in a merge

I am using arcpy to merge multiple feature classes from a list of feature classes. They all have the same fields. Let's say they all have the fields = ['CO_FIPS', 'MILES', 'FLOOD_ZONE', 'VALID', '...
2
votes
1answer
77 views

Calling a Class from Another Within a Python Toolbox

Using the example below, both ToolOne and ToolTwo have two parameters each, and are independent functions in their own right, but also form the basis for a chain of functions for an output. I am ...
0
votes
1answer
29 views

ArcPy to select by location not showing selected features in attribute table

I have a button where it first calculate no of features in a specific layer and then runs the "are_identical_to" and update "D". After that it checks if the no of counts in two layers is same? If not, ...
0
votes
1answer
35 views

Combobox value increment and update

I have made a custom add-in for my building ID update tool. The objective is: user will write an alphanumeric value in the combobox like 'x100'. When a user selects a bunch of polygons(building) and ...
1
vote
0answers
27 views

My UpdateCursor is not working. The attribute table of my new shapefile is not updating [closed]

I am new to arcpy. I am trying to do a few things with a shapefile. First I created a new shapefile with specific dataset that I wanted to work on. So far everything works until the UpdateCursor. When ...
4
votes
1answer
74 views

Not able to update the “ACTION” field

Currently I am working on a GIS project where I have to update a field in a layer with some values to get my work done. Because the manual efforts are time consuming hence I added a custom addin to my ...
0
votes
3answers
53 views

How to access/manipulate a feature class/dataset in a personal database by using cursor via ArcPy?

I wrote an ArcPy script which uses cursors and it works fine with shapefiles. However, it does not work if I execute the same thing in a personal geodatabase. Should I use different format for a ...
0
votes
1answer
51 views

Finding intersection point between two arcs? [closed]

I am trying to find the intersection between two arcs. I have done this for line segments using shapely package. Does anyone have any advice?
1
vote
1answer
43 views

Turn string data (of GPS coordinates) into a GPS tracker = frozen map. QGIS2.14/Py2.7/Win7/LAN

I am currently involved in a student project which is to turn string GPS coordinates into a GPS tracker. This is my current work: First, the UDP data is shared through a LAN (No internet available) ...

1
2 3 4 5
14