Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

2
votes
1answer
61 views

arcpy.AsShape function returning RecordSet not Geometry

I have the following code: feature_geometry = arcpy.AsShape(json_string, esri_json=True) print feature_geometry print type(feature_geometry) >>><geoprocessing record set object object at ...
4
votes
3answers
88 views

Install gdal in CentOS without Root

I have been struggling to get python setup to do some image processing, so I really need the http://www.gdal.org/ GDAL libraries installed on CentOS 6.5. I want to install the package in a local ...
2
votes
1answer
71 views

Naming directories in python?

Why is it that when I label my directories this way: arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:\\Users\\Documents\\ArcGIS\\Testing" arcpy.env.scratchWorkspace = ...
1
vote
1answer
82 views

Pyproj: converting WGS84 to Robinson

I have a WGS84 coordinate pair (37.7749295, -122.4194155). I have an image that is a Robinson Map Projection of the world. I'm trying to write a python script to locate my WGS84 coordinate on my ...
1
vote
1answer
53 views

Convert WKT (or geojson) geometry to numpy array of coordinates

I am looking for the fastest way to convert WKT or geojson geometry from string to numpy array of coordinates. Is it possible to do it strictly in Python and without creating geometry object such ...
2
votes
1answer
53 views

Filtering MSSQL layers in QGIS doesnt work

In my QGIS Plugin I am filtering layers with this Python code: FeatureIterator = layer.getFeatures( QgsFeatureRequest().setFilterExpression ("Fieldname='SomeValue'") ) for feature in FeatureIterator ...
5
votes
1answer
99 views

QGIS Processing Progress

I have been developing a python plugin that uses Processing algorithm for raster calculations. I want to support the gui with progress bar. How can i connect Processing job to progress bar? I found ...
2
votes
1answer
28 views

Get min-max values of a raster and populate two parameters with the values in tool validation script

I am customizing the script tool behaviour of a custom script and would like to get the min-max values from a raster self.params[0] and populate the next two parameters, self.params[1] and ...
2
votes
1answer
34 views

Convert polyline to presence absence raster in arcpy

I have a polyline that I am converting to a raster in arcpy. This is occuring within a loop and at each iteration I change the processing environment to a different area of interest. In this case it ...
2
votes
2answers
43 views

Merge classes using Reclassify in python

When I run the Reclassify tool from arcmap 10.1 and assign a 1 to each of the crop types it combines them into one class. However, when I try to recreate this in python it does not merge the crop ...
1
vote
1answer
44 views

Unable to use kartograph.py

This is probably a very simple fix. I was able to download and install the Kartograph.py library. When I call it from the command line I am getting: kartograph is not an external command Usually ...
3
votes
2answers
55 views

Using ModelBuilder, how to define directory while using a Python script?

I have a model (shown below) in which at the very end of it I run a Python script ('SumFieldInsertNew'). One issue I'm having is that I'm creating this model for an end-user that will have little to ...
1
vote
1answer
54 views

Programmatically export a Qgis project

I have a QGis project that I programmatically modify using the Python xml.etree library. Now, I would like to know if it is possible to add few lines to my script in order to export the modified ...
1
vote
1answer
36 views

trouble with code block execution in python script

I am trying to calculate values for a field in a python script, but keep getting an error that I don't understand: ExecuteError: ERROR 000539: Error running expression: Fron000000F1 Traceback (most ...
1
vote
1answer
163 views

Installing pandas with Esri's python?

Trying to get pandas to import, but I'm getting what looks like an error caused by a failed dependency of the version of my Esri-provided numpy's compile, based on this stackoverflow posting. Here's ...
4
votes
1answer
122 views

Can ArcGIS ModelBuilder be exported to Python and run in QGIS?

Is it possible to construct a geoalgorithm on the ArcMap modelbuilder, export this entire algorithm to python syntax (without having ANY knowledge of python) and then import this algorithm to QGIS and ...
3
votes
1answer
159 views

How to use outdated arcscripts

I need to use the Vector ruggedness measure (VRM) tool available from http://arcscripts.esri.com/details.asp?dbid=15423. However, I am using the latest version of Arcgis and these tools are made for ...
3
votes
1answer
59 views

