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

learn more… | top users | synonyms

3
votes
1answer
67 views

Dynamic title in ArcMap

How can I have a dynamic title of the map, which changes depending on the layer chosen? Is this doable? It would save a lot of time and iterations since I should be producing several maps. To ...
0
votes
3answers
78 views

How to Build a graph from a map

I spent days looking in all questions here and trying tutorials. I need to build a graph for a region (It will be my input in simulation) I downloaded Postgresql and Postgis and osm2pgsql. Now i can ...
2
votes
1answer
41 views

How to transform JSON with field x,y to gdb in fme

I have JSON file with x,y field. I wonder how to transform geoemtry to gdb? Example of json: [ { "OBJECTID": "1", "x": "15", "y": "21" }, { "OBJECTID": "2", "x": "16", ...
0
votes
0answers
57 views

I cannot use Gdal Python but Gdal binary, how to fix?

**UPDATE: I can use GDAL with Python now by copy file from Gdal 1.11 compiled folder to Python package folder. But the problem with GDAL binary and GDAL library that they cannot read the HDF5 file. ...
2
votes
1answer
24 views

Arcgis, Convert analyse result in numeric value

I have a problem that seems really simple but blocking me... in Arcgis i have script python where i want to extract the resolution of a raster and use this result like numeric value for use in a ...
4
votes
1answer
148 views

Why is matplotlib installed with ArcGIS?

Today I upgraded to ArcGIS Desktop 10.2.2 as well as the 64-bit background processing tool and noticed that both numpy and matplotlib were installed with Python. In fact, in the "What's New?" section ...
0
votes
1answer
21 views

ArcMap 10.2 Sum Acreage for matching areas in another field; ultimately use ModelBuilder?

First off, what I'm attempting to accomplish is to sum the acreage of matching "WUNAME" and populate the "WU_Acre" I've tried to highlight the fields as shown and use the field calculator SUM(Acreage) ...
1
vote
1answer
38 views

Python Toolbox (.pyt) Tool Output Layer Name

How can I manipulate the TOC display name of my output parameters when using a Python toolbox (.pyt) Tool class. I tried adding a symbology layer, however this has no affect on the TOC name. Is it ...
0
votes
1answer
34 views

Error using 'Join attributes by location' via Python

Trying to run a simple script using qgis:joinbylocation but getting either errors or it's not processing correctly. I don't want to take a summary of the attributes, just the attributes of the first ...
0
votes
0answers
28 views

QGIS Init script: How to get active layer and GID of edited object?

I would like to ask, how to get the GID (from Postgresql+Postgis) and active layer of edited object in QGIS Init script (Python)? Code Layer=qgis.utils.iface.activeLayer() works in QGIS console, but ...
0
votes
2answers
88 views

MultiLineString to separate individual lines using Python with GDAL/OGR, Fiona, Shapely

There are lots of MultiLineString features in a polyline shapefile. The problem is to split these lines into separate individual lines. There is a similar question with PostGIS, but I need to code in ...
2
votes
1answer
62 views

forLoop & joinField & different names

I have a folder with an output (shapefiles) from an iteration. On this output, I want to perform a join between two attributetables. So far so good. Here comes the tricky part. There are different ...
2
votes
0answers
29 views

Why does python reads only the no data value from GeoTiff file?

I had a number of tiff files with a country's map. They had different rows, columns or different projections etc. I needed to make them with same projection, spatial resolution and same number of rows ...
0
votes
0answers
19 views

Error when providing “Python init function” from Python script in QGis

Problem I am using QGis and Python scripting to programmatically set a layer's edit form and "Python init function". It appears that the Python init function is called correctly in one situation ...
0
votes
0answers
18 views

GRASS r.out.mat memory issues

we have built a model with pythn/GRASS that calls the r.out.mat module. The area is quite large 25,000x25,000 cells. The machine we are running it on is Windows 7 machine with 16GB of RAM. After a ...
0
votes
0answers
27 views

pyQGIS (Spatial Join): Sum features of attribute from point layer and join with vector layer

I am new to Python and QGIS. I have avoided asking questions up to now. But by now I have developed a reasonable idea of where i want to go so and where I am stuck. So, I have decided to ask but sorry ...
1
vote
1answer
36 views

How can I do a definition query on a layer and zoom to it?

I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ?? dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the ...
0
votes
1answer
41 views

Definition Query then Zoom to Layer Automation?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
0
votes
1answer
25 views

How To Turn Off Map Drawing When Using Python in ArcMap?

I have a Python script that creates layers in ArcMap. The script works fine, but when a new layer is created a map is always automatically drawn, which makes the script take longer to process. I ...
1
vote
0answers
24 views

Automating polygon mergers with python

This is the first real world python program am trying to write. I am trying to create a scrip that takes a shapefile that has n polygons with an integer formatted date (e.g. yyyymmdd or 6/24/2014 is ...
0
votes
2answers
36 views

If-Then-Else statement in ModelBuilder has improper syntax

I have a model that converts a road network into a different schema for a different program. In one step of the model I am converting values for a field "Class". I wrote an If-Then-Else statement in ...
-2
votes
0answers
30 views

Error 0100060 while running Extract by Points? [closed]

The resources have not been much help here. I can run this same process hardcoded in the IDE, however through the tool dialogue it gives the following error? Any thoughts? ExecuteError: ERROR ...
1
vote
1answer
32 views

gdal_proximity distance to meters

I followed the answer given in this topic for searching the distance to the nearest coastline given a lat/lon coordinate. The distance output obtained is in degree (I think) but I need the distance ...
1
vote
1answer
41 views

How to get a Layer as ILayer (ArcObjects)

I had asked this question previously which I think will work. But as I am new to this, I can't figure out how to get a Layer as an ILayer object to pass to the method that's in my previous questions ...
1
vote
1answer
41 views

how to separate a list of features from its shapefile_

I tried to copy all features in a list of dictionaries. the code looks as follows: def iterate_features(self): feature_set = arcpy.SearchCursor(self.address) for feature in feature_set: ...
1
vote
0answers
25 views

Python error message after download (QGIS 1.8.0/ Windows 7)

Hello to all members of the forum, I downloaded from the OSM website a small area in the neighborhood of Strasbourg, France: X (longitude): 7.6808 7.8216 Y (latitude): 48.5075 48.52 I got the two ...
0
votes
0answers
12 views

maptool doesn't receive key pressed events after QMenu.popup() function

I am developing a qgis python plugin which uses a maptool receiving key pressed events by keyPressEvent(self, event) function, mouse movements events by canvasMoveEvent(self, event) function and mouse ...
2
votes
1answer
70 views

How to find missing dependencies in a distributed ArcGIS Python toolbox?

I am developing a Python Toolbox that uses a few external libraries (ogr/gdal, matplotlib, shapely, reportlab among others) which files I have directly copied in the same folder as my toolbox .py, as ...
1
vote
1answer
29 views

Can't get SRS from PostGIS using Proj4 text

I'm having a problem transforming a point from the Australian MGA UTM datum (eg MGA Zone 51 http://spatialreference.org/ref/epsg/28351/) to WGS84 using GeoDjango. I've narrowed that down to a problem ...
0
votes
0answers
22 views

QgsMapRenderer to export current extent using PyQGIS

I am trying to accomplish PyQGIS simple map rendering via the QGIS 2.0 Python console, but end up with only a blank image. I've followed instructions of this link. My objective is to export a simple ...
0
votes
0answers
43 views

gdal_translate from within pyqgis [duplicate]

I want to use gdal_translate from within a python script in my plugin qgis2leaf. I've tried with ...
0
votes
0answers
28 views

Suggested Workflow for Generating NITF (w/headers) using Nitro in Python

It seems that there is no real suggested workflow for generating an NITF file from a georeferenced, validated tiff image. Here are my inputs: Pyramid Tiff Image - georeferenced MBR (minimum ...
1
vote
1answer
27 views

Resampling with Python console (QGIS): number of parameters

I am trying to resample two raster layers with Python console in QGIS with this code: outputs_0=Processing.runAlgorithm("saga:resampling", ...
0
votes
0answers
30 views

How to get Coordinates values from the latitude and lontitude [duplicate]

I having the form, i have two fields, Latitude and longtitute, if i put the value from here, i need automatically mapping on the map. I want to get the value from Lat and Long, it must be generate ...
1
vote
1answer
50 views

How to use the MMQGIS plugin through the Python console?

I know how to make Hub Lines using the GUI, I want to know how to do the same using the Python Console, a tutorial would be great. Thank you
0
votes
1answer
95 views

Using Union on multiple shapefiles to output single result

Using QGIS 2.2 and Python, I would like to use the Union algorithm on multiple shapefiles (contained in a folder TEST) which would then produce single shapefile containing all the data. Currently ...
1
vote
2answers
37 views

How to switch to edit mode vector layers, in pyqt application based on qgis?

I do QGIS based application, I need to implement the ability to modify the geometry of vector layers in manual mode (editing nodes), how to do it?
0
votes
0answers
22 views

QGIS - Calling interpolation extension from python console

I would like to call the QGIS interpolation extension function (TIN method) (Raster->Interpolate) from python console. I can't find the corresponding function within QGIS API or within the ...
0
votes
3answers
68 views

UpdateCursor 'is not defined' Python

I have several files (shapefiles). Table 1 has only one row with several fields whereas Table 2 has several rows. What I want is to take a value from Table 1 and populate all rows in Table 2. I used a ...
0
votes
0answers
55 views

What is GDAL equivalent to ArcGIS Lookup (Spatial Analyst) tool?

I use the Lookup (Spatial Analyst) tool to create several raster layers from a combined raster layer. I know ArcPy can do the same thing. However, I would like to know whether GDAL (or another ...
2
votes
1answer
56 views

What are resources to learn ArcGIS for someone who already knew Python [closed]

I know that there are several resources recommendation questions, however, they are all from GIS people trying to learn Python (for example, here). My situation is the opposite: I have worked ...
1
vote
1answer
56 views

How to use Fields in the Field Calculator? [duplicate]

I'm using the Field Calculator in ArcMap and I need to create a unique ID for every storm drain in my county. An ID Should look something like this: 16-I-003 The first number is the municipal number ...
1
vote
1answer
38 views

How to export a set of layers into multiple PDF(orAI)files, one layer at a time?

I am completely NEW to PYTHON(only took a 3-hr entry course in ESRI tutorial. I have a dataset contains files named as "1_A, 1_B, 1_C....12_A,12_B, 12_c,....200_A, 200_B, 200_C..etc." I need to export ...
0
votes
1answer
35 views

Adding field to table without path to table (python) [closed]

I want to add a field to my table in the FieldCalculator. import arcpy arcpy.AddField_management("veg8", "test", "TEXT") An error message occured doing this and I figured out that I need to set a ...
4
votes
1answer
70 views

XYZ Clustering in Python and numpy arrays

I am looking for a method of clustering XYZ data in Python that works on numpy arrays. I know of a few sources, such as clusterpy and Pysal but have had little success with them as they seem to still ...
0
votes
1answer
24 views

PyQt QTableWidget for QGIS python plugin: infinite loop issue

I'm using PyQt4 and Python 2.7 to develop a plugin for QGIS 2. I have QTableWidgets used to display/compare existing information in the database with newly entered information pertaining to the same ...
1
vote
1answer
63 views

Arcpy: List to point feature class

I have a list of lists that contains: [vala, valb, valc, vald, (pntx, pnty)] [vala, valb, valc, vald, (pntx, pnty)] [vala, valb, valc, vald, (pntx, pnty)] I also have a list of the field names that ...
1
vote
2answers
50 views

Getting error after trying to harvest from geoserver into pycsw

I'm using osgeo live to test the pycsw functionality. I need to harvest metadata from an existing Geoserver service (previously configure for this task). I'm quite new with CSW and I'm not sure if my ...
1
vote
2answers
82 views

Conditional Calculate Field Many to One

Anyone have experience calculating a field based on a many to one scenario? I have a feature class in a geodatabase with a field of unique names. Feature Class Table (let's call this ...
1
vote
2answers
44 views

Set parameter of field from number to string with python

since I realised python is a very useful tool in ArcMap I dont want to do any workarounds anymore. I have a field with is numeric, but I want to perform this calculation in the field calculator on it ...