Tagged Questions

A version of the Python programming language

learn more… | top users | synonyms (1)

1
vote
0answers
27 views

set extent for jpeg programmatically

I feel like this should be easy, but how can I set coordinates for a jpeg image using Python? I have a python add-in that draws a polygon and then uses its geometry to post a query request to a REST ...
1
vote
0answers
19 views

Use PyQGIS to import CSV and draw points using different color

A CSV file contains columns latitude, longitude and color. uri = "file:///C:/data/balls.csv?type=csv&xField=longitude&yField=latitude&spatialIndex=no&subsetIndex=no&watchFile=no" ...
2
votes
0answers
23 views

A list of layer names that you want to be turned off when Layers name are in Right to Left Such as persian

When I ran this code I got "UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal" error I don't know why I tried many way but I ...
0
votes
1answer
21 views

gdalnumeric in python virtualenv

I'm having a problem importing gdalnumeric when working on virtualenvs. I'm getting the following error: from osgeo import gdalnumeric Traceback (most recent call last): File "<stdin>", line 1, ...
0
votes
1answer
51 views

Copying XY to clipboard using Python Add-In (ArcMap)

I am trying to create a simple tool to copy XY from where i click the mouse button. What i have done already is: create add-in files using Python Add-In Wizard create toolbar and tool inside it in ...
0
votes
1answer
33 views

How to group tools within a Python toolbox in ArcMap 10.2

I have created a simple Python toolbox at work for use in ArcMap 10.2. It is used by multiple members of staff so I'm hoping to make it as simple to use as possible. It currently only contains two ...
0
votes
1answer
45 views

ArcGIS 10.1, Python 2.7 “RuntimeError: A column was specified that does not exist. ”

When this error is returned, a problematic column must have been encountered. I would like to know WHICH non-existent column has been "specified". How do I obtain this apparently obvious piece of ...
0
votes
1answer
27 views

integrating arcpy with other packages [duplicate]

I have the windows installation of python 2.7 that came with arcgis 10.2. In my linux installation of python, I've become fond of other packages, and I'd like to incorporate them into the windows ...
3
votes
1answer
28 views

PageLayoutObject error when exporting to a TIFF using arcpy and Python

I am having an issue when attempting to export to a TIFF in arcmap, using arcpy in Python. The full process I have scripted is as follows: Add rasters to a raster catalog panning to the raster data ...
1
vote
2answers
37 views

How does QGIS Identify Features plugin work i.e. what is logic behind it?

I'm new to QGIS and python as well. I need attributes and their values of a selected vector layer, in the similar manner as Identify Feature works only difference is I don't wish to show them in a ...
0
votes
2answers
34 views

Converting Feature coordinates to text (same as output from UNGENERATE command in ArcInfo Workstation)?

I am trying to convert stream segments to text. This is function for the script #function to convert feature to text as ungenerate command in ArcGIS workstation def ...
2
votes
1answer
82 views

'QgsVectorDataProvider' object has no attribute 'select'

I want to create a tool layer in QGIS 2.4 that will select any vector features that intersect with that point. In my script I tried the following function: def selectFeature(self, point, button): ...
2
votes
0answers
64 views

Error 000212 Cannot create XY event source from arcpy.MakeXYEventLayer_management?

So I am using arcpy to create an output feature layer. I am using the command: arcpy.MakeXYEventLayer_management(wells, "longitude", "latitude", wells_layer, GEOGCS, ""), where wells is my ...
0
votes
1answer
15 views

ERROR 000539: Error running expression_NameError: name 'shape title' is not defined

I'm trying to get the title of the shapefiles or feature classes that are in a workspace (folder or GDB), into the field as a Name in python. I know this is easier in modelbuilder by adding %Name% in ...
3
votes
1answer
29 views

Accept multiple input types in ArcGIS Script Tools UI

everyone! I'm working on a python script that calculates aggregations of ACS Variables (i.e. adding "Renters who spend more than 30% of Annual Income on Rent", "...40%...", "...50%...", etc.). The ...
0
votes
0answers
15 views

Adding a Property (attribute) to a geometry in Shapely/Fiona

Once you have line and polygon geometries, intersection using Shapely is very straight forward. What I did after that is to integrate all the looped 'intersected' geometries into a MultiLineString. ...
3
votes
2answers
110 views

