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

learn more… | top users | synonyms

0
votes
2answers
16 views

Is there a script to Python for Click to toggle selectable?

I cannot write a script using ArcPy (Click to toggle selectable). To make a layer unavailable for sampling! I just need to create a tool to automate several processes, one of them is the ability to ...
1
vote
0answers
15 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 long of the selection area but I don't understand how to do it. and don't ...
2
votes
1answer
173 views

Python Error while installing Cartogram

I am quite new to GIS and qGIS especially. I would like to install cfarmers cartogram plugin. From what I understand, this has to be done manually - so I 've followed the instructions from ...
1
vote
0answers
18 views

Creating new empty vector layer that has same set of atributes as another layer and then copying subset of features into it?

I am new to both Python and QGIS. Here's a sample of my code: unique = layer.uniqueValues(index) attributes = layer..dataProvider().fields().toList() assistant_layer = QgsVectorLayer("Point", ...
0
votes
0answers
12 views

Finding common segments in Shapely LineStrings

I have two identically-sized collections of Shapely LineStrings, representing two sets of routes from a common origin to a set of common destinations. For each "pair" of routes (i.e. set_a[0], ...
0
votes
2answers
37 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
15 views

gdalwarp, pyproj and gdal-osr have different transformation output

I would like to transform Landsat 8 scenes from the native UTM to the official Hungarian spatial reference system. My problem is that pyproj.transform and osr.CoordinateTransformation have the same ...
11
votes
5answers
2k views

how can i convert a shapefile to lat and lon boundaries?

i have a shapefile of country subdivisions and i would like to extract an array of bounding lat and lon for each division.. is it possible to do?
0
votes
0answers
8 views

GRASS7. Parallel import shapefiles failed

I am trying to import a 8 ShapeFile to GRASS V7.0.0. Each shapefile's size is between 80 Mb and 300 Mb. For this purpose, I've used multiprocessing in python. I run 4 parallel processes, each one ...
4
votes
1answer
460 views

Configuring spatialite database access for Python 2.6.6

I'm working on a GIS project, and I would like to implement and test some geo-spatial algorithms in Python. For this purpose, I will not only need sqlite, but also spatialite, in order to store and ...
1
vote
1answer
77 views

Identifying Left and Right Mouse Button Clicks in PyQgis application

I am relatively new to PyQt. I am trying create a custom plugin for Qgis which enables the user to select some features by drawing polygon on the canvas using mouse clicks and then performs ...
2
votes
2answers
54 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 ...
1
vote
1answer
968 views

Converting MapInfo (MapBasic) Script into ArcPy?

I have a MapBasic script that divides an irregular polygon into smaller polygons of 1 hectare each. Would anyone help me to convert the following into an ArcPy script. ' This program requires an ...
0
votes
2answers
175 views

geotiff conversion to coordinate system with gdal

I would like to get the coordinates X Y Z from a geotiff file. I am using the gdal translate for the conversion. Which output format is the more adequate for containing a 3 numpay array X Y Z ?
0
votes
1answer
823 views

OSRM API - nearest point fed into routing

I am using the OSRM API to (1) determine the nearest point on a road segment from a give random point with http://server:5000/nearest?loc=_lat_,_lon_ The returned coordinates are used then as an ...
0
votes
0answers
14 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 ...
3
votes
0answers
51 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
1answer
142 views

Import shapefiles into PostGIS using Python with psycopg2

I want to import shapefiles to PostGIS using Python with arcpy & psycopg2 to connect to PostGIS. I don't want to use the existing shapefile loader nor ogr, just write my own import tool. My steps ...
0
votes
0answers
15 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
70 views

How to get the signal when the color changes in pyQGIS?

I would like to have the signal when the color of a vector layer is changed by the user. In the doc, there is a signal that seems to fit ...
3
votes
1answer
197 views

ArcGis Python Security Concerns

I’m working for a large organization which are using ArcGis Desktop on some (windows) clients. The security requirements for the system is very strict, and a part of that is prohibiting the users the ...
0
votes
1answer
38 views

GDAL Python and postgis raster?

I'd like to create a postgis raster using GDAL and python. I can get the driver easily: drv = gdal.GetDriverByName("PostGISRaster") But how can I create a new raster table? I can't find any ...
1
vote
2answers
49 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, ...
2
votes
3answers
2k views

Python: How to create a Polygon Shapefile from a list of X,Y coordinates?

I have a list of X,Y coordinates from a csv file, that represent a polygon. I´m trying to create a Polygon-Shapefile from this list. I´ve been trying around and found a possbility to write the list to ...
0
votes
1answer
23 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
36 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 ...
0
votes
0answers
36 views

Problems using da.UpdateCursor in python Add_in to Edit Feature Class

I am currently attempting to create a Python Add_in tool which will perform a set of geoprocessing operations resulting in new values for a specific !shape.area!acres calculation on a new layer and ...
2
votes
1answer
354 views

How to begin with tool development for GRASS gis or QGIS GRASS

I wanted to begin with customized tool development in Grass GIS or QGIS grass. How should i begin in to develop the tool. I search a lot in google search engine for begin with tool development in ...
22
votes
10answers
8k views

How do I develop my GIS programming skills?

I would like to develop my GIS programming skills, where do I start? People say learn C++ or Python but where can I learn this in a geographic context? Tutorials or anything would be very helpful, as ...
2
votes
1answer
620 views

Converting Tab to Shp Using OGR2OGR with Python on linux

First i downloaded http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and i am importing this. How can i get ogr2ogr to run in my script? nothing seems to be working and i not sure ...
5
votes
5answers
596 views

How to create a label formatted like “ 1,000' ” from a numeric field?

This question builds on a previous question I came across at gis.stackexchange: How to easily edit attribute data using Regular Expressions? Perhaps someone can point me in the right direction? I ...
3
votes
0answers
24 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
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 ...
2
votes
2answers
3k views

How to access attribute data type in QGIS?

I've been developing a plugin on QGIS platform using PyQGIS. So far plugin does the following: You can select any feature of the already loaded vector layer in QGIS. After selection, plugin displays ...
-2
votes
0answers
47 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? ...
5
votes
3answers
3k views

Python: Combine multiple Shapefiles

i have got a lot of Point-Shapefiles (r20010101.shp, r20010202.shp, r20020101.shp...). Each of them has the same amount of points at exactly the same location. In a column that is named after the Date ...
0
votes
2answers
188 views

Connecting to Oracle database on a network in python

There is lots of information out there on how to do this, unfortunately, it all looks like Greek to me. I need a connection to a DB so I can add and use tables and featureclasses contained within ...
1
vote
1answer
16 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 ...
-1
votes
1answer
76 views

Is it possible to import/run AML script into GRASS?

I have an AML script that has instructions to import tmp files of (grid, network, basin...) is there any way to run the script in GRASS? I tried to converted to Python but I couldn't do it for the ...
0
votes
1answer
696 views

How to run an AML in Python?

I am trying to run an AML in a python program I am writing and haven't been having much luck figuring out the correct way to run the AML. The AML requires ArcInfo Workstation to be from the GRID ...
1
vote
2answers
187 views

AML routines and python

I´m trying to use some AML files in ArcMap 10, but I have noticed that this option is not available for this version. Does anyone know or tried to "translate" the aml sequences to another language ...
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
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 ...
-1
votes
2answers
49 views

Accessing Point Cloud Data [closed]

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 ...
2
votes
1answer
24 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 ...
1
vote
0answers
29 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 ...
0
votes
0answers
16 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 ...
43
votes
11answers
34k views

How to install GDAL with Python on windows?

Can anyone please explain to me in step by step instructions how to install GDAL/OGR with Python on Windows. I have Windows Vista and I have tried following the information on the website and it does ...
4
votes
1answer
56 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 ...