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

learn more… | top users | synonyms

0
votes
0answers
19 views

(python) distance between a point and a list of segments

I have a line (made of multiple adjacent segments) and a set of points, and I want to find all the points which are within a given distance (40m mainly but could change) from that line. segments ...
1
vote
0answers
9 views

arcpy.UploadServiceDefinition_server sometime fails with Error:999999 and fixed with swapping identical ags connection files

I need help resolving an intermittent 999999 failure during arcpy.UploadServiceDefinition_server. I'm using arcpy.UploadServiceDefinition_server with a saved ags arcserver connection file as part of ...
0
votes
0answers
28 views

Adding a Field to a Feature Class using Python

I'm trying to create a script that adds an integer field to a File GDB, calculates it, buffers it, then clips it to a different GDB featureclass. Can anyone help me, I'm stuck so far!? I'll provide my ...
0
votes
0answers
6 views

GRASS parser() error

I'm trying to use GRASS on python 2.7, but I'm having some problems at setting my script on IDLE, then I'm getting an error at parser() function: Here is my script: import os import sys gisbase = ...
3
votes
1answer
24 views

How to toggle group visibility in QGIS using Python?

I've tried this, but it doesn't work out. root = QgsProject.instance().layerTreeRoot() group1 = root.insertGroup(0, "PGB") legend = i.legendInterface() legend.isGroupVisible(group1) ...
1
vote
0answers
23 views

Building QGIS 2.8.6 on Win 7 32bit?

I'm trying to build QGIS 2.8.6 on Windows 7 32 bit using MSVC Express 10. The build process completes without errors, but with a bunch of warnings. When I run the qgis.exe after installation, it only ...
0
votes
0answers
10 views

How to delete features/records in ArcGIS Online hosted service using Python

How to delete features/records in ArcGIS Online hosted service using Python? I need to delete some features using Python from a feature services hosted in ArcGIS Online. I read a similar post that ...
0
votes
1answer
49 views

Is there a python-module to convert data to a Shapefile (w/o GIS)?

Input data can be excel, text, whatever. I would like to produce shapefiles from data on a computer without GIS installed. Is there anything out there? Fiona seems to be such a module. Are there any ...
-6
votes
0answers
27 views

Exporting Multi Maps like JPEG,etc with Python? [on hold]

I need to Export Multi Maps like JPEG or .... ETC with Python
0
votes
0answers
28 views

Python GPS Observation Equations

I've been trying to write some code that will take pseudo-ranges and satellite positions and then compute the observer's position. I've been trying to follow through this book, but the crucial stage ...
1
vote
0answers
19 views

Foreign Key error, creating new splite db?

Attempting to use a plugin in QGIS (midvatten) that utilizes splite. I am attempting to create a db in a different EPSG than the plug in defaults to, im getting "foreign key constraint failed" as my ...
2
votes
1answer
37 views

QGIS - PYQGIS Import gpx as vector layer

I'm trying to use the python console to import some gpx files as vector layers. When I do it manually I have to choose which layers to add, my options are: I've tried various versions of the code ...
0
votes
0answers
20 views

TopoToRaster Tool Execute problem in ArcGIS

I am trying to execute TopoToRaster tool (ArcToolbox>3D Aanalyst Tool>Raster Interpolation>Topo To Raster) in arcGis 10.0 with .NET. Topo to Raster Input But get exceptions. My code is here : ...
2
votes
0answers
35 views

How do I speed up testing debugging when I am loading a large module as part of my program? [on hold]

I'm using PyScripter to do some python geocoding automation and I'm coming across the situation where I am waiting several tens of seconds for a large module to be imported. This is very inconvenient ...
0
votes
0answers
24 views

First time rasterio error

First of all, I am new to python and rasterio. I am trying to open a simple raster with 5 bands using the rasterio module in python. This is what I am trying to achieve: import rasterio with ...
0
votes
1answer
48 views

QGIS loop/iterator with python in function editor (field calculator)

I am trying to create a loop to rename the fields of my attribute table. The fields should start at 1 and increment by one until the end of the table (e.g. 1,2,3,4,5,...,n) my code on the python ...
0
votes
0answers
30 views

Equivalent to .replace() for integers? [on hold]

