Python is an open source interpreted programming language used in many GIS programs.
2
votes
3answers
98 views
How to test if geometry is inside another?
I need to tell whether geometries from a shapefile are inside other geometries or not.
For example, I want to test if there are trees (represented as points in trees.shp) inside the urban areas ...
3
votes
1answer
52 views
Get the total distance from a point to the end of a linestring
I have a list of GPS coordinates that make up a bus route:
busRoute = [(x1, y1), (x2, y2), ... (xn, yn)]
I also have a point that may not be exactly on that route (due to GPS error):
...
0
votes
1answer
53 views
Error: Exception Raised on the “for row in rows” command line?
I am comparing fields in layers. I have the AADT layer and AADTAnno layer and I want it to search the fields FLAG and TFLAG. For Example: If there is a 29C9 in AADT layer in FLAG fields then there ...
11
votes
2answers
235 views
Measuring Script Writing Competency
I've been asked by my manager to come up with some sort of competency measure for an employees understanding of scripting/programming. Because I am a self taught programmer, I really don't have a ...
1
vote
1answer
62 views
How to “Merge Selected Features” with python?
I have been looking for the answer to this question for some time now, but can't seem to find it! My problem is straight forward:
I have one layer
It contains lots of features (only polygons), say ...
0
votes
0answers
19 views
Change offset of geotiff file [migrated]
I need to change the offset of some tiff files that I am exporting from Qgis.
Qgis gives them a offset of 0xbd72, while the program I need to load them in to only reades files with an offset of ...
3
votes
0answers
53 views
Create easy Annotations from point features with python in ArcGIS 10.0
Because in ArcGIS 10.0 there is still no simple toolbox function to convert labels to Annotation, I try to go a substitude way with the callable Toolbox function [TiledLabelsToAnnotation][1] on a ...
4
votes
1answer
57 views
Switching between background 64 bit processing and 32 (so I can use 3rd party ie XTools)
I often run scripts now with 64 bit background processing enabled but when I want to use certain tools like Xtools table to text I have to turn it off as these tools are 32 bit. Is there a way to ...
5
votes
2answers
140 views
Accessing ESRI Arcpy modules from Enthought Canopy
I've got ArcGIS 10.1 running on my windows system and I've
installed the new 32-bit Canopy Express Enthought Python Distribution.
Is it possible to load and use the ESRI arcpy modules from Canopy?
1
vote
0answers
47 views
Averaging satellite data with missing values (using Python)
I am using sea surface temperature, chlorophyll, and other data parameters as covariants in a model, and I would like to average them over a particular time period.
I am currently doing this using a ...
4
votes
1answer
55 views
Populating a Value List in one Parameter, from Values Derived from a Second Parameter, Python
Using the Validator in the ArcGIS 10.1 tool GUI, can I loop through and List feature classes from a workspace type parameter (ie a file geodatabase) and then go on and list the values of a field in a ...
1
vote
2answers
72 views
access attributes of one class for use in another class in python add-in
I want to get combobox attribute 'dem' and use it for further processing in class ExtentData. But I am not sure how to get attributes from one class to another for processing in pythonaddin. In ...
5
votes
1answer
128 views
ModelBuilder: How to extract data by date, export to separate tables and interpolate tables to rasters
I've been using ArcGIS for a couple years, but when it comes to model builder I've only worked with very simple models. I'm hoping someone that is much smarter than myself can help me in building a ...
1
vote
1answer
154 views
Find and replace unicode character in a shapefile
I've found several example of script and blog posts on working with unicode characters, but I haven't been able to make anything works so far... It's a little frustrating
I have a shapefile encoded ...
3
votes
2answers
191 views
How to automatically reloaded raster layer if source is changed in QGIS?
How to automatically reloaded raster layer if source is changed? (The path is the same but inside source file are changes)
I use:
qgis.utils.iface.mapCanvas().refresh()
but layer not refresh.
#
...
2
votes
1answer
71 views
Select by attribute expression invalid in python
I'm not sure how my expression is failing. Any ideas?
inPoints = "points.shp"
i = 0
arcpy.MakeFeatureLayer_management(inPoints, "pts")
arcpy.SelectLayerByAttribute_management("pts", "NEW_SELECTION", ...
1
vote
0answers
25 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 ...
4
votes
3answers
82 views
Run Viewshed on only one feature at a time in a shapefile
I have over 100 features in a shapefile and I want to create individual viewsheds for each and then run processes on each of those resulting viewsheds in ArcGIS using Python.
Is it possible to write ...
0
votes
1answer
41 views
Qgis - taudem plugin - python script not found
I installed the sextante toolbox on qgis.
my os is fedora.
grass works fine but i've got problems with taudem. it seems like some python files are missing.
for instance when i try to run the ...
0
votes
1answer
62 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
0
votes
1answer
26 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
1answer
70 views
openlayers python proxy.cgi script is not taking parameters
I have setup the python proxy.cgi in cgi-bin folder in my server.
[myserver]/cgi-bin/proxy.cgi returns the openlayers website
[myserver]/cgi-bin/proxy.cgi?url=www.openlayers.org returns list index ...
1
vote
0answers
52 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 ...
0
votes
0answers
22 views
Is it possible to disable cmd window when running a GDAL? [migrated]
Is it possible to disable cmd window when running a GDAL?
Something like a "silent mode".
I use :
os.system('gdal_translate -of GTiff %s %s'%(in1, out1))
1
vote
1answer
45 views
How to get a message when the map is moved in QGIS?
I want to get a message when every time I move the map.
I had:
def info(self):
QMessageBox.information( self, self.tr( "Info" ), self.tr("info") )
I suppose that used to be something like ...
4
votes
1answer
41 views
“Sequence size” doesn't match row in Python?
Essentially I am trying to calculate a value for a couple of fields after adding them. Below you can see how I am adding the fields and then an example on how my "for" statement is looping through the ...
3
votes
3answers
194 views
Use Python to parse string [closed]
OK, I know that this is Python 101, but I can't seem to figure it out.
I have a function setup that will return a string, specifically an azimuth in DMS. I need to take the return values and pull ...
1
vote
1answer
58 views
Python GDAL: Save array as raster with projection from other file
I have an array of data, and for each datapoint I know the latitude and longitude. I'd like to save it as a GTiff with the same projection as other rasters I have. This is what I've tried so far, but ...
1
vote
0answers
28 views
How to programmatically change an SVG symbol in the Vector Layer?
I'm trying to change the symbol used in a layer via Python. I've been able to tunnel through a vector layer to the symbol layer, but I don't know how to change the symbol it's using. I'd like to ...
7
votes
2answers
90 views
Autoincrement field when New Feature added
I know that this is probably a very basic programming but I am brand new to Python.
I have a layer in a geodatabase that I need a unique ID field (for joining). I can't use the ObjectID because that ...
2
votes
1answer
58 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 ...
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
1answer
52 views
Joining table to shapefile with pyQGIS
Joining shapefiles is a relatively straightforward proess in QGIS using 'add vector join' in the layer properties menu. I can add a csv file as a vector layer, as well as a shapefile, and join the two ...
2
votes
1answer
54 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 ...
3
votes
3answers
132 views
How to convert geometry to WKT using ArcPy?
I would like to be able to convert a single feature (or potentially many features) in an ArcGIS layer into Well Known Text (WKT) format during a geoprocessing operation using Python and ArcPy (no ...
2
votes
0answers
42 views
traversing KML files with ogr python
i'm new to OGR processing and KML format so be gentle:
i've got a series of KML files all containing multiple regions partitioning a larger area in each. i also have a series of geocoded points for ...
1
vote
0answers
38 views
Clipping Buffers
I have buffered a line shapefile where many lines are intersecting but not broken at intersections. I am trying to select each record in the buffer file and clip all intersecting polygons in the same ...
2
votes
2answers
80 views
Create point geometry in a feature class with all the attributes prepopulated
So here is the problem. I have a text file with space delimited values. A standard text file with the headings separated by spaces and then on each next line values for these headings (columns) also ...
3
votes
2answers
80 views
Delete feature selection using Python (ArcGIS 10)
I'm having some issues with a Python script for ArcGIS 10. The idea is to delete points from a single shapefile according to the values of two columns ("Tracks" and "Tracks_1").
Therefore, I want to: ...
4
votes
1answer
92 views
Speed of editing attributes in QGIS from a Python plugin
I'm trying to edit the value of an attribute for each feature in a layer using a QGIS Python plugin. I've found that doing this outside of editing mode is much slower than while editing (even ...
2
votes
1answer
80 views
Python code: Using Search Cursor to find missing values in attribute table between two layers in one MXD
I need help! I am writing a program that will look through the table of a station layer and then go to the annotation layer and list all the missing values. For Example: The station layer has a field ...
0
votes
2answers
92 views
Using Python to parse an XML containing GML tags
I am trying to write a python script which pulls GML tags out of an XML file and formats them into WKT for inserting into a PostGIS database. I have been successful in doing so for an XML containing a ...
3
votes
2answers
84 views
Replace non-English characters in attribute tables
I have a few shapefiles where some of the attributes contain the non-English characters ÅÄÖ. Since some queries doesn't work with these characters (specifically ChangeDetector), I tried to change them ...
2
votes
3answers
71 views
Interacting between Openlayers and Python
I have a openlayers website like this one that gives the user the ability to draw polygons and then creates a GeoJSON file. I want to process this GeoJSON with a python script. The python script ...
0
votes
0answers
41 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 ...
7
votes
1answer
199 views
Pros and cons of using Ruby/Rails/RGeo or Python/GeoDjango for a web based GIS
We're at the investigation phase of creating a web based GIS. We're assessing options for an ORM to use in all of our backend import/export and processing routines. From my research, GeoDjango appears ...
2
votes
1answer
34 views
ECWs missing when exporting MXD to PDF with arcpy
I'm trying to export some MXD maps to PDF with arcpy (ArcGIS 10.1). Everything works fine and dandy except for ECW images, which don't appear in the PDF. However, when I execute the same code from the ...
1
vote
0answers
21 views
How to identify grid shift file used by osgeo in Python?
I wrote a Python script reprojecting points from a source coordinate reference system (SCRS) to a target one (TCRS) both identified by an EPSG code.
I would like my python script to retrieve details ...
2
votes
1answer
68 views
OGR - Weird GeomType -2147483645 on polygon shapefile
I am trying to import a shapefile (multipolygon) in an app with ogr but I got an error about invalid geom type. If I inspect the data with ogr like this:
datasource = ogr.Open("c:\\temp\\data.shp")
...
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 ...




