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

learn more… | top users | synonyms

0
votes
0answers
6 views

Add a row to a new empty table using Modelbuilder

I can create a point feature class and start an edit session in ArcMap which adds a row and I can enter data. So far i haven't created a point - just added data to the table. What i want to do is ...
1
vote
1answer
36 views

Python Script GetParameterAsText?

I am writing a python script to be added to a toolbox and I do not know how to call an existing tool to be a parameter. import geocoder ##geocoding library import csv import arcpy ...
1
vote
0answers
21 views

Merge points from multiple features that share common attribute

I have several point feature classes that all share similar attribute structure. How might I extract the points from all 9 feature classes that share a specific attribute? Background: There are 9 ...
0
votes
1answer
15 views

owslib - geonetwork - Failed to establish a new connection: Connection refused

i am tring to search for a specific record in geonetwork with owslib, according to documentation in https://geopython.github.io/OWSLib/. but it fails : >>> geonetwork = ...
2
votes
0answers
22 views

Bold and Italic layer labels with Python in Qgis

I'm trying to apply some labeling properties to a layer using Python. Everything went fine, except the way I tried to apply the Bold and Italic settings. Here is a part of the code: ...
0
votes
1answer
10 views

owslib - ValueError: All strings must be XML compatible: Unicode or ASCII

i try to use owslib to search metadata in geonetwork, and a i have problems when the string contains non ascii characters. geonetwork = ...
2
votes
0answers
23 views

Approach to controlling which layers display in a QgsComposerLegend

I've tried 2 approaches to control what shows up in print legends. Neither of them work which is troubling because other than pruning the layerRootTree in advance of composer.addItem(legend), there ...
2
votes
0answers
26 views

Python Script to apply the Northing and Easting of a photo center .shp file to a tiff.

I have a group of tiffs I want to georeference. I have the photo centers for each of the tiffs but they are not linked. After looking at the comments I believe there would be a way to take the ...
3
votes
1answer
50 views

Clip raster by mask layer returns error “wrong number of parameters”

Using Python for QGis 2.14 Essen i try to clip a raster by a Polygon, as indicated here: http://docs.qgis.org/2.6/de/docs/user_manual/processing_algs/gdalogr/gdal_extraction/cliprasterbymasklayer.html ...
1
vote
2answers
36 views

Select by attributes on PYQGIS 2.14 Essen

I'm trying to make a selection by attribute with python on QGIS Essen, but it looks like I am making a mistake on the script and I can not find it. Can somebody tell me what I have made wrong, or how ...
1
vote
0answers
39 views

Getting started with GeoJSON using Python [on hold]

I am a GIS analyst who knows ArcGIS and Python pretty well and have used QGIS. I am attempting to learn about GeoJSON and web-mapping. I am looking for suggestions on tutorials explaining GeoJSON, and ...
2
votes
1answer
36 views

Drivers of Fiona

What drivers does the python package fiona have? When I check the manual it says [...] and the possible formats are enumerated in the fiona.drivers list. However, when I type in python from fiona ...
3
votes
2answers
64 views

GDAL/OGR ogr.Layer.Intersection fails when producing mixed geometry results

I am trying to intersect layers using the ogr.Layer.Intersection method, in Python. This works fine for pairs of polygons, but I have found intersecting two linestring layers containing matching ...
1
vote
0answers
15 views

QGIS cannot load macro function?

This has me stumped. For some reason, I can no longer run a function from a project macro even though macros are enabled (from Settings > Options > General > Enable macros > Always). Just ...
3
votes
0answers
18 views

Automatic point plotting in ArcGIS from thresholded image

I would like to know whether it is possible to plot points automatically on a map in ArcGIS by using a raster file as a reference. The image below would represent an example of line that comes from ...
0
votes
0answers
29 views

How to georeference *.tiff to a given feature geometry automatically?

I´ve got the task to georeference an tiff image to the referencing polygon footprint (Polygon). I have found a lot of ways to do get the footprint from a raster but I could not find a way to use ...
0
votes
0answers
12 views

owslib - GetNextFeature() - cannot parse - element arg attribute name had invalid value TYPENAMES

