Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [python-2.7]

Version 2.7 of the Python programming language

Filter by
Sorted by
Tagged with
0
votes
1answer
125 views

Shapely with IronPython 2.7 [closed]

Will Shapely run with IronPython 2.7?
3
votes
2answers
85 views

Does ArcGIS Desktop automatically install Python when there is update?

We noticed an office-wide installation of Python 2.7.15 this morning at 5:30am. The installation pushed Python 2.7.15 into a standalone folder on the C:/ drive of all our PCs. If there are two ...
4
votes
0answers
113 views

Performance improvement methods in a shapely environment

I am trying to use the Shapely and Fiona libraries to eliminate polygons from one layer (some triangles) from another layer (which represents the world's oceans). I am looking for suggestions to ...
1
vote
2answers
60 views

Comparing Object Fields to a couple million rows with a SearchCursor from arcpy

I'm new to GIS. I'm using arcpy.da.SearchCursor to read from a SQL server, and when I read through the first table I create objects ~350,000 of them. cursor = arcpy.da.SearchCursor(...
0
votes
1answer
80 views

Looping through shapefiles and lyr files to create multiple map documents using ArcPy?

Context: Using ArcGIS 10.3, Python 2.7.8. I have x .shp and y .lyr files. I am trying to loop through the shapefiles folder and the lyr folder and to create x * y .mxds that each contains one ...
4
votes
2answers
2k views

PIP no longer works with QGIS 2.18.x Python (TLS version no longer supported)

We've run into a problem installing Python packages (using pip) for use with QGIS 2.18.x (error messages copied below) Our diagnosis is that: Pypi now requires TLSv1.2 support (http using TLSv1.0 ...
1
vote
1answer
353 views

ArcPy 64bit gives 0xC0000005 error with PyCharm?

I have a simple script, which converts raster to shapefile and merges all the shapefiles. It does not really matter. The execution is fine, everything finishes but: I am using PyCharm Community 2018....
-1
votes
2answers
935 views

Using Calculate Field, how do you make one field equal another, existing, field? [closed]

I have two columns in a feature class. One has null values, the other has values. I want the one with values (TEXTSTRING) to be placed into the one without (HouseNumber). I know this is simple, but I ...
1
vote
1answer
395 views

QGIS custom forms using python logic

I use QGIS and I want to work with custom forms using python logic and I try to follow this manual. In my custom qu I add one new pushButton and I want for example for educations rules to open some ...
2
votes
1answer
80 views

Export Feature Class to Geodatabase without SubTypes

I want to export a feature class to a geodatabase using arcpy and strip out any subtypes. But they keep hanging around in the new feature class. How do I get rid of them? This doesn't work: ...
1
vote
1answer
55 views

Adding “cacheControlMaxAge” parameter into sddraft

I would like adding a new parameter into my sddraft, the value of "cacheControlMaxAge". For this, I have the following code that modifies the value of already existing parameters : import xml.dom....
3
votes
1answer
183 views

How to use Arcpy to set Extent to “Union of Inputs”

When I try to append two polygon feature classes, I get a geometry domain error. When using just ArcMap, I know that setting the processing extent to union of inputs fixes the issue. However, how do ...
1
vote
0answers
680 views

QPixmap: Must construct a QApplication before a QPaintDevice

I am creating a PyQT and QGIS application and im trying to add a combobox to the UI. I have defined the layout of my UI in a separate module to the main module. I know it is an issue with the combobox ...
1
vote
1answer
62 views

GDAL calculation without stop python.exe error?

I want to create a simple raster calculation using python and GDAL and specific gdal_calc.py in osgeo4w shell. BUT any time that before finish my script python stopping I take error : python.exe ...
1
vote
1answer
449 views

Missing Processing Tools in QGIS

The processing tools is missed in QGIS 2.18. I tried Missing Processing Tools in Vector Menu of QGIS? solutions, even install and uninstall several times but every time I get the following error (...
1
vote
1answer
134 views

label orientation after dxf to shp conversion

I'm writing a script with python in QGIS that allows me to convert a dxf file to shp. In the dxf file I have oriented text but after the conversion I lose this information. Is it possible to keep it? ...
-1
votes
1answer
188 views

ArcPy convert raster TIFF to PNG

ArcGIS 10.2 and I use ArcPy and I have create a ArcPy script. I want my final raster from script to create two raster datasets with different extensions, a TIFF extension and a PNG extension. Here is ...
0
votes
1answer
429 views

Encoding issues (UTF-8 to latin1) in the production of shapefiles using QGIS API

We are facing encoding problems with shapefiles trying to convert UTF-8 encoding to latin1/ISO8859-1 using QGIS API. In QGIS desktop over the layer added to the TOC doing "save as" and specifying the ...
1
vote
2answers
1k views

laspy ValueError: buffer size must be a multiple of element size

I am trying to learn LASPY and am running into road blocks off the bat. I first ran into and Error 8 (Not enough storage is available to process this command) using my full sized LAS file (1.7GB). I ...
-1
votes
3answers
40 views

Python code to populate column of district where it intersects

I'm running ArcPy and trying to populate my parcel layer with the district name it falls in. I can manually populate the column by using 'select by location' and then copying the district name from ...
0
votes
0answers
396 views

Django app can't upload multi-band-image

I try to upload a TIFF raster image with 5 bands in Django app and I get error message in form : Upload a valid image. The file you uploaded was either not an image or a corrupted image. I am sure ...
1
vote
0answers
55 views

Python GDAL calculation differend results

hello i want to create a raster calculation using python GDAL. First i try to use gdal_calc.py that work correct my new raster is correct is the some if i use QGIS raster calculation (some min/max all ...
2
votes
1answer
141 views

Using OrfeoToolBox in Python 2.7.9 crashes python

I wanted to create a python script using Orfeo Toolbox for Orthorectification of AWiFS Data. I set the environment variables necessary and the following command runs fine from the command prompt: ...
2
votes
1answer
64 views

ID generator incorporated in fishnet?

I am having difficulties completing a python tool. I am trying to make an ID generator for unique values per grid. This will be a concatenated field of the layer (feature code, XX) + column of the ...
1
vote
2answers
80 views

Column in dbf datatype string, should be float?

This code takes a .csv file, organizes the data and outputs another csv file that is used to create a .dbf file for ArcMap 10.4. The code appends the data as a float into the list 'output' and that ...
4
votes
0answers
209 views

Get signal on delete group on QGIS 2.18.16

I tried : QgsProject.instance().layerTreeRoot().willRemoveChildren.connect(self.onWillRemoveChildren) It works if I delete a group within in the root node. But if I delete a layer within a group ...
2
votes
1answer
84 views

python install rio-color could not load plugin rio -color

hello I have install python rio plugin to add color ramp in some DEM datasets. I have install using download from GitHub . but if I run rio --help in cmd then : C:\Windows\System32>rio --help ...
1
vote
0answers
86 views

pyqgis custom color ramp raster dataset

I want to create a custom raster color ramp using pyqgis in a standalone app. I have found some examples about this task, for example: s=QgsRasterShader() c=QgsColorRampShader() c.setColorRampType(...
1
vote
0answers
1k views

Python 2 and CSV writerows() encoding [closed]

I need to export data (from layer attributes) to new csv file. I use Python 2.x (Qgis ESSEN 2.14) and native CSV python module. Here is my error : UnicodeEncodeError: 'ascii' codec can't encode ...
1
vote
0answers
194 views

Controlling messages that are pushed to QgsMessageBar() [duplicate]

I've got a QGIS processing script which displays progress in the message bar, using the code in the PyQGIS cookbook. It displays properly at the beginning of processing, but my code calls some other ...
0
votes
1answer
323 views

Unable to create empty memory layer for Line layer using PyQGIS?

# Get the currently selected layer inLayer = iface.activeLayer() # Get its list of fields inFields = inLayer.dataProvider().fields() # Convert its geometry type enum to a string we can pass to # ...
1
vote
1answer
248 views

pyqgis correct activate signal for combo box list

I am a pyqgis user and I am trying to create a QGIS plugin where that plugin have two tabs widgets and two combo box where first combo box have a list from layers and second combo box have list of ...
2
votes
2answers
1k views

Copying multiple .shp files to a file geodatabase

I am trying to copy multiple shape files to a file geodatabase using python. I have been able to copy single .shp files to a geodatabase. Doing this one at a time is tedious and seems easier to do in ...
2
votes
1answer
1k views

raster calculation using rasterio

I have a multi image tif with 7 bands and I try to use rastrio package to create a simple calculation. I follow the docs but that not work for me. any idea ? here the code: with rasterio.open('L7....
1
vote
1answer
133 views

PyQGIS plugin doesn't work layer list combo box

I want to create a simple QGIS plugin with a simple combo box with list from my layers in _ _init_ _ : legendInterface = self.iface.legendInterface() listLayerName = [i.name() for i in ...
0
votes
1answer
198 views

Setting current group as active group in PyQGIS? [closed]

While iterating on groups, I would like to set the current group as “an active group” in order that generated layers will be children of this active group. Is there any pyqgis expression to do this (...
2
votes
0answers
49 views

Why isn't my layer loading via pyqgis despite the file name and path being correct? [closed]

I am writing up a python script on PyQGIS to load a point shapefile. # -*- coding: utf-8 -*- src = "‪‪‪C:/Users/Aaron/Documents/pygis/Points.shp" layer = QgsVectorLayer(src,"Localities", "ogr") if ...
1
vote
1answer
58 views

Strange behavior of QgsScaleComboBox

I am using a QgsScaleComboBox and it's behavior is really strange. I also have 2 buttons in my gui for adding/deleting items. Those are the methods I use for adding/deleting: Adding: def ...
1
vote
0answers
321 views

Geodjango PostgreSQL/PostGIS database question

I have a simple django app using sqlite3. My app is simple I have django user authentication system where the user can be upload spatial raster images and can see that images in user personal HTML ...
3
votes
0answers
76 views

PyQGIS expression with many inputs

I try to create some advanced expression using a QGIS plugin for education rules. I have a simple Gui : My Gui has 7 line edits for text inputs. I try to using this Expression: layer = ...
1
vote
0answers
33 views

pyqgis plugin error list has not attributes

hello I create a QGIS plugin using pyqgis and I have two buttons in my plugin window button 1(run perform_search(self) function) and button 2(run select_feature(self) function). to work button 2 ...
1
vote
0answers
253 views

QGIS for Mac: Python dependencies

I am developing a QGIS plugin in QGIS 2.18.15 on macOS 10.13.2 and I am having some troubles with Python libraries dependencies. More specifically, my plugin will require to use an external Python ...
2
votes
1answer
208 views

pyqgis zoom using pyqt list widget

I have created a layer filter Expression to get specific results query from my layer and i add these results in list widget using pyqt. my Expression and my add to list widget work fine(i take ...
0
votes
1answer
277 views

Arcpy Update Cursor-Overwrite values in field based on CSV

I have a CSV file called Modifications. The header has two entries, Rental Object and Rental Object Name. The Rental Object is a string that has matching values in a FGDB feature class where the ...
1
vote
1answer
478 views

Updating Field Based on another Field using UpdateCursor?

I have a feature class in a FGDB called LeasePlans. It contains a field called Property_Ref. I then have a CSV file with a field called SAPNO. For the feature class, I need to check does the value in ...
0
votes
2answers
200 views

arcpy raster calculation wrong result

I want to use arcpy raster calculation to create some script but the output raster to get from this arcpy raster calculation script is different from this to take from model builder in ArcGIS gui,any ...
3
votes
1answer
69 views

Value labels not showing for raster when styled with PyQGIS

I'm developing a script which includes a function to style raster layers (based on Setting 'classificationMode = Continuous' to a raster layer using PyQGIS? and Qgis: style a discrete raster)....
3
votes
1answer
186 views

NumPyArrayToFeatureClass output shapefile does not have field names

How do I retain the values and field names in the resulting shapefile's attribute table after using NumPyArrayToFeatureClass? I'm starting out with a 2d array named npGrid and I'm making it into a ...
2
votes
1answer
1k views

Creating QGIS copy-paste features between two layers using PyQGIS?

i want to create a QGIS action which copies features between two points layers using pyqgis . i have read How to create a QGIS action which copies features between layers? and i try to use this code: ...
0
votes
1answer
162 views

Invalid field name by using GetFieldAsString from ogr.py [closed]

I use a little algorithm to transform values from an openstreetmap-file into a table (.dbf). I use the function: GetFieldAsString("string") from ogr.py and everything is fine, but when the "string" ...