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

learn more… | top users | synonyms

2
votes
2answers
59 views

If/else statement in arcgis

I try to fill the fields with the condition if / else but it does not work. I do not know where is my mistake in the code. def TextValue ( !Classe! ): if !Classe! == "Steppe arbustive" or !Classe! ...
1
vote
0answers
17 views

ArcGIS python add in to call python script for importing mdb data

im trying to change from a .net toolbar to a python toolbar in ArcGIS 10.2 and am having some difficulty. I have some stand alone python script which i know works and does what i need to do but i ...
1
vote
2answers
49 views

How to show variable values in message bar in QGIS?

I know that I can write custom text to message bar with the QgsMessageBar.pushMessage() method. But if I understand the documentation right, there's no room for variables added to a string where they ...
0
votes
0answers
7 views

Element retrieval in owl file format using python

I just created my ontology file for semantic relation using protege.My ontology file is in the foram of owl.I need to compare two relations doamin and range.But i dont know how to do it.
1
vote
1answer
14 views

How to register a broadcast on QGIS to start my plugin on start after loading plugins

I want to perform a default task when user opens QGIS but here I am building it as a python plugin so I want a signal or broadcast to call my plugin. I didn't build QGIS from source my plugin should ...
1
vote
0answers
26 views

Multiprocessing in python qgis?

When i try to do mutliprocessing in python Qgis it doesn't work from multiprocessing import Process,Lock import multiprocessing def name1(l,i): print i if __name__=='__main__': lock=Lock() ...
0
votes
0answers
15 views

show polygon from database in browser in geodjango

I tried to retrieve the polygon which I saved into postgis database. (all polygons) Here is my code: models.py from django.contrib.gis.db import models class MyMap(models.Model): name = ...
0
votes
0answers
13 views

how to rotate a symbol

I am working in c++/python/QT 4.5 with the api qgis 2.8.2 My application receive data from a communication port that indicate the change of position of an object diplayed on the map and represented ...
0
votes
0answers
9 views

Getting netCDF data into PostGIS database using Python?

I can read the netCDF file data with netCDF-python or with gdalinfo, but I am unsure of the easiest way to get it into a PostGIS database. It would be really easy if I could convert the netCDF file ...
1
vote
1answer
21 views

How do I batch input alias names from a table for a large dataset in ArcMap or ArcCatalog?

I would like to populate the alias names for the fields in the ACS 2014 5 year estimates file geodatabase (all 11439 of them). The ACS fgdb comes with the short_name and long_name in the metadata ...
0
votes
0answers
5 views

What is the default mosaic_method value for MakeMosaicLayer_management?

What is the default mosaic_method for MakeMosaicLayer_management (see help here)? Usually, the docs say This is the default after the default value. And that is usually first option listed. Is the ...
-5
votes
0answers
29 views

Drawing polygon on PDF in Python? [on hold]

How can I draw a polygon on PDF in python? I am using http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/ for making PDF file.
1
vote
1answer
48 views

Python script to copy first row of certain attributes and paste in the newly digitised rows the copied features

Starting from this question, I need a script to be insterted in the processing graphical modeler that can copy some attributes from the first digitised row in all the newly digitised lines of a ...
2
votes
2answers
30 views

Store in a python list the attribute table of a vector in QGIS

I'm stuck with a very simple issue.. I've loaded in QGIS (through the py console) a csv layer (no geometry) made of 4 fields and 3 rows: #load the csv layer = QgsVectorLayer("path/to/the/csv", ...
3
votes
5answers
67 views

Is there any simple integration for counting points in polygon using python qgis?

Is there any simple integration for calculating count of points in polygon using QGIS-Python integration? In other words, are there any pre-defined functions for points in polygon of QGIS using ...
2
votes
0answers
40 views

Converting large rasters to NumPy

I have a geodatabase that contains a large number of raster datasets - there are two rasters for each country in the world, and they are very large, in some cases up to 3GB per raster dataset. I ...
0
votes
1answer
25 views

arcpy.da.SearchCursor, cannot read preceding zeros from csv

