A version of the Python programming language

learn more… | top users | synonyms (1)

1
vote
0answers
13 views

Python Basemap fails

I am using Anaconda 2.1.0 and Basemap installation is successful conda install basemap However, I keep getting the following error when I try to project lat,lon to a planar: Assertion failed: (0), ...
1
vote
0answers
17 views

Upgrade Geodatabase crashes python and ArcCatalog

We are currently in the process of upgrading our ArcGIS for Server license (10.0 to 10.2.2) and our SQL Server instance from 2008 (SQL Express) to 2012 (Full blown). We have around 60 databases to ...
2
votes
3answers
60 views

How to change properties of an item in a legend in ArcMap 10.2 using python

For many of my projects I use a single mxd to create multiple maps using a python script to switch on/off various raster layers before exporting to pdf. Before beginning the exporting process I ...
2
votes
1answer
42 views

How do I import an ASCII grid using arcpy?

I'm trying to automate the setup of some flood depth/hazard maps. The user specifies a folder containing depth grids generated by a hydraulic model (.asc format) and some background mapping (geotiff ...
1
vote
1answer
23 views

Cannot find pythonwin on my ArcGIS 10.1?

What is the version for the Python in ArcGIS 10.1 and what is the build ? My laptop does not show having pythonwin in the folder under C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin. Is there ...
2
votes
2answers
29 views

How to find number of synchronized records in ArcGIS10.2.2 (Data Management)

I want to find number of records synchronized while using arcpy.SynchronizeChanges_management tool. Right now, I'm getting only messages like process is Executing, Synchronize successfully ...
2
votes
0answers
26 views

how to extend polyline to the intersection point?

I have a polyline shape file, would like to extend the polyline to the intersection point of the nearby polyline and snap using python in Qgis. Thanks
1
vote
1answer
52 views

Python IDEs (PyScripter,PythonWin) crashing when installed with ArcGIS for Desktop?

I am learning Python, so here is a real newbie question! Everything writen in ArcGis Python's windows is working fine. The same lines, correctly writen in an IDE, when run, are crashing it. Working ...
2
votes
1answer
41 views

How to calculate area using QgsDistanceArea?

I am trying the following code as given in the QGIS documentation: d = QgsDistanceArea() d.setProjectionsEnabled(True) print "distance in meters: ", d.measureLine(QgsPoint(10,10),QgsPoint(11,11)) ...
3
votes
1answer
78 views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do this?
1
vote
1answer
22 views

Which parameter and Data Type to set for spatial reference in ArcGIS Python script tool?

I developed a python script for user defined grid and I want to make a tool from this script. The problem I am facing is to set up parameter for spatial reference. I used GetParameterAsText ...
1
vote
1answer
34 views

Slanted raster along the line? Wind erosion model and windbreak effectivity

I'm working on wind erosion modelling and windbreak potential. Imagine windbreak, which has some values of optical porosity (in %) and this values determinates the effectivity of windbreak in specific ...
1
vote
1answer
18 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
31 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
89 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
35 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
79 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
99 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
48 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
51 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
24 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
38 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
83 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
32 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
48 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
88 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
53 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
118 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
49 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
54 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
43 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
39 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
151 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
97 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
25 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
42 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
34 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
122 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
100 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
25 views

How to solve OD Cost Matrix (SOAP) in 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
37 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
129 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
86 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
100 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
56 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
60 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
47 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. ...
2
votes
2answers
103 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
231 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, ...