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

learn more… | top users | synonyms

1
vote
1answer
57 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 ...
0
votes
0answers
12 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
23 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 ...
-5
votes
0answers
32 views

Drawing polygon on PDF in Python? [closed]

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.
3
votes
1answer
62 views

How to toggle Map Tips with PyQGIS?

I want to display "map tips" in QGIS with python for my custom map canvas QgsMapCanvas(). How can I do this? I can switch manually with View/Map Tips but it won't work with my custom canvas in my ...
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 ...
3
votes
5answers
78 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
2answers
34 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", ...
2
votes
0answers
42 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 ...
2
votes
2answers
367 views

Why does “takes no arguments” error propagate from Arcpy example?

I was attempting to run Setup_Customers_Using_Tabular_Data , I modified the paths to fit my environment but when I run the program I receive SetupCustomersByTable() takes no arguments (6 given) ...
0
votes
1answer
28 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 ...
0
votes
1answer
555 views

Transforming between epsg:3857 and Google Maps Tile coordinates

Hio, I used to use a simple python project (https://github.com/hrldcpr/mercator.py) to convert between wgs84 and google maps tile coordinates. This project doesn't have a license, and looks like it ...
0
votes
4answers
113 views

Model Builder Error: Python cannot be found

Building some models in Model Builder for a training session, and it's not working out so well. Model Builder can't seem to find Python. Model Builder Error 000574: Python 2.7 is not installed ...
5
votes
3answers
1k views

Checking for number of shapefiles in directory using Python?

I want to test: to see whether or not ONE AND ONLY ONE shapefile (which will be based on a filename wildcard) exists in a directory. Add these shapefiles to a list Use this list variable as an ...
2
votes
1answer
82 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: ...
1
vote
1answer
211 views

40k+ points from Shapefile, clustering them and populating on Google Maps/Webapp

I just started a new Python/Django webapp job related to GIS (and i'm totally new to GIS). Here is my task and what i have found so far, and i am stuck as to finding out what's the best way or the ...
2
votes
0answers
62 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 ...
1
vote
2answers
209 views

Call output files in temporary directory through Processing Toolbox (python)

I need to create temporary files as intermediate output to be used with processing algorithms. So, I implemented this: Processing.runalgorithm("grass:v.to.rast.attribute", ........, None) This line ...
1
vote
2answers
34 views

library to create static maps (an image) with custom map features

Do you know if there is a small library (preferably in python or java) around that allows the creation of static map. Something where you can specific the URL of your TMS server, width and height in ...
2
votes
0answers
21 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, ...
5
votes
1answer
94 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 ...
2
votes
1answer
209 views

Extract data from netcdf using a shapefile polygon in python

I need to subset data from a NetCDF using a specific shapefile. The data are sea surface temperature and ocean color at 1/4 degree resolution. I have 4 polygons describing the US. Northeast ...
1
vote
2answers
309 views

How to plot Storm Prediction Center (SPC) Shapefile using python

I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this ...
6
votes
1answer
137 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 ...
1
vote
1answer
22 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 ...
14
votes
2answers
2k views

How to make a separate Python installation that can call ArcGIS' arcpy?

I see a lot of threads asking how you can create a separate Python installation (e.g. the Anaconda or Python XY distribution) that can use arcpy, while not 'breaking' the original ArcGIS python ...
0
votes
1answer
343 views

Get shape file polygon attribute value at a specific point using Python (e.g. via PyShp)

I have a shape file comprising multiple polygons. These polygons have attributes. I am trying to write a script in Python that takes a co-ordinate point, determines in which polygon it falls, and ...
0
votes
0answers
18 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?
1
vote
1answer
30 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
1answer
710 views

ArcPy SelectLayerByAttribute Error and how to control GP output layer name

I have a rather long script that first references an SDE feature class (non-versioned) to perform an attribute selection based on a SQL selection. I've been unable to figure out why the script will ...
4
votes
3answers
4k views

Using PyShp to convert polygons in *.csv to *.shp files?

I'm converting csv data to shapefiles using the pyshp python library. What I want to do is very similar to Using the python shape library: pyshp - how to convert .csv file to .shp, except that I ...
4
votes
1answer
64 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
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
39 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 ...
2
votes
2answers
822 views

How to create a series of points along multiple polylines at once in ArcMap 10

I have a series of polylines that represent linear vegetation (shelterbelts, etc). I need to convert these to a series of points equally spaced in order to add them to a different shapefile that ...
3
votes
3answers
1k views

Batch clipping rasters in QGIS?

I have been able to batch clip rasters in one directory using python in ArcGIS. However, I am not sure how to do the same in QGIS using the Python console. Is this possible?
1
vote
1answer
42 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 ...
0
votes
1answer
324 views

Error in Select Numeric type column in pyodbc with ArcCatalog

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
1
vote
0answers
24 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
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 ...
3
votes
1answer
221 views

Is it possible to run a search cursor on a multipart feature class?

I have a multipart feature class of cities. I want to run a search cursor on a cities feature class where: one city is selected and a select layer by location is run to select all parcels that are ...
16
votes
1answer
5k views

How do I get the pixel value of a GDAL raster under an OGR point without NumPy?

I am working on a computational model of the abundance of wild pollinators across a landscape. The model itself is complete, and I am now struggling with a post-processing step. I have my GDAL ...
-1
votes
3answers
95 views

Getting error while opening excel file in Python [closed]

Hi I am very new to python, here i m trying to open a xls file in python code but it is showing me some error as below. Code: from xlrd import open_workbook import os.path wb = ...
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") ...
0
votes
2answers
58 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 ...
1
vote
1answer
21 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 ...
1
vote
1answer
64 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 ...
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 ...