I've recently been using the str.replace() method to change field values in string fields. Since this seems to be way faster than calculating field values, i was wondering if there is an equivalent ...
2
votes
2answers
35 views

Is there a size limit when adding features to ArcGIS Server programatically using POST?

I'm inserting new points using the ArcGIS Server REST API addFeatures method - this is working correctly. However, I'm finding that when the JSON reaches a certain (undefined) threshold the POST ...
-1
votes
0answers
18 views

Python Script for seeing if 2 polygons overlap or not [on hold]

I am trying to create a function that would tell me whether two polygons intersect or not with the inputs being the lower left, lower right, upper right, upper left of each polygon. Such as ...
1
vote
2answers
42 views

Recording the ArcPy script execution method

I have composed an ArcPy script which is run via a windows scheduler.The same script is loaded into a script tool so a user can run the process manually. I've used: get parameters as text, with or's ...
1
vote
0answers
17 views

Preparing CliMond data for Maxent

I had been working with BioClim data and that was working in Maxent. I could clip files and realign them etc. Now I have some data from CliMond which is in two formats: Either as text files ...
1
vote
0answers
12 views

Python error in go2streetview plugin

We have the go2streetview plugin installed in QGIS 2.8.6 Wien and when performing a search using this plugin, the following error appeared: An error has occured while executing Python code: ...
3
votes
1answer
63 views

python script for opening webpage directly in qgis

I have a shapefile with points reffering to a webpage with a photograph. Untill now I define an action to open the corresponding webpage in firefox. Eg. I have to share my project. Because I don't ...
0
votes
0answers
17 views

ESRI Hyperlink via VB or python [on hold]

I am using ArcGIS 10.3 I'd like to have a featureclass support a hybrid hyperlink. The first part would be a web address where the only difference among the features is the last 6 characters (which ...
0
votes
0answers
34 views

What geospatial analysis can be done easily in R but not in Python? [on hold]

I'd like to present on the capabilities of R in spatial processing to a crowd more familiar with Python. I'm very familiar with R but no so much with Python. I want to wow them with some processes ...
1
vote
0answers
39 views

Cannot import name QtTest running unittests for QGIS plugin

I have the following imports in my unittest code: from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4 import QtCore, QtGui, QtTest When I run my unit test from the command line I get ...
3
votes
1answer
41 views

Automating Interpolation in QGIS

I have a project in QGIS which involves interpolating several different variables on several different maps, then using the raster calculator to multiply some of the resulting interpolations together. ...
1
vote
1answer
35 views

QGIS Zonal Stats Plugin - Python Console - compute one specific statistic

I think this is more of a syntax problem that I have here. But I am absolutely not able to figure it out. On a different Linux machine I got the following working: zoneStat = QgsZonalStatistics ...
1
vote
1answer
25 views

How to export Mapnik style to XML?

I would like to create Mapnik style using Python API and export it to XML-file. Creating style part is clear enough API has sufficient documentation. But I wasn't able to find function that does the ...
0
votes
0answers
25 views

Error clipping extent of shapefile with boundary box with ogr2ogr from python [on hold]

Trying to clip polygon shapefile with boundary box in ogr2ogr called from python gives error: "FAILURE: Unable to open datasource 'C:\UserData\save.shp' with the following drivers." then lists ...
0
votes
1answer
54 views

QGIS - what is the core database system? [on hold]

What is the core database system used by QGIS? When you launch an existing project that has multiple .shp files (with associated .dbf tables), is the core db system used to convert that data to its ...
4
votes
2answers
52 views

performance problem with PyQGIS: manipulating attributes

I have selected a vector layer with attributes slope and area. I want to combine all the features with slope 0 to 5, 5 to 10, ... , 85 to 90. The original features are to be discarded, and new ...
2
votes
1answer
106 views

How to detect corner of shapefile in python [closed]

Is there any way to detect corner of each shapefile in python !? (not BBox) Or somehow to detect the edges? I want to detect each shapefile vertices to calculate the differences in latitude for my ...
3
votes
0answers
64 views

Select shape file by their coordinates behavior [closed]

I want to filter shapefiles by their latitude behaviour: If the latitudes of edges A and B are constantly decreasing or increasing then this class marked as correct, otherwise are incorrect. For ...
5
votes
2answers
71 views