i am new in Python and owslib, and i try to follow advices given by Gene in ouvrir un WFS - debutant, but it fails... from osgeo import ogr driver = ogr.GetDriverByName('WFS') wfs_ds = ...
-3
votes
0answers
32 views

Can a GIS do this for me? (KL-1) [on hold]

I need to develop a system that will not only map out single family addresses, but identify a contiguous set of them (say 20), produce a map of these, and prevent subsequent runs from reusing them. ...
2
votes
0answers
15 views

Reading raster attribute table using gdal in python

Is there a GDAL function that can read in a raster attribute table? Something functionally similar to this function in pygeoprocessing: ...
1
vote
3answers
56 views

Multiple python import from feature class into feature dataset in geodatabase

Is it possible to create a python script to import shapefiles/feature classes, from different sources into specific feature datasets in geodatabase, but in one script? I managed to write the script ...
0
votes
1answer
35 views

How do I convert a DEM GeoTIFF to Contour Shapefile

I have a digital elevation model as a GeoTIFF and I'm looking to generate a Shapefile of contours with 5m bands on the command line. Is this possible? Ideally using GDAL and Python.
3
votes
1answer
42 views

Memory error in python when reclassifying array

I have a .tif that I read into an array (call it tifArray), and I would like to classify the array based on set of conditions: Where 1200 <= tifArray <= 4000, outputArray = 1 Where tifArray ...
4
votes
1answer
44 views

Can't delete features from layer using QGIS' Python API

I've only recently started using QGIS and it's Python API. Currently I've loaded two OpenStreetMap datasets. I would like to remove lines with from the second set where the name is already present in ...
0
votes
0answers
11 views

numpy.unique: ValueError: all the input arrays must have same number of dimensions

I'm trying to get the unique values of an array but am getting an error that doesn't make any sense. Here is my pseudo code: import numpy as np import gdal # I have a .tif file, call it ...
1
vote
0answers
16 views

QGIS 2.14.1 Processing Plug-In does not work anymore (Python error)

I did not change anything and started QGIS 2.14.1 today and was greeted with the following error message. So the Processing tab is missing and I cannot activate it. The error: 2016-04-26T17:58:43 1 ...
3
votes
0answers
14 views

Python with ArcCatalog for Table or Geography view?

Is there a way to automate the preview tab in Arc Catalog using Python? Say if I wanted to preview the geography of a feature class where I have the path and just don't really want to connect to the ...
2
votes
2answers
39 views

Sort Column and Sequentially Number Separate Column

I am trying to sort (alphabetize City) a column, and sequentially number a separate column for the purpose of labeling and creating a map key. What is the best way to do this?
0
votes
2answers
43 views

How to connect push button in dock widget form?

Following this tutorial as a guide, I created a plugin using the Plugin Builder with the dock widget form. I am now trying to connect a pushButton to a function. The following is a snippet of code: ...
2
votes
0answers
34 views

How to use ST_VoronojDiagram for points that are almost aligned?

I am trying to use the spatialite ST_VoronojDiagram function on a table containing four 4 points that are almost aligned: (1.01 2.02, 2.02 3.03, 10.01 10.02, 11.01 11.02). I wrote the following script ...
0
votes
0answers
46 views

ArcGIS 10.2x64: Batchfile->Python->Batchfile->Python with Arcpy [on hold]

I'm using ArcGIS 10.2 x64 with Python 2.7. Here's the outline of what I'm trying to do: Step 1 - Execute a batch file which kicks off a python script, pylaunch.py, which imports arcpy Step 2 - ...
-1
votes
1answer
40 views

Listing Points Within Polygon for Hadoop? [on hold]

I am very familiar with a point in polygon analysis but instead of counting how many points are within each polygon. Does anyone know how to list the points within the polygon and add a field that ...
1
vote
0answers
35 views

QgsMapCanvas not fully rendered and missing some layers in PyQGIS standalone script

I've been working with the script below with the help of @Germán Carrillo. The script renders all of the correct layers when showing the canvas window and exports the individual Div1_Irrig... layers ...
1
vote
1answer
64 views

Writing result of PyQGIS to shapefile

I try to perform some zonal statistics on a shape- and rasterfile and write the output to a completely new shapefile! import sys # where is the module ...
1
vote
2answers
41 views

Arcpy fail to loop between files in different directories

