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

learn more… | top users | synonyms

1
vote
0answers
153 views

How to utilize GPSQLExpression data type in Python Toolbox

I am trying to write my first Python Toolbox for ArcGIS (neat stuff by the way). The tool is simple enough - it connects to SQL Server and downloads data for the user. The trick here is, I want the ...
1
vote
0answers
193 views

Folium GeoJSON Overlay Not Appearing

I am in the midst of a task which involves the clustering of assessment neighborhoods into larger neighborhoods (data link). The goal is build these neighborhoods in a manner consistent with major ...
1
vote
0answers
107 views

Create custom “Export To” context menu tool using selected feature in ArcCatalog

I'm trying to create a custom "Export To" script similar to the Right-Click Export Content menu item "To Geodatabase... (multiple)". I have a 3 feature classes in a file geodatabase. I selected two of ...
1
vote
0answers
119 views

QGIS: How to reverse vertex ordering in polygons

I am working with an Oracle spatial connection in QGIS through which I am accessing and editing a vector layer. I find that when I edit a geometry, the vertex ordering is reversed (to clockwise in the ...
1
vote
0answers
87 views

how can i export a shapefile

hi I want to select the cities that exist in Morocco and export it to a shape file and I used this code but its not working, it gives me an error: code: import arcpy from arcpy import env ...
1
vote
0answers
49 views

Arcpy PageLayout.dll Errors in Python

import os import arcpy arcpy.env.overwriteOutput=True folderPath= raw_input ("Enter directory: ") filePath= raw_input ("Enter data repository: ") f = open((os.path.join ...
1
vote
0answers
18 views

Q: cursor memory and fields therein

Theoretical Python question. Say you have an update cursor while-loop for a few selected records. While looping through the rows, at some point a nested if statement triggers an "addfield" event. The ...
1
vote
0answers
145 views

Editing of vector layer programmatically with QGIS

I'm trying to edit vector layer using Python console and have couple of questions. Why this approach doesn't work and I have to use canvas.refresh? If I will use this code not in python console but in ...
1
vote
0answers
118 views

Accessing existing instance of qgis from stand-alone python script

For my own data analysis pipeline, I am running a split screen setup with iPython notebooks on one side, generating variables from source data, pushing them to a csv file which qgis then reads/joins ...
1
vote
0answers
88 views

Is it possible to get field type information from FieldInfo object in ArcPy?

I'm looking at the FieldInfo object documentation for ArcGIS 10.2 and am not seeing access for field type (e.g. short, string, double). Is it possible to get field type information from the ...
1
vote
0answers
201 views

Locating the centroid (center of mass) of spherical polygons

I'm trying to work out how best to locate the centroid of an arbitrary shape draped over a unit sphere, with the input being ordered (clockwise or anti-cw) vertices for the shape boundary. The density ...
1
vote
0answers
62 views

Russian in fieldname changing with Python in ArcGIS

Is there any way to rename fieldname in the attribute table of a layer/shapefile in ArcGIS 10.2 containing russian letters? If yes, is it possible to do it in a script?
1
vote
0answers
62 views

How to create a startup prompt that populates definition queries on multiple feature classes

I would like to create an ArcGIS start up prompt or custom button that asks for a user's initials and then populates multiple feature class & layer definition queries. More specifically, I would ...
1
vote
0answers
65 views

Access to python addin objects/variables in python window

Following up on this question: Can a Python script be executed from a .NET AddIn and also write its standard output and geoprocessor messages to the ArcMap Python Window? Is is possible to access ...
1
vote
0answers
199 views

arcpy symbology colors changing on RefreshActiveView()

I have a problem that I'm not sure is functionality not built into arcpy or I'm just doing something wrong. I'm using arcpy.mapping.UpdateLayer() to apply symbology to a layer, but afterwards some ...
1
vote
0answers
65 views

What is the best way to handle geometries between Python functions?

What is the best way to handle geometries between different Python functions? For example: I have a function that exports a line from grass.script. The line will be a parameter of another function ...
1
vote
0answers
114 views

GDAL and Python: How to “pad the extent” or otherwise handle band.ReadRaster() for area falling slightly outside the image bounds?

In a nutshell, I'm trying to create a bare-metal tiling utility using GDAL and Python. As you can see in the graphic below, which shows the perimeter of a raster and the OSM-structured tile index, ...
1
vote
0answers
213 views

Unable to use pyQGiS in a custom application - import arcgis.core error

I'm using windows 7 and/or 8 64 bit with QGiS 2.01. I'm wanting to us the pyQGiS tools in a custom python application outside of the QGiS environment (i.e by running a python executable located in ...
1
vote
0answers
124 views

Matplotlib Basemap Resolution with PyQt makes Python Quit Unexpectedly

I'm having difficulties using Matplotlibs Basemap in combination with a PyQt4 interface. Basically I create a Pyqt4 Canvas in which I plot a Matplotlib Basemap and some markers. I call the function in ...
1
vote
0answers
96 views

Efficient computation of path profile with Numpy and GDAL

I have numpy array with SRTM elevation data and I need calculate path profiles - vectors with elevation data from one point (transmitter) to every points of my map. Here's my current solution: def ...
1
vote
0answers
89 views

AttributeError: Error in getting tool information when using TableToTable tool

I am trying to use the arcpy.TableToTable_conversion tool in my python script, but seem to be getting the following error on the line arcpy.TableToTable_conversion("FINAL_NLPG", ...
1
vote
0answers
137 views

Composite bands produces a single band image

Running this produces a single band tif and not a three band image. Has anyone seen this before or can suggest ways to trouble shoot it? Input_Rasters = path + parentdir + "/" + dir + "/" + ...
1
vote
0answers
242 views

Couldn't load PyQGIS, QGIS 2.0.1 on Ubuntu 12.04 Precise

After upgrading to QGIS 2.0.1 I still get the error: Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in File ...
1
vote
0answers
59 views

Obtain virtual output directory path in geoprocessing service

I am publishing a geoprocessing service and I want to be able to access the virtual output directory path configured for the service. Now I know that gp services will magically return virtual paths ...
1
vote
0answers
164 views

How to change the color of a selected feature with pyQGIS?

is it possible to change the color of a selected feature in qgis 1.8? To highlight a feature I use: vlayer.setSelectedFeatures(selectedList) box = vlayer.boundingBoxOfSelected() ...
1
vote
0answers
87 views

How to join attributes by location with command line

I would like to joint the attributes of 2 shapefiles by location but with a command line (linux). This feature is easy in QGIS but it is VERY slow. Is there a way of doing this with ogr or pyqgis ? ...
1
vote
0answers
192 views

merge_management

Here is the edited code: import arcpy import os from arcpy import env set the environment settings env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("Sub_NVF_*") ...
1
vote
0answers
218 views

Pyshp 1.2 example from documentation fails

I must be doing something really stupid because I am trying to run an example straight from the PyShp (shapefile.py) 1.2 documentation with the only change being the input shapefile and it is failing. ...
1
vote
0answers
149 views

Modifying Raster Layer with Python Console

Forgive me if this has been asked somewhere else. I am looking for a way to edit a raster file which has already been loaded into QGIS through the python console (i.e. I would like to edit the raster ...
1
vote
0answers
96 views

Reference to Basemap instance's coordinate system

I use the matplotlib basemap toolkit (mpl_basemap.Basemap) to plot GeoTIFF images on a map background using pcolor() or pcolormesh(). For this purpose, I need to transform a meshgrid of x and y ...
1
vote
0answers
73 views

How to create a schematic view of a line feature?

DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far… I have a line feature (polyline with curves) in ArcGIS Desktop, and I want to create a linear representation (straigth line) of the ...
1
vote
0answers
44 views

Qgis 1.9 commitChanges() and Redraw a temporary layer

Using QGIS 1.9 and writing a python plugin. I have a function that connects points into polylines and draws them as a temporary, in memory layer. Membership in a polyline is determined by a field in ...
1
vote
0answers
189 views

Calculating the closest distance between two points in ArcMap 10.2

I am looking for a script to calculate the closest meter to a set of addresses. I have a feature class of meters and a feature class of addresses. I have populated the address with fields for ...
1
vote
0answers
78 views

Automated attribute update geometric network

I have a Network Dataset of a storm water system containing two feature classes of points and lines. (All data is topologically sound with pits and pipes snapped and linework captured in direction of ...
1
vote
0answers
69 views

How to rotate u and v components of wind in rotated gribs?

I have a grib message of a rotated hirlam product. The gribmessage states, that the u and v component contained are relative to the rotated grid. How can I unrotate them?
1
vote
0answers
148 views

proj/pyproj converted coordinates offset

I'm using pyproj to convert some coordinates from WGS84 to OSGB36. When mapped out the converted and unconverted don't map to the same places on a map. The OSGB36 coordinates are mapped about 100 ...
1
vote
0answers
46 views

Deleting network features in python script doesn't create net junctions

I have a script that makes a copy of a network dataset for a 3rd party app to use. One of the junction feature classes causes problems with the app. The ideal solution would be to remove it from the ...
1
vote
0answers
134 views

Can ModelBuilder be used to export different versions of the same mxd with various constraints?

I am currently trying to use modelbuilder to go through each row in an attribute table, select the streets that intersect the polygon (which is the row in the attribute table), zoom to the selected ...
1
vote
0answers
254 views

Loop though records in PostGIS (using PL/PYTHON or PGSQL)

I've seen many example of loops, but I can't get that one to work. I work for a regional transit agency and each year, we conduct several surveys. I geocode everything to the house level for internal ...
1
vote
0answers
94 views

how to avoid Intersection of polygons via python code

i am using QGIS 1.8 and i can set the check box in Setting\Snapping Options "Snapping and Digitizing " dialog to avoid polygon intersections and enable topological editing but i am looking for a way ...
1
vote
0answers
274 views

Why does ArcGIS Resample tool change cell size and numbers of columns and rows?

I am working with images of oxygen distribution within individual plant root systems submerged in water. The program I use to acquire these images, LookatRGB, splits the green band in half and makes ...
1
vote
0answers
169 views

problem with WFS Data, GDAL, Python, ArcGIS, & Defining Projection

I'm pulling in data in gml2 format with a EPSG#4267 from a wfs. I create a datastream in python and then run the following from the python window in ArcMap: data = datastream.read() #write the gml ...
1
vote
0answers
129 views

How to shift vertices of shapes in shapefile using FOSS python library?

I need to shift each vertice of shape in a shapefile (of any type:point, line, polygon, multiline etc.) with Python. I need to loop in all shapes, get the vertices, get it's coordinates and for each ...
1
vote
0answers
217 views

XY event source layer problem (converts into feature class after running python script ) in ArcMap 10.1

I am using ESRI 10.1 suit (ArcGIS Desktop & ArcGIS Server, No ArcSDE) at my end and after running python script n number of times event layer converts into feature class. Following steps I am ...
1
vote
0answers
221 views

Qgis libqgispython.so failed to load

I am using Qgis 1.8 and Python (on Ubuntu 12.10) for a couple of month now, but today i got suddenly the error Couldn't load Python support library: Cannot load library /usr/lib/qgispython: ...
1
vote
0answers
139 views

How to create multi-image single band single file geotiff?

I have a geotiff file that is single band but contains multiple subdatasets. I use gdal with numpy to open a specific subdataset and mask some of its values. Example: $ gdalinfo sample.tif ... ...
1
vote
0answers
194 views

Add metadata to dataset (feature class, coverage or shapefile) from a .csv using arcpy?

I am looking for a script that will take metadata information provided in an excel table, convert it to a .csv and import the values to populate some of the dataset's ArcGIS metadata elements. I came ...
1
vote
0answers
87 views

QGIS GPS bluetooth connection

I have setup a Haicom bluetooth gps on a machine running Windows8 and have used GPSGate to create some virtual COM ports. I have valid data arriving at the COM port, but then I run QGIS and try to ...
1
vote
0answers
36 views

Problem in analyzing data in a stream segment

I have to find out the head difference along the stream segment. For that I used Spatial Analyst Tool>Extraction>Sample. With that I got the elevation values in points. But after doing so, i found ...
1
vote
0answers
57 views

Ubuntu Raring - Openlayers Plugin 1.8 or 1.9 Master

Relative newbie to Ubuntu and QGIS. Many questions are posted relating to the Openlayers plugin. It works fine in windows but I cannot get it to work or even appear in either 1.8 or 1.9. The "fetch ...