Python is an open source interpreted programming language used in many GIS programs.
0
votes
1answer
27 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 ...
1
vote
1answer
47 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
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
65 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
41 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
113 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
78 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
75 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
45 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
19 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
28 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
29 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
35 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
418 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
65 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
83 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
57 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
62 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
228 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
44 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
95 views
+50
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
91 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 ...
9
votes
2answers
643 views
How to call gdal_translate from Python code?
Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.py from the file system, but rather call it somehow in code so I do not ...
1
vote
2answers
60 views
Set Extents of MXD to new layer data source?
Alright here I go again this forum has been good to me. I add a layer and replace its data with a shapefile I created using the following bit of python:
layer = ...
2
votes
2answers
336 views
r.mapcalculator and python again
I've been trying to write a script creating binary maps:
a=raw_input ("enter a threshold")
b=float(a)
grass.run_command('r.mapcalculator', formula="**'base_map'>=b**", outfile='map'+str(a), ...
1
vote
1answer
53 views
How to use QgsOverlayAnalyzer class in pyQGIS?
I am very new to Python scripting in QuantumGIS, so bear with me please.
I am trying to use the QgsOverlayAnalyzer class in QuantumGIS (http://www.qgis.org/api/classQgsOverlayAnalyzer.html#details) ...
2
votes
2answers
223 views
run r.stats as a quiet module in GRASS-Python script
Has anyone else used r.stats as a quiet module in a GRASS-python script?
As part of my program I'm using:
grass.run_command("r.stats", flags='l', input=<file>, output=<*.csv file>, ...
2
votes
1answer
59 views
Writing python plugin: How terminate plugin from script without closing QGIS?
I'm writing a QGIS conversion plugin in python to be able to create Obstacle-files for a model from shapefiles.
What I want to do now is just to close the plugin cleanly. This means, to close the ...
2
votes
1answer
55 views
How to see print commands through Python Script while programming plugin for QGIS?
This might sound like a silly question.
Is there a way that from running a custom plugin made for QGIS that a Python Shell can appear along when the plugin is run, like a debug screen. I'm asking ...
0
votes
1answer
64 views
Join multiple shapes in a workspace based on a common field
I’m completely stucked!!! I’m working with meteorological data (wind) but I have to arrange the data for a program to be able to process it. I have text files, two per day (one with the wind direction ...
1
vote
1answer
33 views
How to keep specified separation distance between features in printout from ArcMap?
Does anyone have a solution to select features using attribute values and print only the selection keeping a specified separation distance between the features in the printout in ArcMap.
1
vote
2answers
281 views
How to make editable polygons in Google Maps?
I've just recently started learning Google maps, JavaScript, etc., and have a few questions about a project that I'd like to do. I'm wanting to take some ESRI shapefiles, convert them to KML, and then ...
0
votes
0answers
21 views
How to get Perpendicular cross section along the river using python and Arc Map 10? [duplicate]
I need to draw the perpendicular line segment along the river at a regular interval. How can i obtain like this output using Python and Arc Map 10 ? I would be very grateful if you give some idea..
0
votes
1answer
29 views
QGIS Python - Convert geometry from Postgres to QgsPoint()
I have made a query in Postgres to get some points to use with python.
This points are in geometry data. How can I convert that geometry in decimals to use QgsPoint() in python?
Thank you
-1
votes
1answer
50 views
How can i draw a perpendicular line in a stream segment in a regular interval of 30m? [duplicate]
I have a stream segment which is polyline feature. Now I want to draw a line which is perpendicular to stream segment at a interval of 30m. How can i do it using python ? Do you have idea on this .
2
votes
1answer
70 views
How come “Zoom to Polygon” always puts me in the middle of Nebraska?
This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that ...
10
votes
2answers
445 views
Metadata -auto build using python
We have a large (10,000 plus) repository of spatial data (shp/gdb/tab vectors and ecw/tif rasters and also las, xyz and DEM data) where some have metadata records in xml using anzlic metadata editor. ...
1
vote
1answer
70 views
Can I open a form in layer action?
I want to open a form (made in QTDesign) in the layer action. It is possible?
2
votes
1answer
44 views
Tabulate Area crashes Python and ArcGIS
I have a script that runs Tabulate Area on a single feature class multiple times with different rasters. In total Tabulate Area runs 5 times. 2 of the input rasters are provided as arguments to the ...