I'm using arcpy.da.SearchCursor to read a csv that has a column with preceding zeros, e.g.: myCSVColumn 0124578 12598 04589 012568 ... When using the arcpy.da.SearchCursor it returns the value w/o ...
2
votes
0answers
60 views

Can we create buffer analysis using python in qgis?

Can we create a buffer of distance 0.004 using python in qgis. I tried this link, but it isn't working for python in qgis 2.10.1-Pisa. The above is the diagram of buffer I am asking. It's located ...
2
votes
0answers
18 views

Using Spyder IDE to develop python for Grass GIS, get 'ImportError: No module named grass.script'

I am trying to use Spyder IDE to develop a python script using python library from grass-6.4.3. I run the script below, and get 'ImportError: No module named grass.script' I am using python 2.7, ...
2
votes
1answer
81 views

Creating subfolders in ArcPy's 'in_memory'

Is there a way to create a subfolder in memory in ArcPy? For example, instead of temporarily saving a dataset under: r'in_memory/bufferOne' I would like to save it under: ...
5
votes
1answer
87 views

How to exit QGIS after running a python script?

I would like to run a python script via qgis --code myscript.py and then immediately exit. I'm using iface.actionExit().trigger(), which kills QGIS when I run it from the python console, but not when ...
1
vote
1answer
21 views

Unable to update some of the attributes using PyQGIS

I'm trying to create new attribute and populate it, but for unknown reason some of the features does not update while others are updated normally. # scores - list of values which length is equal to ...
0
votes
0answers
17 views

Out of Memory and TIN internal processing error ArcGIS

So i have been developing a python script to streamline the process from converting a raw XYZ file to a full blown terrain file. However, in the intermediate process, I am performing a surface ...
1
vote
2answers
32 views

Python Installation and accessing Arcpy Libraries without ArcGIS Setup Installer?

As part of developing scripts and to save the other services/resources accessed by ArcGIS, is there a way or separate installer to install Python and ArcPy libraries alone without installing ArcMap?
0
votes
0answers
19 views

Dissolving a TIN using python/ogr binding

I have a TIN model where I remove some of the triangles (see fig. 1). Most of the triangles touch on one edge, some on one vertice. I would now like to generate a polygon shapefile containing the ...
1
vote
1answer
28 views

How to use “context” in rasterio?

Another rasterio follow-up question, after questions on reading and writing rasters. I've successfully made and reprojected an output layer, but while trying to use the overview module to build ...
0
votes
0answers
30 views

Error's while retrieving data from postgres to Qgis using python?

This is my code of python in qgis from qgis documentation docs uri = QgsDataSourceURI() uri.setConnection("localhost","5432","gis_data","postgres","vajja") ...
0
votes
2answers
38 views

Simplifying Ways in OpenStreetMap Data

Is there a (current) best practice to simplify ways? I have found: https://github.com/podolsir/osmosis-simplifyways But besides not being alive, here ...
0
votes
0answers
22 views

Landsat images from same path/row have different shapes

I'm starting to play with satellite imagery. In particular, I am using images of the Landsat 7 and Python. I open two TIF images of the same place but at different times to the numpy arrays and they ...
3
votes
1answer
58 views

Find shortest path between points avoiding shapefile?

I am an intermediate python developer with very limited GIS experience. I have a list of latitude/longitudes of a ship at sea. I need to join them into a polyline using the shortest distance between ...
0
votes
0answers
23 views

Unexpected No values when reading grib2 file with gdal [closed]

I am trying to read this .grib2 file using gdal. Here's the code I use in Python: from osgeo import gdal from osgeo.gdalconst import GA_ReadOnly fname = 'ten_meter_20150816_00z_01.grib' dataset = ...
1
vote
0answers
22 views

Creating Origin Destination Matrix from Station Locations

I am attempting to create an origin destination matrix in python for all of the London Underground Stations. I have the station name and the lat, lng of its location. It is in the following csv format ...
1
vote
1answer
38 views

Segmentation fault while writing an output raster by blocks with rasterio

With the answer on my previous question, I was able to set up reading a raster by blocks. I did some computation and now I try to write the result into another raster. However, the program fails with ...
1
vote
0answers
15 views

Rendering problem in qgis

