A version of the Python programming language

learn more… | top users | synonyms (1)

1
vote
1answer
17 views

Using ModelBuilder to replicate series of tasks without deleting output features first?

I am calling a number of files that I want to clip etc in ModelBuilder which clips data and sends it to a specific feature class. I want to re-run that same process for which I have converted the ...
2
votes
0answers
22 views

How do you find out where there are missing tiles on a basemap on ArcGIS Server?

I have a basemap service on ArcGIS Server 10.1 where after doing a cache update (exploded cache), some of the tiles are missing. I have added a "missing tiles.png" so that it shows where the missing ...
1
vote
1answer
65 views

How to add vertex to an existing polyline programatically?

I have a Polyline and would like to add new vertex to before start point or end point or at any part of the polyline using python in qgis. How can i do that?
0
votes
1answer
29 views

How to set attribute to selected field?

I am trying to create a temporary point layer in memory using the following python code. # create layer vl = QgsVectorLayer("Point", "temporary_points", "memory") pr = vl.dataProvider() # add fields ...
2
votes
0answers
55 views

Calculate area in square meters from degrees?

I have a polygon shape file in geographic coordinate system, i would like to calculate area in square meters in QGIS using python. Is there any formula or equation to do this? Thanks
0
votes
0answers
38 views

Create Polygon from coordinates? [duplicate]

I have coordinates in string format like POLYGON ((7.4986406 6.431006900000041,7.498971 6.43207,7.499096 6.432481,7.499398 6.43182,7.499522 6.431524,7.499529199999982 6.431510499999964,7.499529 ...
1
vote
3answers
68 views

latitude and longitude coordinates into postal code with town names

Here is my problem. I have a csv file, with latitude and longitude coordinates. I would need to know the name of the French towns and the relevant postal codes that match these coordinates. My ...
3
votes
1answer
36 views

Merging multiple 16-bit image bands to create a True Color Tiff

I'm trying to merge three Tiff band images in python, red, green and blue into a True color image. PIL does not support the file depth as they are 16-bit files with 11-bit values. I have seen it ...
0
votes
0answers
40 views

Python script suddenly freezes and start to consume memory

I have a Python 2.7 script that generates multiple polygons around certain polygon (see picture). The meaning is determinate the effectivity of windbreaks. I don't know if my solution for this problem ...
1
vote
0answers
18 views

how to open second window in my plugin for QGIS?

I create a Mainwindow for my plugin, but if I want to open a second window from this Mainwindow, with click on push button. How can I do? I tried the following function in my Main Class: dialog = ...
1
vote
0answers
36 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
1answer
74 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
29 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
35 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
68 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
46 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
74 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
36 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
42 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
42 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
38 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
120 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
81 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
19 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
37 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
24 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
117 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
75 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
18 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
29 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
107 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
68 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
84 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
47 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
48 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
43 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
79 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
167 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
53 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
108 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
2answers
149 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
73 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
94 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
44 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
13 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
113 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
42 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
43 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
29 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 ...