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

learn more… | top users | synonyms

0
votes
1answer
12 views

NOAA API data for past monthly mean Temperature and precipitation

I am trying to use the NOAA API to get data on monthly mean temperature and precipitation for the past 10 years. I wrote the following python code (the variable "token" in the code is the API token ...
0
votes
0answers
5 views

ImportError: No module named mapnik on CentOS 7

The problem: I've installed mapnik 3.0.1 successfully by running the typical source code install: ./configure make && make install ldconfig -v However.... When I import mapnik into ...
0
votes
0answers
10 views

python script for splitting a polygon feature into equal parts

Is there a python script for splitting a polygon feature into equal parts in arcgis 10.1 . I know arcgis 10.3 has a segmentalongline function but I m looking for Arcgis 10.1 functionality. THis is ...
1
vote
1answer
27 views

How can I import shapefile in python?

How can I import a shapefile in python? from PyQt4.QtCore import QSettings, QTranslator, qVersion, QCoreApplication from PyQt4.QtGui import QAction, QIcon, QFileDialog # Initialize Qt resources from ...
0
votes
1answer
20 views

TypeError: unsupported operand type(s) for *: 'float' and 'geoprocessing Layer object'

I am getting a rather unclear type error, and after searching online I cannot find any solutions that help. I am trying to create my own python toolbox for wifi router signal loss, and I am trying to ...
2
votes
1answer
34 views

How to find if map layer registry is empty?

In my script I want to open layer named my_layer if it is in the map layer registry. I use following code for it: inputLayer = QgsMapLayerRegistry.instance().mapLayersByName("my_layer")[0] If not ...
3
votes
0answers
38 views

How to access a deleted features attributes (before committing)

I have a signal setup for a feature deletion event on a layer: self.layer.featureDeleted.connect(self.feature_deleted) When I try and grab an attribute from the deleted feature on the slot, a ...
1
vote
2answers
48 views

Polygons in one layer have different attributes

Is it possible in PyQGIS to have in one layer more polygons and some would have one set of attributes and another different? E.g. Polygon_1(name, size, average_age), Polygon_2(name, size, ...
1
vote
1answer
25 views

How can I check in QGIS python if an atrribute is included in my layer?

I use the following code: for field in self.layer.pendingFields(): if field.name()=='elevation': do this else: do that Although there is an elevation attribute in my layer ...
3
votes
0answers
20 views

How to run a tool from Whitebox GAT in ArcGIS?

I have a series of tools that I need to run in ArcGIS to hydrologically condition my DEM, but the first step in this process is running the Breach Depressions tool from Whitebox GAT (I have found that ...
1
vote
0answers
14 views

how to make rectangle selection by mouse on my map(world shape file) in qgis in python

I want to make a rectangle selection using the mouse on my map (world shape file) in qgis in python and extract the lat lon of the selection area but I don't understand how to do it. I don't have any ...
1
vote
1answer
15 views

How to read non-spatial data using PyQgis?

I'm generating maps with QGis. What I do is generate a bunch of non-spatial data on a set of cities (using VBA), and still using VBA, generate a python code that will automaticaly output general map ...
1
vote
0answers
21 views

How to accelerate my python looping process for A-star path finding on DEM surface?

I try to make an A-star Path Finding program base on tile-graph (image raster data as graph) where each pixel values represent as cost and elevation.. In my case, DEM raster data was called by using ...
0
votes
0answers
28 views

How to Access tables and feature classes stored in Dropbox using Python

I stored some tables and shapefiles in by academic Dropbox account. I am trying to write the code block that will set the directory path to the featureclasses in Dropbox to a variable that can be ...
-1
votes
2answers
46 views

Accessing Point Cloud Data [on hold]

I have a point cloud dataset, and I am trying to divide it up into sections of point cloud data (in a grid-like manner). Essentially, I will have little cubes of point cloud data, possibly by given ...
1
vote
0answers
27 views

Ways to reduce buffer if it passes through a certain layer

I am trying to do WiFi analysis on signal strength in ArcGIS Desktop, and one of the big problems that I am running into is how to reduce the signal when it comes in contact with a wall, as it does in ...
-2
votes
0answers
46 views

Why would this script only load 14 out of ~13,000 feature classes to the topology?

The following script adds ~13,000 feature classes in a gdb into an existing topology. If I want to add rules to said topology, would I write a second script or include it within this script below? ...
2
votes
1answer
22 views

How to create a new empty memory layer with fields scheme from other layer in QGIS?

Being a complete noob with python so far, I got inspired by this answer: http://gis.stackexchange.com/a/155988/8202 to dive into it a bit. When creating features in a new target layer from an ...
0
votes
0answers
15 views

How can I connect MYSQL database in python for QGIS desktop Application?

I am following below process. 1 - Setting You must install a MySQL driver before doing anything. Unlike PHP, only the SQLite driver is installed by default with Python. The most used package to do ...
0
votes
0answers
25 views

How to build a raster populated with an equation in a python toolbox?

I am working on creating a python toolbox to solve for WiFi signal properties based on various inputs, and for the end result I would like to have the output in the form of a raster. I need this ...
0
votes
0answers
23 views

Installing GDAL Python bindings on Windows [duplicate]

This has been addressed before (How to install GDAL with Python on windows?), but I wanted to bring the question up again, to see if anybody has come up with a better method in the last 5 years, and ...
1
vote
0answers
9 views

Can't get the web OpenLayers plugins to work because of 'python error' on my mac

I'm trying to get a relatively small section of Google satellite/ Google earth as a layer on Qgis on my mac. When I go to 'web' and the 'open layers' plugin it just comes up with python error. I've ...
0
votes
1answer
32 views

Convert multi KML and KMZ into shapefile using ArcPy?

I try to convert with arcpy (python 2.7.8) 50 KML and KMZ files, that i downloaded from google earth into shapefiles. All files located in many sub-Folders. All Sub Folders are located in one large ...
0
votes
0answers
49 views

Python version issue

I am using arcgis 10.1 and running this script on python version 2.7.2. # Import standard library modules import arcpy, os, sys from arcpy import env # Allow for file overwrite ...
0
votes
0answers
33 views

ZeroDivisionError

I was conducting Mean Coodinates process functions with weighted fields when I began faces ZeroDivision errors in some processes. The Shapefile Data has been joined together with imported Spreadsheet ...
1
vote
1answer
50 views

QStringList() error in plugin of QGIS 2.10

I have made a Dialog in PyQt for use it like a plugin under QGIS 2.10 The Dialog works fine like a standalone application, but if I try to call it like a QGIS plugin, I get this error: ...
4
votes
2answers
44 views

how to create geo-referenced random data?

I'm writing a dissertation on different parameter settings in GWR . In order to perform tests I'd need the availability of geo-referenced data that show some sort of spiatial correlation (i.e. values ...
0
votes
1answer
16 views

Multiply a stack of floating point rasters( composite raster ) with a constant

I am trying to multiply a floating point stack of rasters (10 layers) with a constant and round up to the next integer. I have the formula RoundUp(10*composite_raster) in raster calculator, but for ...
0
votes
1answer
26 views

map(arcpy.AddError, traceback.format_exc().split(“\n”))

What does this expression mean? I see this in many python scripts. try: ... except Exception as e: import traceback map(arcpy.AddError, traceback.format_exc().split("\n")) ...
1
vote
1answer
27 views

Python tools won't open when clicked on

I am creating a python toolbox within ArcGIS 10.3 and I am having issues opening it up in ArcMap. I have been editing it, saving it, and running it within ArcMap this whole time to test it little by ...
1
vote
1answer
38 views

How to calculate zonal statistics from multi-band raster for each polygon using python?

I want to calculate the zonal statastics from multi band raster for a polygon layer. When I am using this snippet of code: vectorlayer=qgis.utils.iface.mapCanvas().layer(0) rasterfile = ...
1
vote
0answers
25 views

QGIS - Custom Icon to Show my Tool is Running?

I am running QGIS 2.6.1 (Brighton) I've some developers that have made some custom plug-ins, but our testers are complaining that they cannot tell when, if or what tool / plug-in is running. Is there ...
0
votes
0answers
23 views

Spatial segregation from a raster of racial distribution in the USA

I am trying to measure the degree of racial segregation at some geographic level (let's say the county level, for simplicity) in the USA. I have a shapefile with these geographic units. To do so, ...
1
vote
1answer
30 views

Copying attributes from point layer to memory linestring layer PYQGIS

I've stacked a little bit with copying attributes. I have a Point Layer created from .csv file. For each feature in this layer, I'm creating a new Polyline geometry in memory layer. Cannot add ...
2
votes
0answers
32 views

Multiple layer intersection

I am trying to find a way with qgis/python to get the intersection area of more than 2 layers. All the tools in Qgis take just the 2 input layers. ='( For example in the image below, I have 4 ...
0
votes
2answers
31 views

How many percentage of sea area is covered with points?

I have a large number of lat/long positions at sea for a geographical area (stored as CSV). This geographical area also contains lots of land area. I want to divide the sea area into a grid (f.ex down ...
1
vote
0answers
38 views

Switching between python versions for Arcpy [duplicate]

I’m developing a multi-module project in Python. I’m new to GIS and my boss doesn’t have a strong technical background. I’ve been instructed to use the Arcpy module to do functions such as intersect. ...
0
votes
2answers
69 views

Using Python to field calculate Lat/Long with decimal degrees rather than meters

The below is a snippet of a python script that I am writing that basically adds two fields - Latitude and Longitude, then calculates them. I could use the Add XY Tool which gets me to the same point. ...
1
vote
0answers
10 views

Can't import liblas into OSGeo4w Python on Windows machine

I installed the 32-bit version of OSGeo4w with the liblas-python packages on my Windows machine. When I try to import liblas into python, I get an error that no 'liblas' module can be found, even ...
4
votes
1answer
55 views

Difference in destination location between pyproj and geopy

I am looking at ways to calculate (in Python) the destination location from a point given bearing and range. Based on the results comparison from the 2 libraries in subject(geopy and pyproj), I ...
0
votes
0answers
45 views

Code converting lat/long coordinates (WKT) to polygon (shapefile) not working

I am having a problem converting WKT to shapefile. I have a csv file consisting of three columns: ID, Name (of the area) and WKT comprising set of lat/long coordinates of area boundaries. For example, ...
0
votes
1answer
55 views

Determine start/end points for line slope calculation [duplicate]

This is a follow up question based off of this question. I have a line feature class representing storm drains and a point feature class representing where storm drains are connected. The point ...
0
votes
0answers
21 views

How can i upload two CSV file in QGIS Desktop App?

If I am using single file upload code it will work fine. self.dlg.lineEdit.clear() self.dlg.pushButton.clicked.connect(self.select_output_file) But I want to add more than one files it will give me ...
2
votes
0answers
32 views

Cul-de-sac (curve) turns generation in flow for parallel lines using ArcGIS for Desktop?

I'm using ArcMap 10.2 and I need to generate a parallel lines within the polygon and connect them one to other with the curve, with the proper radius and return radius (the same as cul-de-sac tool ...
1
vote
0answers
22 views

How accurate i pythons is_land? Alternatives?

I was planning to use Pythons is_land function, to differentiate between land and sea. However, after some inspection, I have major concerns in the accuracy. I cant find anything about this in the ...
1
vote
1answer
40 views

FeatureToPolygon (to cut polygons by line) not working correctly outside of ArcGIS

I asked a question yesterday, about splitting polygons using a line, and I ended up using the approach that is described in the comments here. Although this worked with my test data, it causes a lot ...
0
votes
0answers
42 views

SAGA version with QGIS 2.10

I want to know which version of SAGA is used with QGIS 2.10. I developed a standalone application which uses QGIS inside. I have problems using SAGA algorithms. SAGA is well installed but I found that ...
0
votes
1answer
28 views

Interpreting if statement in Python code? [closed]

Please help me to understand the IF statement in the following code. I got it from some samples. citybuffer = arcpy.GetParameterAsText(1) if citybuffer == '#' or not citybuffer: citybuffer = ...
1
vote
0answers
10 views

Using arcgisimage along with python basemap

I am utilizing maps provided through the ArcGIS rest service when i plot information in Python, but have some problems understanding the different options I have when I request I map. The ...
0
votes
1answer
21 views

Using ST_LINE_INTERPOLATE_POINT in OGR and python

I'm interested in finding the midpoint on a linestring using OGR and python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in python using the ExecuteSQL() method? ...