No get more option in QGIS

I have recently installed QGIS and trying to work with it but I don't see this option "Get More" at all. As suggested by some previous source, I also checked whether I am behind a proxy but that isn't ...
0
votes
1answer
32 views

Expression to display Image in MapTips?

In ArcMap, is it possible to display an image by using a path in the attribute table to show an image in MapTips? Any Python or vbScript expression are welcome as long as it is MapTips which shows ...
1
vote
1answer
24 views

Adding some background information to a layer

I have 2 Python Qgis plugins. The first plugin is creating a QgsVectorLayer via the ogr dataprovider. The second plugin is offering some services on the features in the layer. I need to pass some ...
1
vote
0answers
32 views

pyQGIS 2.0: Sending signal when identify button is pressed via gui

I have a question regarding the qgis identify tool for version 2.0. I would like to know if it's possible to send a signal when the actionIdentify is triggered by the user via the gui. I'm trying to ...
4
votes
1answer
99 views

Find max and min values from a table based on two fields

I have a geodatabase table with the following fields: County_Name, State_Name, Date_Time, Customers Example Alameda, CA, 8/1/2014 12AM, 6 Alameda, CA, 8/1/2014 1AM, 1 Alameda, CA, 8/1/2014 2AM, ...
6
votes
1answer
90 views

How to get layer list of layers that are published?

I'm stuck. I've been using geoserver with python extension gsconfig library for a while now. Almost everything works as it should be. While there are little things like publish raster images are ...
2
votes
1answer
57 views

Problem with Python codeblock recognizing a field

'<'First Post Alert> I've been through multiple iterations / gyrations, and while there may be multiple problems here (and I'll appreciate feedback on all of them), the recurring issue is that the ...
1
vote
2answers
40 views

Is there any efficient way to create a raster with pixel value representing a unique id calculated based on pixel lat/lon?

I have 10m raster for each state in US. Current pixel value represents something. I want to have 'same' raster but pixel size representing a unique id calculated based on pixel lat and lon. I am ...
3
votes
0answers
67 views

QGIS API - Print Composer Template produces empty map?

I have a print composer template which I'm trying to populate with different subset queries from a CSV-derived vector layer using the Python API. However, all the output PDFs contain everything except ...
4
votes
0answers
63 views

Preparing Huff model with data to use in QGIS? [closed]

I'm trying to find out about the notion of potential of acessibility using the methods of Huff. I´m using QGIS, with point data (with the variables that I would like to use) and polygons for Europe ...
2
votes
1answer
53 views

Conditional Statements in QGIS raster calculator?

What is the equivalent statement of the following expression in the QGIS raster calculator? Con(((Abs("DEM" - "FSMin") > 120) | (Abs("DEM" - "FSMax") > 120)), 1, 0) I have no problem ...
2
votes
1answer
47 views

How can i add script with math functions to model builder?

I am very new to model builder + python. (Sorry for my english too) I am trying to make a model. Don't know if it matters to upload it. If you want i can. I want to calculate variance from a ...
2
votes
0answers
30 views

Memory layer or QgsVectorFileWriter Error?

Currently this excerpt of code will not save to file (as it is supposed to). The memory layer is visable and editable. Yet even when manually saving the layer, any priorly added features ...
1
vote
0answers
12 views

Proper updating of new memory layer geometry?

Current workflow for a toolbar button: -create memory layer -save memory layer to shapefile Then the user uses the built-in QGIS tools to add geometry and finally saves changes via the auto prompt ...
6
votes
2answers
258 views

Versions of Python & QGIS for new user to both to install?

I have used GIS (very basic functions), but now want to be able to customize to my needs. My initial research leads me to believe that Python + QGIS is the way to go. I understand that there are ...
3
votes
2answers
96 views

Calculate Field Syntax: If statement over many fields

Apologies if this has already being asked but I couldn't find a page pointing to this problem. I'm struggling with the python syntax in the Calculate Field so that, in the table above: if b, c, d, ...
2
votes
1answer
320 views

64 bit Python on ArcGIS 10.2.2 for Desktop

