Python is an open source interpreted programming language used in many GIS programs.
0
votes
0answers
12 views
how to loop grass command in python and put variable in output file
anyone,
first day Grass programming with python scripting;
first prob;
simple I want to reclass the same raster several times;
and save the file with the value loop variable at the end ...
can not ...
1
vote
1answer
33 views
Python - GDAL: spatial filter
Is there a way with GDAL (Python) to set a spatial filter (bounding-box) on a raster before I process it? I want to read it as an array.
BandReadAsArray(band, xoff=0, yoff=0, win_xsize=None, ...
0
votes
1answer
219 views
How to create a report of all feature classes in a geodatabase?
I am not getting any response from this script and no error displayed at all
I am writing this script to help me display the feature classes in my geodatabase
Here is my script
import arcpy
...
0
votes
1answer
17 views
Apply Symbology to a group layer
I currently have around 200 features that all need have the same symbology applied to them. I have used the ApplySymbologyfromlayer_management however this takes much to long to process, at least a ...
-1
votes
0answers
44 views
How to assign a SQL query to a table attribute? [closed]
I have created a plugin with "plugin builder." Now I seek to connect my plugin to postgres. I have a shapefile and I try to find a script in Python that can assign a SQL query to my table attribute. ...
1
vote
1answer
27 views
How to iterate all input folders (containing coverages) using Python with ArcGIS 9.3?
I'm trying to write python scripts to batch convert thousands of coverages to shapefiles in arcgis 9.3. The coverages files are in different folders:
d:/area_A/building
d:/area_B/building
...
3
votes
1answer
45 views
How to set up Python 2.7 to work in both QGIS and ArcGIS?
I have both ArcGIS 10.1 and QGIS 1.8 installed and both include Python 2.7 in slightly different setups and in different folders (c:\Python27\ArcGIS10.1\ and c:\Program Files (x86)\Quantum GIS ...
0
votes
0answers
27 views
Fill up polygons with field value
I have now defined my renderer with a color map
I want to fill it with a value in the end field of my shape file's attribute table with python
how to do it??
I use QGIS 1.8.0 with python 2.7.3
10
votes
1answer
557 views
How do I get the pixel value of a GDAL raster under an OGR point without NumPy?
I am working on a computational model of the abundance of wild pollinators across a landscape. The model itself is complete, and I am now struggling with a post-processing step.
I have my GDAL ...
0
votes
0answers
37 views
How can I use NZLoad using python or arcpy script?
I have CSV file which has millions of feature class record merged with some metadata information which I want to load into Netezza database. I have tried it using insert query but it is very very ...
3
votes
1answer
33 views
How to check via Arcpy if ArcMap is currently in an edit session or not?
I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target ...
3
votes
0answers
111 views
Python Script Crashing Inconsistently on Arcpy Batch LayerToKML script
I put together a script to take a TIGER shapefile of all census tracts in a state, select the census tracts by each county, and export them into individual county-level kml files.
The problem is that ...
5
votes
1answer
48 views
How to create a point along a line given a distance from another point
I'm trying to figure out a point(D) on B-C that is a specific distance from A.
I really don't have any idea on how to proceed with the ellipsoidal math so I figured I'd ask here. How would I figure ...
0
votes
0answers
30 views
OD cost matrix Arcpy
I'm trying to create an OD cost matrix python script.
I'm doing an OD cost matrix analysis. I'll find out the average time with patients to hospitals over 10 years. When I do this analysis, the ...
0
votes
0answers
16 views
connexion to postgres and update attribute table of a shapfile in QGIS [duplicate]
I have created a plugin with "plugin builder" , now I search to connect my plugin to postgres. I have a shapfile and I try to find a script in Python that can use to assign a SQL query to my table ...
0
votes
0answers
19 views
Receiving Label Expression error
Writing simple label expression in python. It looks like this [Well_Name]+'\r'+ [TCA] . They are both string fields. I receive the following error "TypeError: coercing to Unicode: need string or ...
2
votes
1answer
70 views
Python Code: “Compare two fields and select missing records”
The code I wrote is not right!! It's selecting more than what is actually missing. I think I'm wrong on the matched code line. I need the script to make a list of the "FLAG" field and a list of the ...
0
votes
0answers
12 views
In QGIS Python can you nest QgsFeatureIterators on the same layer
I'm using the QGIS Weekly 1.9.0 in order to access the getFeatures(QgsFeatureRequest) method. The script is run in the Script Runner Plugin v0.71
Can anyone tell me what's wrong with this code? The ...
0
votes
1answer
30 views
Local variance image in python using gdal and a running window approach
I want a local variance image with a 3x3 of a geospatial raster image using python. My approach so far was to read in the raster band as an array, then using matrix notation to run a moving window and ...
0
votes
0answers
21 views
Min attribute NAME and replacing 0 with no data value
I've performed some massive OD cost matrices, and then using the pivot table function, I have the results in a table where each row is an origin and each column is a destination and all the values are ...
0
votes
0answers
46 views
Create Vertex and add empty attributes to it
How can I create a vertex(and then a point feature on the vertex) on a polyline and give it some empty attributes(create fields), move an existing vertex, delete vertex? I am in ArcGIS environment and ...
1
vote
1answer
70 views
Calculate Field using Esri Python Addin
I am trying to select a polygon then it must automatically change (calculate) the status to "C". The tool seems to work in the background but nothing actually happens (the status is not updated). I ...
1
vote
0answers
29 views
Running a QC check for gaps between vertices on a polyline
I'm checking polylines to make sure power pylons were correctly extracted from imagery. Is there a way to find all of the gaps or missed pylons in the database? Currently, I'm manually making a ...
0
votes
1answer
42 views
Maintain 8-bit pixel depth in Raster Calculator
Would anyone know how to maintain 8-bit pixels when computing raster calculations in ArcMap?
1
vote
0answers
30 views
Problems running zonal statistics - not all zones represented
I have been working on a Python script to automate the steps illustrated by whuber here:Create points around the edge of viewshed results
I am trying to create a horizon graph illustrating the ...
0
votes
1answer
114 views
Invalid topology error when running script
I am trying to run a python script and I get an invalid topology rule when I get to the feature to line tool. I am using arc 10.1 but I think the script was written in 10.0. I know it was built in ...
0
votes
1answer
70 views
How can i select many rows from a table?
I want to create an action that select many rows from PostGIS table to show many lines in QGIS.
How can i select many rows from table with python to add these rows in a layer?
Thank you
1
vote
1answer
79 views
How to use CURRENT map document in Python tool?
I am attempting to use this code in a tool that I am working on:
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
XMIN = df.extent.XMin
YMIN = df.extent.YMin
XMAX ...
2
votes
3answers
82 views
What are efficient algorithms to join segments and to split a line into segments?
Referring to the Figure below:
How to efficiently join segments into lines?
How to efficiently break lines into segments?
The above will be applied million times.
3
votes
1answer
191 views
Creating Selection MapTool in PyQgis Custom Application
I'm developing a custom GIS application using PyQgis API.
How can I let the user select features on the map using Maptools? I would like to replicate the select feature there in Qgis to make the ...
1
vote
1answer
81 views
Difficulties in dissolving stream orders
I've been trying to dissolve streams, using orders programatically and I came across this VB script. The reason is that if I use ArcGIS dissolve, it merges the confluence of the same orders. I would ...
14
votes
3answers
1k views
Can i use ArcPy to get layer symbology?
Hello all
Since ArcGIS 10 comes with ArcPy package, i'm wondering it is possible to use ArcPy functions to get Symbology (i.e color, width...) of a layer?
Thanks in advance
1
vote
0answers
46 views
Change ArcGIS License using Script
I am using ArcGIS Desktop 10 and we have three different servers for accessing concurrent use licenses of ArcView, ArcEditor and ArcInfo. So, whenever I need to switch to other product, I have close ...
2
votes
2answers
95 views
What Python package to use to calculate midpoint?
I asked a question earlier about how to calculate a midpoint. I was wondering if there is a Python library that does this alreay?
0
votes
0answers
20 views
How to change value of an Line edit dynamically
I create a form in QT4 and compile with pyuic4. it create an form.py
I want to modify the value of the line edit dynamiclly with code.
I put this code in the form.py but never happen:
...
1
vote
1answer
31 views
Combining polygon geometries with python and QGIS segfaults
I am trying to combine polygons, using Qgis 1.8, and every time I run this script in the python console, I get a segmentation fault. Here is the script:
from PyQt4.QtCore import *
iface = ...
3
votes
1answer
34 views
ArcObjects (VB.Net) Python Integration with object passing?
This link illustrates one method for calling python scripts from within an ArcObjects environment. The results of these tasks are returned as strings. I wonder if it is possible to call a python ...
0
votes
1answer
37 views
Make many lines in one layer (Python)
I what to create many lines with this code:
v_layer = QgsVectorLayer("LineString", "cable", "memory")
pr = v_layer.dataProvider()
seg = QgsFeature()
...
4
votes
0answers
423 views
How to inserting script into ArcGIS ModelBuilder?
I am looking for some tips about inserting a script in the ModelBuilder...
I am actually building a model in the ArcGIS ModelBuilder. At one point I would like to insert a script that crosses ...
0
votes
2answers
66 views
Python to get ids from shp dont return all records
I have some Python code to get the ids and georeference from a shapefile:
canvas = qgis.utils.iface.mapCanvas()
allLayers = canvas.layers()
nos = QgsFeature()
for i in allLayers:
if ...
7
votes
1answer
86 views
Difference between python window and toolbox
Are there differences in performance or other potentially critical area between running a python script in the python window versus running it from the toolbox in ArcGIS 10.0?
I am asking in cases ...
5
votes
1answer
65 views
Python - OGR: Transform coordinates from meter to decimal degrees
I have a point in a shapefile. The shapefile is in a WGS_1984_Web_Mercator Projected Coordinate System. I want to get the coordinates of that point in decimal degrees with GDAL/OGR in Python.
I am ...
0
votes
2answers
69 views
Tile script (Mapnik) with OpenLayers - Problem with projection (900913)
I use Mapnik python bindings in a geodjango application to render tiles in openlayers with datasource stored in postGIS in 900913 projection. The feature seems to be rendered correctly in the ...
3
votes
2answers
69 views
Python split table by “State” field and export to individual tables?
So I have never posted here before. I have used the site a lot for help so many thanks to all the great contributors. So, I have used ArcGIS online to perform batch geocoding (18,000) records and it ...
12
votes
1answer
230 views
How can I utilize NumPy arrays to optimize big data geoprocessing?
I'm interested in learning how to utilize NumPy arrays to optimize geoprocessing. Much of my work involves "big data", where geoprocessing often takes days to accomplish certain tasks. Needless to ...
0
votes
1answer
72 views
How to convert geometry of SHP to decimals
I try to create a line with two points. These points are obtained in a SHP layer.
How can i convert that points to decimals?
Thank you
3
votes
0answers
45 views
Accessing arcpy functions from IronPython
I made a few python scripts to automatically optimize and publish my data..
Now i'm thinking about writing a .NET program to manage and run these scripts: the obvious way is invoking them in a ...
1
vote
1answer
99 views
spatialite.dll with Python and QGIS - the specified module could not be found
I'm having a bit of a nightmare getting to the bottom of this DLL loading problem. The stand alone script works absolutely fine but the exact same code does not work within QGIS.
import sys
from ...
0
votes
0answers
67 views
python script to calculate and return values based on several conditions
I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid
considering the attributes are species name, grid code, ...
11
votes
1answer
101 views
Watermarking photos using their geotag and create a shapefile
I have geotagged photographs and I would like to place a watermark of the photos location on the front for easy reference as well as creating a shapefile from the coordinates. Does anyone know of any ...