I have fetch data from database and draw it on qgis 2.8 as vector layer it works fine with limited data but for large data it will not work and goes into not responding stage, I am unable to ...
2
votes
1answer
37 views

I tried to run QGIS using python but I couldn't get any output on screen?

uri ="C:/Users/rajagopalv/Desktop/poi_sunnyvale.csvdelimiter=%s&xField=%s&yField=%s" % ("|", "x", "y") vlayer = QgsVectorLayer(uri, "address_sunny", "delimitedtext") ...
1
vote
1answer
20 views

Is it possible to publish a geoprocessing services that uses another dll?

I have a functional model (Note: not something from ArcGIS Model Builder) that is distributed as a compiled dll that I want to access via ArcGIS. Right now I am writing python wrappers to ...
2
votes
1answer
61 views

How to add loading bar in QGIS Plugin development?

Every time i use tool or plugin in QuantumGIS, i saw a kind of bar like this for indicating loading progress : The different between that bar and Progress Bar is that progress bar will increase ...
0
votes
2answers
52 views

Calculate and Restart Sequential ID for Unique Values in a Field

I need to calculate a sequential ID for unique values in a field. So, for the values in Field1, the sequential ID count should count all occurrences of that value, then restart the count for the next ...
1
vote
2answers
67 views

Python and QGIS multiprocessing documentation?

Where can we find better documention for python QGIS multiprocessing. Especially regarding the multiprocessing of python and QGIS.
0
votes
2answers
57 views

Merging XYZ's in ArcGIS Desktop?

I have like 6 .xyz files that are to be included in a single map (they sort of overlap). However, I'd like to save time and automatically merge them together through python code into one .XYZ before ...
3
votes
1answer
49 views

Standard user interface for QGIS plugins

QGIS plugins found in "processing" all have the same user interface. In particular, to open a file, the selector either show the list of already downloaded files, or have a "..." button to browse and ...
0
votes
0answers
25 views

Converting csv files into shapefiles using python [duplicate]

I have a csv file which i want to convert in a shapefile. i have seen many questions being asked on this topic but the main problem is all the polygons were of the same size but in this csv file the ...
1
vote
1answer
40 views

I am using “Hindi and Gujrati” font then I am getting “Black Squre Dots”?

At the time of generating PDF file when I am using “Hindi and Gujrati” font then I am getting “Black Squre Dots”. Below I am using code. Here I am trying to convert in UTF-8 but it’s not converting. ...
2
votes
1answer
135 views

Is it possible to read raster files by block with rasterio?

I find rasterio much easier to use that plain ogr/gdal, so I'd prefer using it. However, I need to process large rasters, so reading rasters by block as explained in the Python GDAL course is ...
1
vote
1answer
63 views

-9999 (no data value) becomes 0 when writing array to GDAL memory file

I am trying to reproject and resample (1000m ->> 30m) a raster image (shape 238X406) using gdal.ReprojectImage() function in Python. The input file has -9999 cells as no data value. The result is an ...
1
vote
3answers
91 views

How to copy entire fields into a python list

I'am trying to find a way to copy entire fields(columns) in a feature class attribute table as lists inside a master list (python). To illustrate it, consider the table below: So the list should ...
0
votes
0answers
23 views

How do I set up a PostgreSQL database for use with PostGIS and GeoDjango?

The Django docs say to use createdb -T template_postgis geodjango but I already have a database set up. While trying to find out what this actually does and a way to apply it to an existing ...
0
votes
0answers
13 views

Solving OD Cost Matrix gets slower and slower in the iteration process

I have 7000 points, and for each point I want to create a OD cost matrix of that point to all other points and write the result in separate tables - that is 7000 tables with 6999 records each. ...
1
vote
0answers
52 views

How to integrate QT User Interface with QGIS Python Plugin?

I created a very simple python program using GDAL to calculate the summary and reduction between two raster value like this : import os from osgeo import ogr, gdal from gdalconst import * ...
6
votes
1answer
136 views

Extracting the pixelwise proportion of classes of a finer raster in a coarser one

I have two rasters, one has a 1 km resolution. The other has a spatial resolution of 30 m. This latter pixelwise is a classification. I want to overlay the 1 km raster on the classification raster and ...