intersecting two shapefiles from Python or command line

I'm new to working with geo data and trying to address a similar question to the one posted here. Using command line and/or shapely/fiona, in the most efficient and elegant way. I created two ...
4
votes
2answers
90 views

Feature selection of one vector layer based on another vector layer: Any advice for using PostGIS or Python with PostGIS together?

I have a data set (more than 50,000+) of points (addresses) and Polyline (street) shapefiles of the area of interest. The street shapefile contains Annual Daily Traffic (ADT) data of each street for a ...
1
vote
1answer
38 views

Find Feature class into another feature data

I am trying to find the feature classes from one feature data into another feature classes. But I'm getting nothing at the end as a result of the matc statement. The data in the arc environment is ...
0
votes
1answer
37 views

PythEveryone in ArcGIS virtual campus module: Runtime error + namerror

I'm working on the python for everyone lab in Esri's Virtual campus. I'm running into an issue that I can't seem to solve, I've already done some outside research hence posting here! The issue: 4th ...
7
votes
1answer
124 views

ArcGIS Pro and ArcGIS Desktop on same machine

I'm just trying out ArcGIS Pro for the first time and I had to change my PYTHONPATH to python34 ArcGIS Pro is now working without crashing every time I open the Analysis tab... However now when I try ...
2
votes
1answer
97 views

Huge file size after averaging two rasters

After I average two raster files (singleband gray, initial size ~700MB each) through QgsRasterCalculator() with formula "Raster1@1/2 + Raster2@1/2" the size of the resulting file is 2.9GB. Is there ...
2
votes
0answers
34 views

Setting extent with python in QGIS in new project

Situation: I am trying to write a simple python script for QGIS. The script aims to load one layer, zoom to given coordinates, and 'place a pin' there. The coordinates will change every time I run the ...
3
votes
1answer
82 views

Automating QGIS project composer printing?

I have a large project which consists of around 10x QGIS project files. Each project contains a print composer with an atlas set up to generate up to 10 maps. What is the easiest way to automate the ...
0
votes
0answers
46 views

Difference between Data Scientist and Spatial Analyst? [closed]

I'm learning Geography and want to be a GIS Analyst and find the job adverts of Data Scientist very similar just with R instead of Python. And get better paid. What are the differences between the ...
3
votes
1answer
66 views

How can I use GDAL Merge with multiple files in one folder in python 2.7?

I have multiple files in one folder which are called, for example: 049.h11v11.hdf, 049.h11v12.hadf, 049.h11v13.hdf, 065.h11v11.hdf, 065.h12v12.hdf, and so on. The first 3 numbers are the julian day of ...
3
votes
1answer
29 views

Rasterize vector file using gdal.RasterizeLayer() without losing attribute information in python

Is it possible to rasterize a vector file with gdal.RasterizeLayer(), saving attribute as Raster value ? Like gdal_rasterize can do with : gdal_rasterize -a attribute -ts rasterXsize rasterYsize -l ...
1
vote
1answer
26 views

How to determine the appropriate size of a 3 dimesional raster block/chunk

I am processing large MODIS time series (12 years) dataset with an array dimension of 4800 x 4800 with a data type of Int16-Sixteen bit signed integer. I want to build a 3 dimensional array ...
3
votes
2answers
70 views

Trying to use LIKE in an expression in pyQgis

I want to select elements from a layer. The field I use is a string/character field. My code is as follows: expr = QgsExpression(ur'"myField" = \'valueILookFor\'') it = ...
7
votes
1answer
95 views
+100

Mapnik failing through a webstack

I've inherited a pretty large / complex (internal) web portal (run under python 2.6.6), which has some mapping capabilities, using Mapnik 2.2.0. The web service has recently started throwing 500 ...
2
votes
1answer
41 views

Why is QgsFeatureIterator returning bad data?

This is a spin-off of another question I asked previously, but it has grown in scope and deserves its own thread. While iterating over a vector layer (shapefile) I included the following ...
1
vote
0answers
34 views

Arcpy 64 bit, or multiple Python installs? [duplicate]

I am new to Python, and am trying to write a script that would upload a geodatabase to AGOL at a scheduled interval. However, the 32 bit distribution of Python cannot handle the file size (over 1 MB), ...