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

learn more… | top users | synonyms

0
votes
0answers
6 views

Extracting GDB files from zips - If exist, rename and move: If not, just move. Python [migrated]

Currently trying to develop a catch all script that when pointed to a folder it will look through all of the subfolders and anything that is a .gdb will be moved to a new folder, if the GDB files have ...
1
vote
1answer
26 views

Calculate Field throws an error when parsing python with backslashes

I have an FTP I need to access through a python script. It works fine with forward slashes, but I don't need it to be read as an html. Below are both sets of code: Working: ...
2
votes
0answers
8 views

Stacking Vector Layers in TileStache

I am serving several vector tile layers of different geometries (point, line & polygon) in TileStache using VecTiles:Provider, with this cfgfile: { "cache": { "name": "DISK", ...
1
vote
1answer
51 views

Can't write decimal data into shape (shp) attribute table with Python

I am trying to create a shapefile with Python GDAL/OGR library. I add to it a real number field, but when I write into it doesn't appear as it should but rounded. I will explain better with the code: ...
1
vote
1answer
44 views

Moving file geodatabases in python without ArcPy

Please find my script below currently all i'm wanting to do is iterate through a folder and any subfolders extracting anything that is a .gdb directory + its contents to a new folder. import shutil, ...
0
votes
0answers
43 views

Reading shapefile directory in Python?

I am developing tool on ArcGIS ArcMap 10.0 with .NET and Python technology. In TOPOTORASTER tool , I give a line feature class. the line feature class path something like this: inputOne = ...
2
votes
1answer
25 views

Importing Several Raster Layers, Doing Manipulations and Exporting The Newly Saved Rasters

I have the following code: src_ds = gdal.Open("/home/usr/Desktop/RasterFolder/Name.tif") if src_ds is None: print 'Unable to open %s' % src_filename sys.exit(1) myarray = ...
-1
votes
0answers
11 views

analysing height data using dem [duplicate]

i ran the following code on python 2.7: import sys, struct from osgeo import gdal from osgeo import gdalconst minLat = -48 maxLat = -33 minLong = 165 maxLong = 179 dataset = ...
0
votes
1answer
34 views

Analyze height data using a digital elevation map

i ran the following code on python 2.7: import sys, struct from osgeo import gdal from osgeo import gdalconst minLat = -48 maxLat = -33 minLong = 165 maxLong = 179 dataset = ...
2
votes
1answer
26 views

Lookup Projection Name from EPSG with pyproj

Is it possible to programmatically lookup a projection's name (e.g. Albers Equal-Area) from its EPSG using pyproj? I see pyproj.pj_list, but it does not contain a mapping to the EPSG. Thanks.
2
votes
0answers
9 views

Qt TextLineEdit: Retrieve string instead of QString [migrated]

I am using Qt and want to get string from text field. I found below solution but it returns a QString. I just want to avoid writing extra code to extract string further. Can anyone suggest a simple ...
0
votes
0answers
29 views

Convert WGS84 coordinates to ECEF Cartasian (XYZ) coordinates using pyproj

I need to convert WGS84 to ECEF to map some points to a 3D sphere. I've trawled through the pyproj docs, but can't find specifics on the matter. Basically I want to input the WGS84 GPS lon/lat ...
0
votes
0answers
26 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 ...
0
votes
0answers
41 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
1answer
15 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 = ...
4
votes
1answer
38 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
32 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
1answer
19 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
54 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
29 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
41 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
1answer
24 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
39 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
51 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
31 views

Equivalent to .replace() for integers? [closed]

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
36 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 [closed]

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
19 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
64 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
19 views

ESRI Hyperlink via VB or python [closed]

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
36 views

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

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
40 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
44 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
37 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
26 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
26 views

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

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? [closed]

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
54 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
74 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
91 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
41 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
128 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 ...