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

learn more… | top users | synonyms

2
votes
0answers
54 views

Gdal Python Problem : Black strips in geotiff

I am trying to use GDAL (2.0.0) Python API in Blender, but I am having some difficulties. I am trying to save geotiffs for : - a 2D numpy array storing 32bits floats - a 3 channels rgb numpy array ...
1
vote
1answer
29 views

XML Document points to the wrong location after using arcpy.BatchProject()

I'm trying to reproject a number of shapefiles representing contours from NAD_83_Albers to NAD_83_UTM_Zone_9N using arcpy.BatchProject(), but I have to use python/regex to preserve a particular file ...
1
vote
1answer
32 views

Using label expression to label highway with last group of numbers in field

I'm using Tiger road files and I want to label the highways with their shield number. Tiger has an inconsistent naming convention for road features; I am specifically concerned with the highways. I ...
0
votes
0answers
41 views

ArcGIS calculate average value

I would like to get the average value of specific attributes. I have a table with columns like: ID, P1, E1, Age1, P2, E2, Age2, P3, E3, AverageAgeP, AverageAgeE Sometimes there is a value for P, ...
1
vote
1answer
36 views

How to convert/export a large number of attribute's information shapefiles to txt/csv format using a python script

I'm using the 2.8.1 Wien QGIS version. I have a large number (more than 5000) of shapefiles that I want to convert to a csv or txt files to extract, to tables, the atributte information. The ...
3
votes
1answer
24 views

Problems with Reclassify and RemapRange in ArcPy?

I'm having a bit of trouble with a script that uses ArcPy. I keep getting the following error: ExecuteError: ERROR 000622: Failed to execute (Reclassify). Parameters are not valid. ERROR 000628: ...
0
votes
0answers
24 views

NetCDF4 Files: Missing Projection & Varying Dimensions (Multiple Files)

All, I hope you can shed some light on issues I've been having regarding NCEP Reanalysis-I netCDF-4 file format: First issue, Projection information is not stored on the downloads I obtained from ...
1
vote
0answers
53 views

way in R or Python to add image/video in map plot marker click popup/infowindow

I have many different (lat,long data) points of world associated with unique place names and corresponding each point specific image or video data. Now I want to create an html file where if user ...
1
vote
2answers
56 views

32-days composite using LST 8-days Data

I want to make a 32-days composite from 8-days LST data by taking its average value, but I am facing a problem in checking QC-day, the other thing is, due to data gaps (missing DN values) we cannot ...
2
votes
1answer
66 views

QGIS Plugins & Tools that replicate Select ArcPy Tools

I developed a complex python application for road generation from GPS Devices that uses a few Arcpy Tools. I want to try and replicate this Applications functionality using a freeware like PyQGIS ...
0
votes
1answer
53 views

Using If Statements in ArcGIS Calculate Field?

I've never used Python scripting before and can't seem to figure out how to use an If statement in the Field Calculator tool. I have a field called 'MAX_GRIDCODE' which returns the highest force a ...
0
votes
0answers
18 views

Skipping the string serialization in json.loads(OGRGeometry::ExportToJson())

I have a for loop that exports a bunch of OGRGeometry objects to a python array in what will eventually become a GeoJSON feature collection. Something like this: features = [] for feature in ...
1
vote
2answers
66 views

QgisInterface.addVectorLayer Error

I am Esri-trained, trying to move into QGIS using Python. Simply trying to add a vector layer in Qgis returns the below error: TypeError: QgisInterface.addVectorLayer(QString, QString, QString): ...
2
votes
1answer
59 views

different way to build qgis python standalone application

There seems to be 2 different ways to start a Python QGIS standalone script. The official tutorial is using : from qgis.core import * # supply path to where is your qgis installed ...
0
votes
1answer
58 views

Create a Loop for Arcpy

I am looking for help to write a loop a arcpy.CalculateField_maagement process where the User is asked with the 'raw_input', prior to the tool running "Do you need to change a field value(yes/no):", ...
1
vote
1answer
35 views

How to restrict panning in QGIS to a given extent

I'm going to build a QGIS standalone application. According to the requirements full extent equals to the extent of a predefined rectangle (say bounding box of a parcel). The application should start ...
0
votes
0answers
51 views

GRASS 7 (python:14221): Gtk-CRITICA Linux Mint