How I can reverse numbers in a string without reversing any text? [closed]

I have a string, I need to reverse just the numbers in the string without the text: String: [321 test] The result will be: [123 test]
1
vote
0answers
58 views

Python coding problem - unicode string passed from dictionary to AddField

I tried all possible hints but I´m still stuck. I want to write a script that can be executed from a toolbox in ArcMap/ArcCatalog. It should rename fields (build lists with old fieldnames, new ...
0
votes
0answers
15 views

How to solve OD Cost Matrix (SOAP) by Python

I have published a NetworkAnalyst service to solve OD Cost Matrix on my local machine. I want to send origins and destination through python script which hits the service via SOAP and bring the result ...
1
vote
1answer
27 views

A question about pexif info updated

I tried to use pexif to update my photo EXIF with following the work on StackExchange (How to save geodatabase attachments to disk with updated exif data). However, I got the below error message when ...
2
votes
1answer
90 views

Clipping Line shapefiles within extent of Polygon shape?

My question is an extension of Vertical lines in a polygon shapefile. Kindly refer to that question first. What you shall see there is a method of generating vertical lines with respect to the ...
0
votes
1answer
57 views

Passing options to ogr2ogr using python subprocess.Popen

I'm trying to programatically import some shpefiles to postgis, since I need to catch the exit code of the process I decided to use subprocess.Popen. I've managed to import the files using: cmd = ...
1
vote
2answers
80 views

Vertical lines in a polygon shapefile

I am working with a GIS problem using a single input of a polygon shapefile. Consider an irregular polygon. I want to draw vertical lines across the extent of the polygon at equal spacing. How I ...
1
vote
1answer
40 views

Rotating geometry to specific angle using pyqgis?

I do not know how to rotate a geometry using pyqgis. Is there any sample/example code available to show me how?
1
vote
0answers
42 views

Splitting lines once at specified distance from each end?

This is related to an old problem of mine, regarding arrowheads on lines, which doesn't look very nice unless the line is very thin. It's even an ArcGIS idea with quite a lot of votes (although no ...
1
vote
1answer
40 views

Clip layers in a dataframe with a polygon in python?

I'm trying to clip layers in a dataframe with a polygon using python and I've done this python script but it's giving this error:"ERROR 000840: The value is not a Feature Layer" Thanks for any help. ...
1
vote
2answers
65 views

Run FME Script in batch file using .NET

Encountered another roadblock. I have a working FME script that I want to automatically run using a console app. I created a simple batch file which accepts a MDB file path as parameter: fme.exe ...
2
votes
2answers
141 views

Python Window Crash and import arcpy issue

Trying to do anything in the Python shell within ArcGIS 10.2 and it just crashes once I hit enter after writing code, no matter what I do. I've tried to uninstall, deauthorize, reinstall, ...
2
votes
1answer
49 views

How to SUM field, insert SUM into new field based on FIELD

This is a continuation of my previous question in an effort to build upon it. How to SUM field and then insert into NULL column? Given the examples of my data below, I would like to be able to ...
1
vote
1answer
80 views

Import shapefile is not working in pyshp?

I am just trying to use "pyshp" package to open shapefile in Python and use the Attribute data for further development. Firstly I have downloaded pyshp package for python 2.7 and installed it in my ...
0
votes
1answer
122 views

GeoAlchemy: AttributeError: type object 'ColumnProperty' has no attribute 'ColumnComparator'

I installed GeoAlchemy using easy_install but when trying to import it returns the following: Traceback (most recent call last): File "", line 1, in import geoalchemy File ...
1
vote
0answers
63 views

Rendering points and polygons with Mapnik

I've tried to render a few maps in Mapnik and I have a little problem. I want to render a map that contains two layers: point and polygon. I've used this script: import mapnik rule = mapnik.Rule() ...
1
vote
1answer
78 views

How I get dbflib module for python27

I'm trying to use a script by python to download MODIS imagery. I follow this script: http://pyevolve.sourceforge.net/wordpress/wp-content/uploads/2009/02/modis.py. I installed: ...
3
votes
1answer
43 views

raster landuse calculation

I want to calculate the counts of each landuse type based on the unique landuse code from each raster datasets. Raster dataset consists of six major landuse and their unique codes are below: 1) ...
0
votes
0answers
12 views

Pyqgis 2.2 : get signal on feature added : error message

For my pyqgis plugin 2.2, I try to: def logFeatureAdded(self,layerId,addfeatures): message = str(layerId) + " has features added: " for feature in addedFeatures: message += str( ...
1
vote
2answers
84 views

Pyqgis 2.2 : zoom to layer extent?

Regarding my plugin pyqgis 2.2, i can load a vector layer succesfully. But when i try to zoom to the layer extent it does not work. How to do in order to zoom to the layer extent? Thank you very ...
0
votes
0answers
40 views

Get signal on edited feature?

Regarding my pyqgis plugin 2.2 , I've implemented signal on a vector layer event successfully. For instance, whenever i create a new feature, i can read a new basic message appeared via QGIS logging ...
0
votes
0answers
38 views

Read esri shape point data and spline interpolation using python shell scripts?

I am quite new in python scripting. I am a dedicated user of arcgis but this time I have to work without arcgis. I have a point shapefile with 10 different attribute fields of different peat layer ...
0
votes
0answers
25 views

Pyqgis :2.2 : link between a signal and an event

I'm writing a pyqgis 2.2 plugin with qgis 2.2 I succeeded in accessing and displaying vector data (geometries & attributes). I succeed also to create a 'beforecomitechanges' signal ( emitted, ...
1
vote
1answer
39 views

raster to polygon conversion

I 'm trying to automate the conversion of raster to polygon and the rasters files are in "TIF" format which is a "unsigned integer". I have the code below. However, I 'm getting an error while ...
0
votes
1answer
57 views

Type Error with ArcPy Update Cursor

filter = 'LinkID IS NOT NULL' cur1 = arcpy.UpdateCursor("ODDS_Links", filter) high_id = 0 for row1 in cur1: if high_id < row1.LinkID: high_id = row1.LinkID filter2 = 'LinkID IS NULL' cur2 ...
3
votes
1answer
96 views

Conditional formatting for Advanced Label Expression in ArcMap

I am trying to do some conditional formatting in order to highlight specific criteria. The main error I keep getting is that there are no features found. I've done a simple label with the exact same ...
0
votes
1answer
51 views

Creating multiple folders named by a list in python [closed]

I am trying to make a python code to create folders named by a list of int and strings, the code below is returning an error, it works when the list is made of strings only, can anybody help ? ...
2
votes
3answers
115 views

How do I insert the string field and calculate it in Python?

Hello I am trying to insert a code that force a column Sum_Acres_ to add a comma to display like this 300,000 from 300000.456 Here is my sample I wrote from a ModelBuilder and export it to python. ...
1
vote
1answer
65 views

sum count column in raster attribute

I am a beginner to python coding in GIS. I want to calculate the total number of counts in raster attribute table. In order to do that: I would like to build a attribute table of raster data use a ...
1
vote
1answer
109 views

ArcObjects SQL Server Connection not recognizing instance

I am trying to make a connection to a SQL Server database with SdeWorkspaceFactory. This is from my Windows 7 x64 Desktop to a Network database. If I use this: SDEWorkspace = ...
1
vote
1answer
108 views

Writing multiple file geodatabase tables into csv file with arcpy

I was asking a question about Merging geodatabase previously, (link: Merge from arcpy.ListTables() producing duplicate rows?) and although the script worked, it took more than 9 hours to run when ...
1
vote
1answer
29 views

Writing list of feature classes with fields to one csv file per feature class?

I have a database with multiple feature classes. Now I extracted a list of feature classes and a list of fields. I figured out how to write the list of feature classes and the corresponding fields to ...
1
vote
1answer
61 views

Python Hyperlinking Script in Arcmap 10.2 [closed]

I have the below python script which recursively walks through a directory and finds, then opens the associated parcel pdf file. How would I modify this to not be recursive but to just look in the ...
3
votes
1answer
94 views

How to get layers from a specific store of geoserver using python gsconfig?

I'm using gsconfig python library to acess geoserver rest, my question is how can i get layers from a specific store ? I'm tried as follow: from geoserver.catalog import Catalog ...