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

learn more… | top users | synonyms

1
vote
0answers
6 views

Gdal_calc works but I get a pyhon error at the end of each process

I have a problem while using gdal_calc by a .bat file. Here is the code : call "C:\OSGeo4w64\bin\o4w_env.bat" gdal_calc ...
0
votes
0answers
21 views

how to calculate the distance between two points using python

I want to calculate the distance among different points along a given road line using python script instead of Network analyst. Who can help me out?
0
votes
0answers
5 views

mbutil export of mbtiles png files are all corrupt

I have an mbtiles file that I created with MapBox studio from a GeoTIFF source, and when trying to export the mbtiles with mbutil, all the images are corrupt, no matter if I try png or jpg. Has ...
0
votes
1answer
44 views

Combine multiple shapefiles python

I'm pretty new to working with shapesfiles. I'm trying to create a spatial index of addresses in NYC. I completed it using an rtree but have only done it for Manhattan. To complete the other counties ...
0
votes
0answers
19 views

Printing functionality OpenLayers 3 and MapServer [on hold]

Someone explored the existing solutions to print a map with OpenLayers 3 using MapServer. I saw the print function of this web mapping http://map.geo.admin.ch it's really interesting. Is there any ...
1
vote
0answers
11 views

Setting up PyCharm CE 4 to work with PyQGIS library in Mac OS

I am trying to set up pycharm to work with pyQgis library but with not success till now. I am using PyCharm CE v4 and QGIS version 2.8 I have tried to implemnte the instructions of several posts like ...
9
votes
3answers
395 views

Is it possible to look at the contents of Shapefile using Python without an ArcMap license?

I wondered if it is possible to look at the contents of a shapefile using Python without having and ArcMap license. The situation is that you can create shapefiles from many different applications, ...
-4
votes
1answer
55 views

Copy\ Paste folders and subfolders with python [duplicate]

