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

learn more… | top users | synonyms

1
vote
0answers
47 views

Generating Custom Map image using Python with small installation footprint? [duplicate]

As a part of reporting requirements there is a need to generate region maps. These highlight various regions (countries or states/provinces) with different colors (or shades of a color) depending on ...
0
votes
2answers
46 views

How to show attribute table in the form

Is there any way to show the attribute table of a layer in a QtextBrowser or a QtableView on form? I did this but,(shows attribute table in a separate dialog) I have no idea, how to show it in my ...
0
votes
1answer
60 views

Creating records in output shapefile using Python

I have a list (output from a previous loop) containing attributes from an input shapefile. What I am stuck with is inputting those attributes to a new shapefile. I have plotted the point data using ...
2
votes
1answer
58 views

How to find the id of the last added feature using pyQGIS?

Is it possible to programmatically (in python) access the attribute info of the last added feature in QGIS 2.0 before edits are saved? I'm failing to find a way to get the ID and subsequently other ...
0
votes
1answer
67 views

using Z and M feature geometry to create line graph in Python?

I am a Python (v2.6.5) noob trying to plot a series of 3D polylines into graphs. So far I've come up with: # Import system modules import arcpy, os, sys, string from arcpy import env ...
0
votes
0answers
17 views

Correctly drawing wrapping circles using Basemap

I've been using the functions from here to draw circles on maps using Matplotlib Basemap. This works well, but breaks badly at the map edges: I'm wondering whether there's a general approach for ...
0
votes
0answers
32 views

Copy queried attributes of a shapefile to a new shapefile [duplicate]

I have a polyline-shapefile, which I have successfully read into python using pyshp module. My problem is to save the 2nd node of every line feature into a separate, single point file. I have ...
0
votes
0answers
11 views

QGIS custom action and button toggle

I've added a custom toolbar with some buttons to my QGIS 2 plugin. I'm wondering how to get the button toggled (pushed in-looking effect) using Python. I've gotten this to work for existing buttons ...
0
votes
1answer
45 views

Updating records based on value in another field using arcpy.da.UpdateCursor?

I am trying to write file names and paths to two separate fields in a feature class, and the value for each record is dependent on finding a match in a list. When I run my code it writes the same ...
3
votes
2answers
67 views

Efficient way to use a CSV to Define a Feature Class

I was provided an Excel Spreadsheet which had the definitions of fields for a feature class. There were several worksheets in the file, each containing field definitions for different feature ...
1
vote
1answer
58 views

Fix Black Border in Python Batch Raster Conversion

