Version 2.7 of the Python programming language

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

Import error: no module named _gdal_array

I am using python 2.7 and have gdal installed. I want to read an entire .jpg image at once and so I used statement import gdal from gdalconst import * driver = gdal.GetDriverByName('JPEG') ...
0
votes
0answers
11 views

Trouble installing Rasterio module for python 2.7 on windows

Can anyone please explain to me in step by step instructions how to install rasterio with Python 2.7 on Windows. I have Windows 8 and have tried information on Link I have installed all the ...
1
vote
0answers
38 views

Python script changing ArcSDE data source not updating all MXDs?

We recently made significant changes to our ArcSDE database setup by splitting our original database into five databases and renaming most of the feature sets. Right now I have a script that opens all ...
1
vote
1answer
36 views

How to troubleshoot a hard crash on CopyFeatures_management()

I have a script that uses arcpy.CopyFeatures_management(FEATURE_CLASS_SDE, FEATURE_CLASS_LOCAL) to copy a feature class from our enterprise SDE to a local file geodatabase. For the most part, it works ...
-1
votes
0answers
26 views

How can I install Pywin32 with the ArcGIS 10.3 python 2.7?

After installing Python2.7 with ArcGIS Desktop 10.3 and installing pywin 2.7 32bit as Administrator (very important!), I got the following error message: close failed in file object destructor: ...
3
votes
3answers
66 views

How do I compare two features to test if they are identical?

What is the most efficient method for determining if two features (points, lines, or polygons) are geometrically identical? I'm not concerned about a square figure that contains eight vertices (four ...
0
votes
0answers
31 views

Summarize an attribute table using python

I am a trying to summarize an attribute table for a dataset that I have. The problem is similar to the one discussed in this question here: ...
0
votes
0answers
20 views

How to `Enable SQL Access` through ArcPy 10.2

I have a multiversion view for a feature class. When I add any field in feature class, it does not reflect on its multiversion view. I have to manually right click on feature class -> Manage ...
1
vote
1answer
23 views

ImportError: cannot import scipy from windows powershell

I am having an importError message while trying to import scipy from powershell. But I am able to do this when I try to do this in the python shell in ArcGIS. The error I get is this: Traceback ...
1
vote
1answer
62 views

Compute annual mean of overlapping cells using daily rasters

I am stuck at somewhat simple looking calculation. I have daily temperature rasters from 2001 to 2014 with following name format: `2001001` `2001002` | | `2014365` I want to compute annual mean ...
0
votes
0answers
42 views

Advice for Python with GIS [duplicate]

How you can I install different packages in python and not have problem with the arcpy module in ArcGIS? I want to be able to run Python as standalone, do other python programming as well as GIS ...
0
votes
0answers
50 views

Configuring Python to avoid conflict with ArcGIS for Desktop (ArcPy)?

I am trying to find the best way to configure a new version of python in my computer (windows) so that I do not have any problem with the python version that I have with ArcGIS. Is there anyway to ...
0
votes
1answer
53 views

Can't get gdal_merge Python script to run

I downloaded and installed GDAL. I am using Python 27. I had to use the following commands at the IDLE Python GUI: from osgeo import gdal,ogr sys.path.append('C:\Program Files\GDAL') import ...
1
vote
1answer
44 views

Rasterize a shapefile with Geopandas or fiona - python

I need to rasterize a really simple shapefile a bit like this http://tinyurl.com/odfbanu. Which is just a shapefile coutaining counties in the US.I have seen this previous answer : GDAL RasterizeLayer ...
0
votes
1answer
47 views

TypeError: value #0 - unsupported type: datetime.timedelta

The following code runs fine minus receiving the error below, which doesn't make any sense (to me) as I have other UpdateCursors and perform UpdateRow(row) with other date values. As can be seen ...
0
votes
1answer
54 views

Script not working as expected

I'm newbie to python and I wrote this script. It is supposed to check the text in the fields fld_o and fld_d and write a value (just numbers in a sequence) to a newly created field fld_name. While ...
0
votes
1answer
54 views

Usage of 'in' in Python [closed]

Can someone please tell me whats happening here. I'm still new to Python for ArcGIS and I really need to understand this piece of code for my project. How does dct_max work and how is tpl created? At ...
0
votes
1answer
26 views

Filter OGR datasource in Python (or XML)