continuously to How to copy a fgdb using Python? , i work with arcview 10.3 and ptyhon 2.7.8. I try to copy a folder (dir_src) that divided into a lot of subfolders (all subfolders contain files and ...
1
vote
1answer
41 views

SelectLayerByAttribute and Where Clause

I'm trying to select the minimum value from a field to select and export that one feature to a temp shp so I can copy the field data from the point to a line. So far I have this: import arcpy from ...
1
vote
1answer
25 views

How to detect that QGIS is shutting down in a plugin?

I built a plugin in QGIS and needs to stop it when user wants to exit to remove signals and close properly. How can I get an event when QGIS is exiting ?
0
votes
0answers
20 views

Uploading raster to ArcGIS Server dynamically

I am building an new web tool related to agriculture research, this tool is linked to another backend GIS process done in c# and ArcObjects. I want to find a way to visualize this backend output ...
0
votes
0answers
33 views

Display Geoprocessing results of Python Script [on hold]

I have a python script that batch processes shapefiles to reproject them. I would like to include in my script some code that prints the processing results to the shell. I'm not sure what block of ...
1
vote
1answer
64 views

Can we avoid using SIP library when writing standalone QGIS python script

I wanted to write a small custom python script using QGIS functionality. So I started with the QGIS documentation on the custom application section. After having some troubles with the import ...
3
votes
2answers
59 views

Looping field name change

I need to alter all of the field names through multiple feature classes. I have a pretty good idea of which tools to use but I'm not sure how to loop them through each feature class and each field. ...
4
votes
1answer
67 views

How to randomly move points?

I have a feature class with a large amount of points. My purpose is to randomly move these points to see what happens as a result. Are there specific tools or Python programming methods to accomplish ...
-1
votes
0answers
18 views

Error 000539: Field Calculator autoIncrement script - need assistance to fix the following test script [on hold]

lastValue = 0 def autoIncrement(newValue): global lastValue pStart = 1000 #adjust start value, if req'd pInterval = 1000 #adjust interval value, if req'd if (lastValue != newValue): ...
0
votes
0answers
25 views

Error when kriging: “output variance prediction raster”

I am trying to run a python script for kriging, but keep getting a following error message. It doesn't make any sense as the output variance prediction raster is optional. The code: # Create ...
2
votes
0answers
18 views

How to run Focal Stats on specific values in python

I'm a beginning programmer and am new to the site but it has helped me quite a bit so thank you! I'm trying to recreate a raster calculator operation using python scripts but am having a hard time ...
1
vote
1answer
24 views

ArcCatalog and python crash when running ConvertTimeField_management

I have a script which reclassifies a tif file, adds a new field to the tiff, and is supposed to parse the date from the filename and add it to the new date field. Everything works as it should, ...
1
vote
1answer
49 views

PyQGIS - load PostGIS layer as editable

I can load a PostGIS layer on QGIS' map canvas but "Toggle Editing" button comes "inactive". How can I load vector layer as editable? The code given below loads PostGIS layer on map canvas & ...
0
votes
1answer
54 views

Geocoding arcpy slow startup time

When scripting with arcpy.GeocodeAddress_geocoding (http://resources.arcgis.com/en/help/main/10.2/index.html#//002600000006000000), there's always a major lag to start up the geocoder. The issue here ...
0
votes
0answers
34 views

Perfom SQL queries in Python and process the result

I query column names from a PostGIS table with following Python code: colnames = [] sql_getcolumns = "select column_name from information_schema.columns where table_name='shp2py';" ...
-2
votes
1answer
83 views

Python script with ArcPy cursors won't stop looping?

I am running my script in ArcGIS 10.2 for Desktop and it doesn't stop processing. The process is overwriting itself because I have to shut down ArcMap manually. How can I stop the overwriting as its ...
1
vote
0answers
17 views

Calculating Climate Suitable Days using netCDF4 and Python?

This is a follow up to netCDF4 Python climate algorithm I’m relatively novice in using netCDF files, so I’m wondering if someone can check my logic on my process of delineating what has been defined ...
0
votes
1answer
44 views

Python script for calculating the area of a polygon

I am looking for a python code for this polygon. I need to calculate the area inside this polygon and I am new to programming. (Very new). Can anybody assist me with this? I have to use a python ...
0
votes
0answers
21 views

gdal_merge.py import gdal error

normal Gdal utilities work. gdal utilities with .py extension do not. they had worked very recently, within the last two months. checked the path variable and python version called from the command ...
-3
votes
0answers
31 views

Calculating near area from road using QGIS? [on hold]

How to calculate the near area from a road with python. I am trying to build a plugin to calculate the near plot from a road and put the number 1 on it the next put the number 2 on it. I want to do ...
3
votes
0answers
30 views

Field Calculator convert text to integer then populate new field with sum

I have a .dbf with about 50 text fields containing numerals, I would like to convert those to integers and then sum them all in a new double field I created, is there an easy field calculation that ...
2
votes
1answer
37 views

How to know if two geometric figures are approximately equal?

I would like to know how to determine if two geometric figures (the_geom) are approximately equals. By the way, I'm working with Python, PostgreSQL and Postgis I have the following geometries: ...
1
vote
1answer
14 views

Time.Sleep between arcpy.mapping.ExportToTIFF in Data Driven Pages

I'm building a code in Python to export in geotiff my imagery. I need specific spots so I created a Data Driven Pages with polygons. Everything works fine, except that my imagery layer takes a long ...
0
votes
0answers
28 views

arcpy fails to retrieve queried data from a layer using arcpy.da.SearchCursor

I am attempting to retrieve rows of data from an attribute table using arcpy. I have used a definition query on the data in ArcMap so that only one feature is present in the attribute table. I then ...
0
votes
2answers
41 views

Using Arcpy to search geodatabase for feature with smallest number of rows and export as .SHP

I have created a bunch of grids for a city boundary area. I would like to know how to use the Arcpy module to look through a geodatabase and find the grid with the smallest number of rows (assuming ...
0
votes
1answer
21 views

How to pass value of a band to and other band and change its value?

Using gdaldem hillshade, I get a one-band hillshade (download here, 2MB) : gdaldem hillshade crop_xl.tmp.tif Shadedrelief.tmp.tif -s 111120 -z 5 -az 315 -alt 60 -compute_edges I currently can ...
2
votes
2answers
188 views
+50

Migrating from ArcGIS to gdal

I would like to collect a table of equivalent or close enough gdal based functions to replace ArcGIS functions (esp in spatial analyst). Are there functions available using gdal to perform the ...
1
vote
1answer
46 views

How to get path for layers listed in a combobox?

I want to get the path of a layer in my plugin, in the console it works fine but in my plugin it gives me the error AttributeError: 'NoneType' object has no attribute 'dataProvider' def run(self): ...
8
votes
1answer
158 views

How to create transparent hillshade?

I get elegant transparent hillshades via a combination gdal and convert. Compare to grey-based hillshade commonly used, such transparent hillshades are very cool because they can be placed between the ...
0
votes
1answer
33 views

Using arcpy.mapping.ListLayers() with no filter, but some layers are missing in list

I am trying to use arcpy.mapping.ListLayers() to access and change some of the properties on specific layers in my mxd prior to printing to PDF. Here is a screen cap of my layer list: When ...
0
votes
1answer
49 views

Creating multiple fields with ranks using ArcPy?

While figuring out what I have to do, practically creating a field for each arrondise, and in each, rank each FID (which are part of the respective arrondise) by the size of its shape area. ...
1
vote
0answers
35 views

How to use d.* from a python/bash script in GRASS GIS 7.0?

Do d.* commands from GRASS GIS 7.0 run from a python script? I'm trying with this code: import grass.script as grass grass.run_command('d.mon', start="wx3", resolution = '1') ...
2
votes
0answers
49 views

Processing plugin Python error on startup of QGIS 2.8.1

I've been running QGIS with no issues for several versions now, but after I upgraded to 2.8.1 Wien I had trouble running two plugins: qgis2leaf (which I believe depends on Processing) and Processing. ...
0
votes
0answers
24 views

install python packages for qgis? [duplicate]

I need the twisted framework (Python) for a qgis plugin on Windows 7. I installed it with the pip installer. When I want to start the plugin it doesn't find twisted. When I start a python interpreter ...
1
vote
1answer
43 views

How to remove “ERROR 1” messages from a standalone QGIS script?

I am running a standalone script for QGIS which creates a high resolution grid and clips shapefiles onto it. Works perfect if the cell width and height have a high values (in my case, >200m for both). ...
1
vote
1answer
37 views

Change layer datasource in qgis project with python

I have different qgis project with some layer and their datasource like ../my_path/my_file.shp. I need to insert this shp file to a remote db. For do it i use shapefile from PGeo module and it's work ...
2
votes
1answer
40 views

How to create a virtual field in QGIS by Python Console?

Is there any example about how to create a virtual field and subsequently change the attribute of a non-virtual field without wiping out the virtual field? Both are required to be done in the Python ...
1
vote
2answers
39 views

Generate PNG/JPG maps from multiple ASCI/GeoTIFF in Python/GDAL

I need to generate maps (saved in PNG, JPG or PDF) from raster files (for each file - one map) which meets following criteria; * each map has exactly the same color pallette, so that it will be easy ...
0
votes
1answer
32 views

How to change output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script found in this post? import_path = r"..." # Path of .mxd ...
1
vote
1answer
39 views

Trying to use Tkinter to open dialog box in ArcMap

The following script works great from the command line but crashes from the pythonaddin: import Tkinter import tkFileDialog root = Tkinter.Tk() root.withdraw() pathtest = ...
0
votes
1answer
40 views

Extracting from attribute tables by arcpy

I'm having some trouble connecting ideas on how to solve a problem. What I have is a shapefile from which I have to extract from one field, which contains 3 types of attributes (BS, RS, BRN). For each ...
0
votes
1answer
58 views

Python geoprocessing tool for ArcGIS online

I am looking to create a geoprocessing tool using python in arcGIS 10.2 that will be used in the ArcGIS online web app builder. This will be my first tool for a web application and I would like some ...
1
vote
0answers
43 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 ...