I have a Raster image like this as you can see the road are not connected between 2 raster (up and down) its because the scanned raster use different projection (dgn utm 50s) than my data frame (utm ...
1
vote
0answers
59 views

Writing values to feature class in Python script results in strange characters"? [closed]

The script below does a series of things, and towards the end it is supposed to write values pulled from a list to a new field, if the feature class name is found anywhere in a list element. It does ...
0
votes
1answer
35 views

PtDistWithin() with Geometry from query

I'm trying to run two Spatialite queries in Python — the first one picks a single point from a table, and the second tries to find all points that are within a given distance of it. So my queries look ...
0
votes
1answer
38 views

How to turn WKBtype integer into text for memory layer creation in QGIS

I'm creating a memory layer in QGis python and I need to match the geometry of the memory layer that I am building to the geometry of another layer. After some investigation it seems to me that, as ...
1
vote
2answers
94 views

Create Feature Class From XY Table Using Python

I have some txt files that are basically attribute tables (object ID, latitude, longitude, area). In ArcMaps, I have been converting these files into feature classes and saving them in a geodatabase ...
0
votes
1answer
68 views

How to use python to set a variable to a value from a vector attribute table for GRASS

I'm adding to a python script for GRASS v.transects.py. I want to set a variable to equal a value from a field in the vector's attribute table using a for loop to cycle through each row. This is one ...
1
vote
1answer
76 views

Plugin of Multiple buffers in QGIS

I hope to create a plugin to do multiple buffers in QGIS. This is my script: """/*************************************************************************** izisse_test ...
0
votes
2answers
97 views

GDAL_CALC works but I get a python error at the end of each process that prevents automation

Python 3.4.1, GDAL 1.11.0, OSGEO4W, Windows 7, OSGEO4W Windows Shell All 64-bit (ArcGIS is installed as well 10.2 with Python 2.7) So gdal_translate works fine. gdal_calc provides perfect ...
2
votes
1answer
98 views

Merge from arcpy.ListTables() producing duplicate rows?

I was trying to manually merge file geodatabase tables and was getting Null values for the output file rows and decided to write a python script to merge the files. Here's my script: import arcpy ...
1
vote
0answers
21 views

ExtractByMask with one mask and multiple layers ArcMap

I have a multiple cost distance rasters and multiple feature layers. I need to find and join the feature layers (or associated shapefiles) that lie within a threshold of costs on the cost rasters. For ...
0
votes
0answers
27 views

How can I define coordinate system of feature class when overlaying with coordinate zone shapes in python?

I have generated bounding boxes for CAD drawings that do not have defined coordinate system files. I know that each drawing could be in one of 6 different systems that do not overlap. My idea was to ...
0
votes
1answer
69 views

“EOFError: EOF when reading a line” Using raw_input() in ArcMaps Python Console [duplicate]

I am writing a python script to automate some ArcMaps data processing. I am getting hung up at raw_input(). I am using raw_input to get input from a user. A folder will be created with the folder ...
0
votes
0answers
22 views

How do I install PyProj module for Python 2.7 on Windows 7?

I am having trouble installing the pyproj module for Python 2.7 on Windows 7. I have tried both the 32 and 64 bit installers from this list but the install crashes each time I run it. I have the ...
1
vote
0answers
61 views

Using qgis modules in standalone application with PySide?

I want to make small standalone application using PySide and QGIS python modules to display satellite images and do standard GIS operations, like creating new shape file and placing polygons or points ...
0
votes
0answers
47 views

How to write a signal for 'QgsMapCanvas::xyCoordinates (const QgsPoint & p)'

I am very new to QGIS and python. I am writing some python codes and I want to capture the x,y coordinates when the cursor moves on the map layer. (same as the coordinates show in the QGIS status bar) ...
0
votes
0answers
18 views

Plugin Ui interation with user and Qgis

A downsized hydrogeology plugin ( GraphicGroundwater = GGW ), instilled the need of a reduced combination of Carson's 'fTools doVectorGrid' and Pryet's 'Qgridder' plugin(s). The GGW Ui is displayed ...
1
vote
0answers
28 views

Disable customized context menu for some cases using python

I create a python add-in tool to add new item to the context menu, but I want the new item enabled only when user right click on map when within a buffer of polyline feature. I haven't figure out how ...
1
vote
2answers
59 views

Edit Field Value of Feature Class Using Python in ArcGIS 10.2

I have a feature class whose attribute table looks like this: Latitude | Longitude | Area For the area column, all rows are null. I would like to put in a specific value for all rows using Python. ...
0
votes
1answer
43 views

Using os.walk to update broken links and save mxd

I've got code to walk through an entire directory and sub-directories repair broken links in each mxd and save the mxd. It works for the mxd's in the top directory but fails when trying to enter any ...
2
votes
0answers
39 views

Create a simple WPS client

It looks like the only way to get flat files/data from a WPS service is to use a client. I'm looking to create a super-simple WPS client in Python 2.6 (or other language) without any dependencies on ...
2
votes
0answers
39 views

how to make a list of features constructing the dissolved feature?

I need to simplify my road network using the dissolve function to remove nodes not occurring on the intersections. the following code is doing that. arcpy.Dissolve_management(self.address_cor_layer2, ...
3
votes
1answer
69 views

How to develop a Toolbox intended to be distributed in multiple version of ArcGIS?

I am currently developing a Toolbox for users who will use it in different versions of ArcGIS (10+ versions). Is there a recommended way to proceed in that situation? My main concerns about that are: ...
1
vote
1answer
43 views

Python geoJSON module create a FeatureCollection with CRS, QGIS doesn't recognize CRS

I am curious if my geoJSON created with the geoJSON python module has a valid CRS. The manual on github specifies a feature collection like so: from geojson import Feature, Point, FeatureCollection ...
0
votes
1answer
49 views

How to access the map coordinates show in QGIS status bar?

Is there a way to access the map coordinates show in qgis status bar? I found only this, iface.mainWindow().statusBar().currentMessage() But I know it's not the way. Or is there any way to capture ...
0
votes
0answers
18 views

ArcObjects open report wizard

ArcMap provides a function to create report and after the creation can save as different formats. Now I want to allow user to skip the intermediate steps. I want do the report function using ...
0
votes
0answers
21 views

SST process using just GDAL and python

I am trying to process AVHRR 4km SST using a module that uses only GDAL and Python. OSGEO4W, GDAL, Python 3.4.1. I borrowed the download code from http://grasswiki.osgeo.org/wiki/AVHRR. The rest I ...
1
vote
0answers
26 views

How to export the legend (Layers Panel) as an image in QGIS using the Python console?

I want to export the Legend (the Layers Panel) as an image using the python console.
0
votes
1answer
46 views

Cause of ArcGIS Raster Calculator Parsing error <type 'exceptions.SyntaxError'>: invalid syntax?

This is my first attempt at much code in the raster calculator of ArcMap 10.0, but I think I'm close. I have nine rasters (A-I below) and want a new raster with value = 1 where any of the rasters ...
1
vote
2answers
43 views

Running a Focal Mean or Low Pass Filter or 3 by 3 Mean Kernel in GDAL \ gdal_calc

Hi I am looking to run the equivalent of Focal Statistics in gdal_calc. Is it possible? It is a simple focal I require. I need to run a 3 by 3 kernel over the data (mean) and if possible only on ...
1
vote
2answers
34 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
3
votes
2answers
112 views

How to select all files in a directory for merging in Processing?

I'm writing a generic script which involves writing shapefiles to a directory which are then merged together. After writing the files out to the Output folder, I'm trying to get the ...
0
votes
2answers
65 views

creating many shapefiles from one multi-polygonal shapefile

Does anyone know of a way to create a standalone shapefile from every entry (row) in the attribute table of a large set of polygons (4909 in total)? preferably using python in a way that the results ...
0
votes
0answers
22 views

Use python to execute GRASS module v.distance

I have successfully use python script to import a line shapefile and a point shapefile into GRASS, and the following are their attribute table in QGIS, line shapefile point shapefile Now I want ...
1
vote
0answers
209 views

How can I get all the latitude, longitude coordinates/points inside a rectangular polygon drawn in google maps?

Google maps lets you obtain a valid address by clicking on houses or buildings one by one, but it would be much easier if you could draw a polygon on the map and get a list of all valid addresses ...
0
votes
3answers
108 views

Calculating distance between points using ArcGIS Desktop?

I want to write Python syntax to calculate the distance from point to other points in the water network and so on for others, I have 21 points. I need distances have to follow the network That ...
2
votes
2answers
112 views

Convert a Toolbox (.TBX) to a Python script (.PY)?

I have a .tbx tool box, which runs a script that is incredibly slow. So what I want to do is to open the python script that is running below the .tbx and make some changes or perhaps write something ...
1
vote
1answer
64 views

Problem loading spatialite extension with sqlite3 Python connector

I am trying to load the Spaltialite extension using SQLite3 python module. I am getting the following error when I run my script. EOFError: [Errno 10054] An existing connection was forcibly closed ...
1
vote
1answer
51 views

How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

My python application makes heavy use of the osgeo library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues. I'm installing packages from the Ubuntu GIS PPA. Before, ...
0
votes
0answers
38 views

pyspatialite, cannot update geometry

I'm trying to update geometry column with pyspatialite but it returns error: spatialite.dbapi2.IntegrityError: mypoints.the_geom violates Geometry constraint [geom-type or SRID not allowed] My ...
0
votes
1answer
45 views

gdal_calc.py raster reclass equivalent of ArcGIS reclass or r.reclass in grass

Would like to achieve this in gdal_calc.Py if possible. I have a raster with a value of 0-7 in GTiff I would like one output raster where NoData = 0,1,2,3 1 = 4,5,6,7 So basically an ArcGIS ...