I'm trying to streamline the process whereby we build tiles (of ~30 layers, representing planning zone and zone-overlay boundaries). I have a strong preference for FOSS tools. A couple of our people ...
1
vote
1answer
112 views

import arcpy failed Python 2.7 with ArcGIS 10.3 64-bit Background geoprocessing RuntimeError: NotInitialized

I want to run a python script that uses arcpy. It was running earlier on a 32-bit machine without problems. On a 64-bit machine I get a MemoryError. The 64-bit backgroundgeoprocessing of ArcGIS 10.3 ...
0
votes
0answers
22 views

Problem with schema synchronization using Import Replica Schema (Data Management)

I want to synchronize the schema of replica. The steps I am following is documented in ArcGIS Resources: Export the geodatabase_1 replica schema using Export Replica Schema (Data Management) tool. ...
2
votes
2answers
50 views

Reading next row of *.txt column inside ArcPy for loop for batch process?

I'm not sure how to approach this problem with python, but in plain english, I'd like to rename rasters with the names given in the *.txt file (see screenshot) and concatenate the basename given by ...
0
votes
1answer
28 views

Valid input for ArcPy raster to polygon in 10.1?

I'm experiencing some strange problems with this code starting from files with *.tif.tif to what seems should be *.tif.tif.shp according to the code. The code is not working because of the ...
0
votes
1answer
37 views

Debugging AttributeError: 'Result' object has no attribute 'save' from ArcPy script?

I Keep getting this error message when i run the code below, can anyone tell me why? Error message: Traceback (most recent call last): File ...
1
vote
1answer
40 views

NAD83 2011 AZ central projection

I am having trouble getting GDAL to read a file geodatabase with data projected in NAD83(2011) State Plane Arizona Central FIPS 0202. I have developed the following code: # standard imports import ...
0
votes
0answers
37 views

Error 010092 for FeatureToRaster in Pythonwin

would someone be able to help me with this problem. As shown the process works for three files (of approx 1000) and then throw the Error 010092: Invalid Output Extent. All the files have been ...
0
votes
0answers
27 views

icu4c + Mapnik - I want to switch icu4c from 55.1 to 54.1 to get Mapnik to work

What is the best way to downgrade icu4c from 55.1 to 54.1 on Mac OS X Mavericks. I tried brew switch icu4c 54.1 and failed. Reason to switch back to 54.1 I am trying to setup and use Mapnik. I was ...
1
vote
1answer
118 views

QGIS Wien 2.8.1 RuntimeError concerning the sip module on Win 7

I am running windows 7 64bit and python 2.7.9 I just installed QGIS Wien 2.8.1 and it crashes on start up with the following code: Couldn't load PyQGIS. Python support will be disabled. Traceback ...
-1
votes
1answer
63 views

Python code for calculation between fields in shapefile?