I want to perform a loop of intersections between different files in different directories. Here is my code: Intersects = ['Name1','Name2','Name3','Name4','Name5'] #Names of my files ...
0
votes
0answers
13 views

Layer stacking many images using Python and Erdas Imagine Spatial Modeler

I have downloaded huge amounts of Sentinel 2 data to cover a large area of the Himalayas and need to layer stack each tile. I have decided to use Python to do this using the LayerStack tool from Erdas ...
0
votes
0answers
24 views

Assign a point to polygon using pandas and shapely

I have a series of Easting and Northing coordinates in pandas dataframe along with other columns of information. I know the coordinates fall within and administrative area and want to match the ...
0
votes
1answer
26 views

Empty file after saving…? [closed]

Code below is working, but after opening - there are No features in shp file. What can be a problem? import osgeo, os from osgeo import ogr, gdal shpFile = r'C:\Users\ReBurns.shp' driver = ...
1
vote
2answers
93 views

Scripting (Python) Feature Class content into Shapefiles following an UTM data structure

Consider a Feature Class and two of its fields are "UTM_grid" and the "OID". Scripting with python 2.7 for ArcGIS 10.3. "UTM_grid" field contains the geographic info (e.g. B1SD40B) and was broken ...
4
votes
0answers
48 views

Issues updating field values programmatically for particular field data type on 64bit Windows computer using QGIS 2.8.7

I have an issue with a plugin for QGIS 2.8 I'm developing when using it on a Windows 64bit machine (as opposed to 32bit). I am trying to update values in a particular field in my plugin, and the ...
3
votes
0answers
32 views

Translating ArcGIS field calculator python expressions in to QGIS field calculator python expression?

I'm transitioning to QGIS from ArcGIS. I'm having trouble getting my python field calculator expressions to work in the QGIS advanced python field calculator. Here is a screenshot of the working ...
3
votes
1answer
36 views

PostGIS: floating point representation problem with ST_AsText

I have a table with geometries, all with about 13 digits of accuracy. While trying to represent them with ST_AsText though, most vertices come out in decimal notation, but some come out in scientific ...
1
vote
1answer
25 views

Remove/subset raster bands in Python GDAL

I'm trying to remove bands from a raster I have. Basically I just want the first band as a new GeoTIFF file. Here is my code so far: #!/usr/local/bin/python from osgeo import gdal # Load my GeoTIFF ...
3
votes
1answer
35 views

Building a tool to both geocode and do topology check on the geocoded point (ArcGIS)

Never built a tool in ArcGIS. Would someone tell me if it's feasible to create a single tool (preferably using Python) which: Geocodes an address Checks to see if geocoded point falls within a ...
1
vote
1answer
47 views

Why does joining all layers in a group not work?

I am attempting to re-join all layers within a group to another layer ("Main.shp") outside of this group. The idea is for users to change values in one of the group's layers. As these layers are ...
-3
votes
0answers
32 views

Python code to calculate area and perimeter [closed]

I want to calculate area and perimeter for many features (polygons) that have been saved in separate files. How can use python script to calculate these parameters and output them in one table for all ...
0
votes
1answer
40 views

Python-ArcObjects mxDocument Stand Alone

if I need to work with classes MxDocument with the MapDocument that I have selected to work , for example style gallery, How can I instantiate ? InitStandalone() pMapDoc = ...
3
votes
2answers
37 views

Find points that intersect a user-defined polygon in GDAL

I'm trying to do something that I don't know is possible in GDAL/Python. I have a list, L, of pre-defined lat/long points that make up a uniform grid. A user will send me a set of points that make ...
2
votes
0answers
27 views

QGIS Function Editor/ Python question

I'm currently using the layer_property(layerName,'source') to produce a list of copyright statements for the Print Composer by putting that in an if() statement. However, that isn't very flexible as ...
4
votes
2answers
47 views

How to get layers in x number of subgroups?

I have a project which has dozens of groups and subgroups. E.g.: Main_Group > Sub_Group_1 > Sub_Group_1A > Layer_1A > Layer_2A How can I access ...
1
vote
0answers
27 views

Eclipse PyDev has quit recognizing QGIS objects

I followed the instructions for setting up Eclipse with PyDev to start creating QGIS plug ins found here: http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/ide_debugging.html after doing ...