I am trying to have Python 64-bit with ArcGIS so that I can use my entire RAM when doing data analysis. Apparently ArcGIS 10.2 Desktop comes just with 'Python 32-bit'. Should I install a fresh Python ...
2
votes
2answers
55 views

Avoid adding new generated intermediate layers into ArcMap during Python script running?

I am running my script to do geoprocessing in the python window of ArcMap. Since the geoprocessing includes lots of intermediate files, and these files were added in ArcMap at the same time of the ...
1
vote
0answers
25 views

QGIS2.4.0: Cannot import qgis module in python “from qgis._core import * \n DLL Load Error”

Having some trouble importing qgis into python. I'm very new to python so it could be a simple mistake. The path seems to be correct. It gets this far: File "<stdin>", line 1, in ...
1
vote
2answers
106 views

UpdateCursor only takes last value of SearchCursor

I have this piece of code: #written on python 2.7 for ArcGIS Desktop 10.2.2 import arcpy #set to folder where features are located arcpy.env.workspace = "c:\\Users\\python_ex" #on windows use \\ ...
3
votes
1answer
48 views

Build Network Dataset with python comtypes

I know this isn't possible in arcpy, so I thought I'd give it a stab using comtypes. I am trying to translate some of the VB.NET code to create a network dataset from the help docs: ...
2
votes
2answers
69 views

UpdateCursor on two tables with value from SearchCursor

I try to keep myself busy and learn some python. I have two tables test2.shp (for searchcursor) test.shp (needs to be updated) I want to update test.shp with a UpdateCursor. The column which ...
3
votes
2answers
90 views

Using arcgis.rand() with variables from code block of Calculate Value tool?

Within a larger ArcGIS ModelBuilder model I am trying to populate a field in an attribute table with a random number, using Calculate Value. The overall distribution of random numbers needs to follow ...
2
votes
0answers
39 views

(How) can I write string data to a raster with Python/GDAL?

In Python, I have a NumPy array of string values (categories of some variable) that I'd like to write to a raster file (.tif or .img) using GDAL. The impression I get is that it's not possible to ...
1
vote
0answers
30 views

Vector layers without geometry in QGIS?

Using QGIS, I have set up a couple of automated layer additions via the toolbar. After adding geometry in each respective layer (point, lineString, polygon) and saving changes to the layers, the added ...
1
vote
1answer
53 views

User defined parameter within code block of field calculator - Modelbuilder - ArcGIS - Python

I am using Reclass within a Code Block in Field Calculator in a Model to calculate field values for a variable based on several other fields. Using reclass is much quicker than select and then using ...
2
votes
0answers
30 views

Align & Sum Grids in Python

I have two grids. One, call it A, is 4320x2160 cells and spans the whole globe. The other, call it B is 8640x3432 and spans the circumference of the globe, but is clipped toward mid-latitudes. Both ...
1
vote
1answer
60 views

Summary statistics on attribute table

I've got a polygon feature class with attributes fields y2010, y2011, y2012, y2013, y2014, country The 'year' fields contain counts of an event occurrence, which can be 0 or > 0. The 'country' field' ...
2
votes
2answers
121 views

Fastest way to transform WKT in python

Is it possible to use pyproj to transform WKT without creating geometry objects such shapely geometry, GEOS geometry or OGR geometry. If not what is the fastest way to do it?
1
vote
1answer
57 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
0answers
44 views

arcpy.Clip_analysis() Automatically Affixing .shp.shp to Target Feature Class Name?

I created a Python script that was previously working fine, but is now giving me an error when I try to use the arcpy.Clip_analysis() function in arcmaps 10.2.1. I am not adding a filetype extnsion ...
1
vote
1answer
35 views

PyQgis Message Bar Woes [closed]

Having a bit of trouble with the basics of getting the (awesomely discreet) new user prompt/warning to properly display. Here is the (troubled) code I am using: self.iface ... ...
7
votes
1answer
139 views

How to get status of a layer in geoserver using gsconfig?

I am getting all published layers from geoserver using gsconfig using following code: from geoserver.catalog import Catalog cat=Catalog("http:// localhost:8080/geoserver/rest") myResource = ...