Version 2.7 of the Python programming language

learn more… | top users | synonyms (1)

3
votes
2answers
45 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
50 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
25 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
36 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
50 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
41 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
29 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
59 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
58 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
49 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
26 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
41 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
72 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
38 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
21 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
28 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
64 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
55 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
89 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
72 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
54 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
56 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
56 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
37 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
196 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
27 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
54 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
32 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
46 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
43 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
42 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
40 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
165 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
66 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
117 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
25 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
65 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
98 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
107 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
54 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 ...
2
votes
1answer
120 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
40 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
154 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
106 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
141 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
52 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
36 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
46 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 ...