I installed GRASS 7 and QGis from the https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable (Trusty 14.04) in Linux Mint 17.1 two weeks ago (sudo apt-get install postgis libgdal1h ...
-1
votes
1answer
69 views

How to extract information from world file of images into a DBF catalog file through PYTHON?

Here are thousands of pictures in JPG or TIF format with world file such as jgw and tfw. Inside each file, projection information for each pictures were contained. One example of the content for a ...
0
votes
0answers
12 views

How to set the ALLOWED_HOSTS setting in GitHub-installed GeoNode?

I installed and developed a project in GeoNode in parallel to another CMS project in Django. The CMS runs in localhost:8040 and GeoNode runs in localhost:8000. It is important to know that GeoNode was ...
1
vote
1answer
29 views

Using WK ID's when using CreateSpatialReference tool

I recently found out how to create specific spatial reference objects and add them to my arcgis python standalone script. ...
2
votes
2answers
82 views

Raster image thresholding using python

I would appreciate if someone could guide me for applying thresholding technique to input raster image using Python. I intend to extract impervious surfaces from a high resolution raster such as ...
0
votes
0answers
48 views

How to write a QGIS-plugin to be used in IntraMaps Roam 2.4.0?

I know some python, but I have never written a plugin for QGIS nor Roam before. I like to be able to turn layers on/off in Roam I have read the Roam's wiki, and I have managed to make a plugin called ...
2
votes
2answers
38 views

How to calculate field as a substring of another?

I have a text field, field1, that's populated with 14-digit identifiers, like "01234567890123". I create a new field, field2, that I want to show the first four digits of field1. I would like to do ...
2
votes
1answer
59 views

Looking to find (or build) a particular Python geoprocessing tool

So here is my situation: There is a large area (a wildlife refuge) of nearly 200,00 acres that we have loads of spatial data for, from habitat management projects from the past several years. My boss ...
2
votes
1answer
45 views

How to split name in label so only first two words appear?

The labels for my feature SSA_NAME are approximately 5 words long. I would like to shorten the labels to only 2 words. Every time I try a different code I receive either an error message or my layer ...
1
vote
0answers
98 views

Minidump on exit in QGIS (2.8.2- Wien) 64-bit version when using GDAL in plugin

I am working on a plugin for QGIS that is working fine on 32-bit versions but I am having some problems while using it on the 64-bit standalone installation package. I have tried on several machines ...
5
votes
1answer
142 views

Cutting a circular buffer via Arcpy

I am currently working with compressor stations on centerline routes. These compressor stations have a 3 mile buffer surrounding them. I wish to cut a portion of the circular buffer off. These cut ...
1
vote
1answer
93 views

Changing colours in GeoPandas?

I have a very simple map (http://www.nyc.gov/html/dcp/download/bytes/nybb_15b.zip) and I have never before worked with shapefiles in any way. Can someone tell me what I need to do in order to change ...
1
vote
1answer
38 views

Gdal ReadAsArray() different values than gdal band statistics

I am confused about why if I open a band with GDAL I get, for example, band.GetMaximun(): 1000, but if I do ReadAsArray I get myArray.max(): 1200 (the same if I do np.max(myArray)). Does someone knows ...
2
votes
0answers
36 views

QGIS QgsLayerTreeGroup signal “currentLayerChanged”?

In a pyqgis context, I use the "currentLayerChanged(QgsMapLayer *)" signal of the QgisInterface class to do something when the current layer is changed, but I need now to do the same when I select a ...
2
votes
2answers
169 views

image segmentation of RGB image by K means clustering in python

I want to segment RGB images for land cover using k means clustering in such a fashion that the different regions of the image are marked by different colors and if possible boundaries are created ...
1
vote
0answers
37 views

rasters written with gdal show up with units of meters when they should be degrees

I have some SMOS soil moisture data packaged in a netcdf format distributed by "cp34-bec". I have been able to use GDAL to extract this data as a raster layer, using a projection i think is ...
2
votes
1answer
29 views

Redirect remote shell command output to ArcMap geoprocessing tool display?

I have a Python script that runs a shell command on a remote server (using the Fabric module). When I run the tool in the debugger, I see all the output scrolling, as the command can take hours to ...
0
votes
0answers
30 views

why did my python mysql script stop working, with error on fetchone()?

This code was working a couple weeks ago, then without changing anything, it started throwing an error. Here's the code: #Query climate table sFrom = dateIncrement.strftime("%Y-%m-%d ...
1
vote
1answer
38 views

Python: how to set a different output folder

I want to transform some vectors to rasters in my folder but I have difficulties setting the output folder. The following code only allows me to output to the original database. I hope to output all ...
1
vote
0answers
45 views

PyQGIS Standalone Crashes python.exe when zooming out too far / Process finished with exit code -1073741819 (0xC0000005)

I have the following PyQGIS Standalone App which is working fine so far. One little problem is that if I zoom out to the MaxExtent(by scrolling the mousewheel) the app crashes python.exe so that the ...
2
votes
1answer
40 views

Error: Algorithm not found (QGIS)

I wrote the following code using QGIS'API. import os from qgis.core import * import qgis.utils prefix_path = os.environ['QGIS_PREFIX_PATH'] QgsApplication.setPrefixPath(prefix_path, True) ...
2
votes
1answer
44 views

How to add a message bar to custom canvas?

There is a simple code to add message bar to main window in QGIS: iface.messageBar().pushMessage("Hello","World") My question is how to add bar to my custom canvas canvas = QgsMapCanvas() in ...
1
vote
0answers
71 views

import qgis.core problem with QgsFeature and QgsGeometry ImportError: DLL load failed: The specified procedure could not be found

I've tried several previous answers to similar questions - no luck. I've tried everything, nothing seems to work. This is the error I'm getting Traceback (most recent call last): File ...
0
votes
0answers
27 views

Pythonw has stopped working when running arcpy.SubsetFeatures_ga

I'm currently trying to subset a shapefile into training and validation files. When I run the following line of code, python crashes. I'm using ArcGIS 10.1. arcpy.SubsetFeatures_ga(current_shapefile, ...
0
votes
1answer
31 views

Semi Automated Classification plugin (QGIS) error when trying to create ROI

When I try to create a new ROI through Semi-Automated Classification plugin (SCP) for QGIS, I keep getting a message saying: "It appears that SciPy is not correctly installed. Please, see this page ...
2
votes
1answer
24 views

problem deleting shapefiles because still in use by arcpy cursor [duplicate]

I have a function outputTblContents which contains def outputTblContents ( path ): rows = arcpy.SearchCursor(path, fields="alpha; beta") for row in rows: print("{0} => ...
2
votes
1answer
68 views

PyQGIS standalone script does not work. Error “QGraphicsScene::addItem: item has already been added to this scene”

I try to test a PyQGIS standalone script which should just show one Shapefile. Sounds pretty simple but does not work. Here is my script: from PyQt4 import * from PyQt4 import * from PyQt4.QtCore ...
1
vote
1answer
52 views

“Browse” button returns python error in QGIS

I use the latest version of QGIS (2.8.2) in MAC and have se the default Python version 2.7. Moreover, I have installed all the required python modules and GDAL. It was working before, but now, when I ...
0
votes
2answers
71 views

Remove first seven characters from field string using Field Calculator

I wrote an expression/codeblock that removes the words "Nearby:" from the field value string if it has it. Codeblock: import string def splitme(s): if s[:7] == "Nearby:": aList = ...
0
votes
1answer
41 views

Generating elevation 'database' from NED IMG data

I'm starting to work with the NED 1/3 and 1/9 arc-second data. I've been using gdal in Python and QGIS to do some basic conversions of the raw .IMG data from USGS. My goal is to get elevation data of ...
0
votes
2answers
53 views

Calculate field in modelbuilder

If vb code is also possible I could give that a try aswell.
1
vote
1answer
48 views

Adding Vertical Reference in Python to ArcGIS feature dataset

I am creating a python script to generate a terrain. In the process I am creating two feature datasets. However, in order to successfully create this FD, i need both horizontal and vertical datums. I ...
0
votes
1answer
39 views

Can't get the where clause in Select layer by attribute working!

I am trying to develop a script that searches for a particular ID in a user selected field. To this end I have used the select layer by attributes tool to search for a derived number in a field ...
0
votes
0answers
22 views

Is it possible to save a dxf in memory

Following on from my question here, when I run the ExportToCAD tool arcpy.ExportCAD_conversion(listOfLayers, formatRelease, location + fileFormat, "Ignore_Filenames_in_Tables", ...