Version 2.7 of the Python programming language

learn more… | top users | synonyms (1)

-1
votes
1answer
35 views

JoinField General Function Failure[featureclasName] [on hold]

I am trying a simple joinfield in arcpy and i keep getting the error: Execute error: ERROR 999999: Error execution function General function failure [AA] failed to execute JoinField Below are ...
1
vote
0answers
37 views

Multiprocessing in python qgis?

When i try to do mutliprocessing in python Qgis it doesn't work from multiprocessing import Process,Lock import multiprocessing def name1(l,i): print i if __name__=='__main__': lock=Lock() ...
0
votes
1answer
34 views

Can we count the points in polygon using pyqgis code? [duplicate]

Does anyone know how to calculate the point in polygon from the given points and the buffer output using python qgis. I have every thing loading the data and retrieving the output. But now I want to ...
2
votes
2answers
43 views

Finding the pixel coordinates using GDAL/numpy

Is there a way to get the XY cordinates of a pixel based on the array index using numpy/gdal? I have a new set of extents for a raster and, based on these newer extents, want to determine the ...
0
votes
1answer
52 views

how to update values from python list into feature class

I have a feature class and python list. Feature class has 80 fields and 500 records. List also has 80 sub-list and 500 elements in each. So basically they are same dimension so to say. I want to ...
1
vote
0answers
24 views

How to load and execute python scripts from a local path after python console is triggered in QGIS?

I had created a file named "startup.py" in users python home directory (... .qgis2/python) and i had triggered the python console in startup.py file by import qgis ...
1
vote
1answer
69 views

How to use da.UpdateCursor with dictionary?

I'm working through some da.UpdateCursor scripts to make updates to a fgdb. Although the script below works successfully, I want to use the dictionary that I have created rather than the manual [ ] ...
3
votes
1answer
78 views

Using Square brackets in ArcPy update cursor?

I am looking for guidance regrading the usage or meaning of the square brackets in arcpy update cursor (Win 7, ArcGIS 10.2, Python 2.7.5) Although I have serched long and hard with various web ...
1
vote
1answer
63 views

-9999 (no data value) becomes 0 when writing array to GDAL memory file

I am trying to reproject and resample (1000m ->> 30m) a raster image (shape 238X406) using gdal.ReprojectImage() function in Python. The input file has -9999 cells as no data value. The result is an ...
2
votes
1answer
31 views

How to use spatial filter in PyQGIS?

I have a buffer and need to filter a multipoint layer (QGSVectorLayer) so that I would get only features intersecting the buffer. What I've found: a) setFilterRect() This doesn't accept polygon ...
4
votes
1answer
78 views

date in shapefile created by geospatial python module appears wrong, but isn't

I noticed something weird when messing with the geospatial python's shapefile module (no complaints here, this module is awesome and the only pure python way to write shapefiles). When adding date ...
1
vote
1answer
24 views

ExecuteError: ERROR 000358 - Using a variable within arcpy.Select_analysis() [duplicate]

I have looked at the solution here and while it is very similar to the question I'm asking I ran into the same issue after implementing its syntax. I feel like I'm still missing something related to ...
3
votes
2answers
62 views

How can I create a QGIS plugin that needs an external Python library?

I’m trying to enhance QGIS's Profiletool plugin by adding DXF export functionnality. For this, I need to to import dxfwrite library. As it's installed on my computer, i added the following lines to ...
0
votes
0answers
51 views

Python version issue

I am using arcgis 10.1 and running this script on python version 2.7.2. # Import standard library modules import arcpy, os, sys from arcpy import env # Allow for file overwrite ...
1
vote
1answer
41 views

Plotting “large” image with points with matplotlib - MemoryError

I want to plot an image of 3193 x 3293 pixels with 1502 points. When running in a smaller image and less points (934,722 pixels and 60 points), everything runs perfectly. I wrote like this: # I am ...
0
votes
1answer
45 views

Python problem using GDAL

I used the instructions at https://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/ I downloaded the following files: GDAL-1.11.1.win-amd64-py2.7.msi ...
1
vote
1answer
54 views

Trouble using gdal utilities in python (no output files created)

I am trying to use gdal utilities like gdal_polygonize in python to polygonize my raster image but I'm having trouble understanding the commands. What I mean is in some places the command is of the ...
0
votes
1answer
45 views

Using sublime text for Arcgis or Arcpy?

I have installed python 27 in one directory c:\program files\python27 and arcgis 10.2 in another directory c:\program files\arcgis, and within this folder there is c:\program ...
1
vote
1answer
36 views

Measurement of accuracy for image segmentation of land cover image in python

I have a land cover image and I segmented it using K-means clustering algorithm. Now I want to calculate the accuracy of my segmentation. How do I do that? I have read about dice similarity ...
1
vote
1answer
67 views

extraction of regions from segmented image in python

I have a land cover image and I segmented it. Since the images are large in size, I am uploading only a part of them. here is the original image's part : here is the corresponding segmented image: ...
1
vote
1answer
73 views

Finding and deleting duplicate records in attribute table in QGIS

I have around 1 Lakh+ (100,000+) point features in my shapefile, which has some duplicate records in it. I had found the duplicate records present in the attribute table and print those in python ...
1
vote
0answers
73 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
40 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
1answer
43 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 ...
3
votes
3answers
74 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
40 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
25 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
34 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
65 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
60 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
2answers
121 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 ...
2
votes
1answer
100 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
66 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
57 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
61 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
43 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
311 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
32 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
58 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
36 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
60 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
47 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
47 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
46 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
179 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
69 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
149 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
26 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
88 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
109 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 ...