How do I calculate sum of selected multiple field in shapefile by using python. here i want to do sum of selected fields row by row. for that i want to use equation , which is: W= sum(selected fields ...
0
votes
1answer
67 views

How to setup GDAL setting for python using OSGEO4W?

I have installed OSGEO4W installer. In that I have installed Express Desktop install option. QGIS GDAL uDig and GRASS GIS were installed in C:/OSGEO4W64. I have added 'C:/OSGEO4W64/bin' in the path. ...
1
vote
1answer
22 views

How to make a loop for select by attribute?

I am trying to pull out a sample out of a geodatabase file. I have 100800 sample and I need to select 28 records, basically every 3600, I am going to start with FID=0 and go from there. Unfortunately ...
1
vote
1answer
47 views

How do I get items from OrderedDict to parse addresses

My task is to take a full address and parse them out. I found a module called usaddress ( https://pypi.python.org/pypi/usaddress ) that will take '12345 Old Hillbilly LN Lot 7 Oklahoma City, OK ...
2
votes
1answer
87 views

How can I use updateParameters to handle both points AND polyline feature layers?

I'm using ArcMap 10.2.1 and Python 2.7.5. I would like my updateParameters to enable and disable fields based on if a feature is a point or a polygon. If the point is selected then I need the ...
1
vote
1answer
98 views

GeoDjango Setup: Python 'GDALAllRegister' Attribute Error

I am trying to setup Geodjango 1.8 in a virtualenv with Python 2.7.9 (Win32). I have installed and setup Postgres/PostGis and have my Path setup to my OSGeo4W directory. I have also installed the ...
0
votes
1answer
49 views

ArcGIS saving blank file while using ArcPy to join shapefile and Excel table?

I'm working on a project that utilizes ArcPy to join a shapefile and a excel file. This join takes information from the excel file and creates a map that highlights certain areas different shades of a ...
3
votes
1answer
111 views

Arcpy.da.UpdateCursor, Error - Sequence size must match size of row

I am trying to use an UpdateCursor fill in a field but I keep getting an error, can anyone tell me what I am doing wrong? My code is below: import arcpy fc= "C:\Users\Keri\Desktop\GEP_690\Project ...
2
votes
1answer
104 views

DBSCAN gives “AttributeError: NoneType has no attribute issparse”

I am running a Python script invoking the DBSCAN tool to cluster feature points. When I open ArcMap, load the feature layer, and run the script, it works the way I expect it to. But if I run it ...
1
vote
1answer
34 views

Saving each file in for loop gives ERROR 000872?

I am beginner to Python programming. I know, I am asking a really silly question. I am trying to extract DEM for each watershed from a bigger DEM. Therefore, I am using extract by mask. The bigger DEM ...
2
votes
2answers
133 views

How to check active users of ArcGIS 10.2 Floating License with python 2.7?

I want to find the users who are using ArcGIS 10.2 license with python script. Also, what kind of license they are using. Is it possible to get the number of users which are connected to ArcGIS server ...
1
vote
0answers
105 views

Buffer Csv gets repeated when more than one feature is selected in mapcanvas in PYQGIS

I have a function which will allow the user to select a feature or more features in map canvas and performs buffer for the selected feature(s) and writes the output to a csv file. I dont have any ...
2
votes
3answers
109 views

GetRasterBand() method for gdal in Python

I was going through a tutorial book called Python Geospatial Development. On the chapter on using working with geospatial data in python there is an example of a script meant to handle and analysis ...
1
vote
0answers
49 views

Reading/writing utf-8 encoded data using Fiona?

So I have a 'cpg' file with my 'in_file' shapefile data (definitely set to 'utf-8'). I was using 'meta' to create the same schema/crs as 'in_file'...though it runs, my text fields are borked on ...
1
vote
1answer
31 views

Clipping a Raster into 5x5(25) equal tiles through the use of arcpy?

I am curious to find our if there is a way to create a python code that enables you to clip a raster into equal parts example: 5x5(25) tiles with the use of arcpy? From what I can think of you would ...
1
vote
1answer
47 views

No expected output when accessing variable from one function and using in another fucntion

I have a function say selectedfeatures this function would be called when a selection changed event happens in mapcanvas. self.canvas.selectionChanged.connect(self.selectedfeatures) ...
2
votes
2answers
45 views

Updating the Z value within an XYZ.txt file

Following a post from a few weeks ago: Creating polygon from 2 txt files (Parent ID + Coordinates) and thanks to the help and code, the script works very well. Now I need to reverse the process in ...
1
vote
0answers
51 views

Trying to install PyGreSQL, receiving DLL load failed error

I am trying to install the PyGreSQL package into Python 2.7. I am running 32-bit Python on a 64-bit Windows 7 machine. The installer I am using is the file PyGreSQL-4.1.1.win32-py2.7.exe from here. ...
3
votes
1answer
68 views

how to copy layer and add to same mxd and rename layer using ArcPy and ArcMap 10.2?

I am trying to copy a layer in an mxd and add that layer to the bottom of the TOC using Python, but I have not found a way to save the mxd programatically without making a copy. I also haven't found ...
2
votes
1answer
95 views

Is it possible to find the feature class name from a python label expression in ArcGIS?

Does anyone know how to find the path to a feature class within a label expression using ArcGIS? I don’t need to simply display the path. My overall goal is to create a python function to display ...
1
vote
2answers
129 views

Errors using arcpy.CalculateField_management

EDIT: What I forgot to mention when I first had this question is that I was trying to do these calculations on a layer which had joins, BUT where the join was on data that was added from an Excel ...
1
vote
2answers
60 views

Automation of changing symbology for a given layer

I have a shape file that is a 10-by-10 grid of squares. The shape file has 50 attribute columns (named p_1 through p_50) where each column has 100 entries (corresponding to the 100 grid squares) and ...
0
votes
0answers
70 views

Creating Convex hull and finding buffer in QGIS

I have a layer and features are selected using Select Features by freehand tool and for that selected features, convex hull was done and for that convex hull i am trying to find buffer and write it in ...