Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Version 2.7 of the Python programming language

0
votes
0answers
8 views

Aligning many rasters using PyQGIS or Python? [on hold]

I want to convert many rasters in some pixel size,extent and projection system. That is easy way using QGIS and Align Rasters Tool. Does a tool to do this work using pyqgis or Python (I want to work ...
1
vote
1answer
12 views

Integrate QGIS Plugin with Java Project

I have a Java Application. I am using QGIS to solve one such module of my Java Application. I have written code in python console within QGIS.Is there any way to integrate both of these? I am ...
0
votes
0answers
8 views

Qgis error: bin.exe stop after using my plugin the second time

I created a python QWizard plugin in Qgis. The code has roughly 1000 lines so I cannot show it here, but it has system calls (os.system), subprocess calls, layer creation, edition, processing.runalg, ...
0
votes
0answers
29 views

Avoid second run of a QGIS plugin

My plug-in allows users to open documents related to features, it works but with a second launch, while it is running, the plug-in becomes duplicated, so my documents open twice and with a third ...
3
votes
1answer
61 views

Select Layer By Location gives ERROR 000840 ({select_features} as arcpy.Polygon)

I tried to select SC27060054 point object using polygon. r"Project\project.DBO.Qo" is a point layer. import arcpy p1 = arcpy.Point(254426.380, 4664270.258) p2 = arcpy.Point(254432.730, 4664270.258)...
0
votes
0answers
27 views

Are there any of this concepts: 'last selected object', 'last query' or 'last cursor position' in ArcGIS Desktop?

Are there any of these concepts: 'last selected object', 'last query' or 'last cursor position' in ArcGIS? I want to use them in my python script. I think this will be an easy way to solve the task. ...
0
votes
0answers
25 views

Google Earth Engine Python API: indexing error with batch export to ImageCollection asset

Using the GEE Python API (Python 2.7) and geetools, I am trying to add images to an ImageCollection stored as an asset in GEE. I did not find any way to add directly a set of images stored as ...
1
vote
0answers
29 views

ValueError: array is too big

I'm trying to get the value of a pixel from a coordinate. The problem is when I use a large image, so this error appears Traceback (most recent call last): File "D:\algoritmo\teste_read_2.py",...
0
votes
1answer
44 views

Intersecting polygons from different layers based on common values using ArcPy? [closed]

I have two polygon shapefiles (ShapeA and ShapeB) that share some areas. The shapefiles have one attribute in common (CODE) and I would like to do a selection, where I select all the polygons in one ...
0
votes
1answer
24 views

List Esri GRID files from unique data sources in a CSV file using Python 2.7 and arcpy

I have a CSV file with a list of unique data sources extracted from an ArcGIS map document. I would like to list all ESRI GRID rasters that appear in the list. One example is: G:\GIS\Depts\Ex\PA\DB\...
0
votes
1answer
20 views

Python script parameters for Integer not working

I am using a Python library called arcpy_metadata that uses 2 datatype called max_scale and min_scale that take integers: My code for that is just: import arcpy, arcpy_metadata as md .... min_scale ...
0
votes
0answers
33 views

Clipping raster with different UTM zones using rasterio?

I have 2 Landsat images, with an overlapping area: The one on the left is in WGS84 / UTM32N (EPSG:32632), the one on the right is in WGS84 / UTM33N (EPSG: 32633). I have a polygon in WGS84 / UTM33N (...
1
vote
1answer
42 views

Export as DGN with QgsVectorFileWriter.writeAsVectorFormat

This code works in QGIS 2.14 but not in 2.18. What do I have to change to be able to export properly to DGN. From what I understand, now it tries to save in microstation V8 format instead of v7. I ...
0
votes
1answer
60 views

Loop every element in the same layer with a function using ArcPy?

I have the following code: import arcpy from arcpy.sa import * arcpy.env.workspace="D:/..." sp="StartPoint.shp" #Dataset that defines the zones zone_field="FID" #Field that ...
0
votes
3answers
65 views

Changing coordinate of point shapefile in ArcGIS using ArcPy? [closed]

I'm working on coding a function in ArcGIS trying to measure the number of pixels between a point (feature class) and its nearest building horizontally within a UDEM raster, then return the number. ...
1
vote
1answer
80 views

Better way to download Sentinel-2 data from Google Cloud Storage with Python

I'm trying to download Sentinel-2 data from the Google Cloud Storage and basically adapted the FeLS-module (great work, by the way!). As it is done in the module, I also download the index.csv first (...
0
votes
0answers
30 views

Get Path of my toolboxes ESRI addins Python 2.7

I need my toolboxes path. These are in the installation folder (toolboxes) but when using the function: dir_tools = os.path.join(os.path.dirname(__file__),r'toolboxs\parametros.tbx') result: C:\...
1
vote
1answer
102 views

Installing Anaconda for Python 3.6 without wrecking Python 2.7

I have both Python 2.7 with ArcGIS 10.5 Desktop and Python 3.6 with ArcGIS Pro. A few weeks back, I tried to install Anaconda (w/ Conda, Spyder, Jupyter, etc..) and it somehow overwrote my system ...
2
votes
1answer
101 views

Using Python to publish a JavaScript webpage

I am building a series of HTML web maps for a client (5000 location maps all HTML). I have a python script to execute a basic set of HTML tags to build a specific web page (Call this page 1). The ...
1
vote
0answers
27 views

Why does my Fiona output look different from my image

I'm trying to export my houghlines as a shapefile, which works. But the output the lines in my shapefile are very different then the generated hough lines that are shown on the image. Example: The ...
0
votes
0answers
7 views

How to export image with several transparency rules defined with another raster layer using python ?

I would like to export an image with several transparency levels defined in an other raster file but I have no idea on how to proceed using Python ? In other words, and with an example from qgis: on ...
1
vote
1answer
38 views

How to put value from different fields using Python?

Here I added a new field name "visArea" and want to put in the number from the "Count" column which "Value" equals one.That means the number of visible point(value=1)from selected observe spot.I used ...
0
votes
1answer
20 views

AttributeError: DescribeData: Method fieldInfo does not exist

I have a script that looks at feature class inside a .gdb and prints some simple information about the attributes field. Note- these is actually only one feature class in the .gdb. I want use the ...
0
votes
0answers
40 views

Python 2.7.13 cannot import ArcPy in ArcGIS Desktop 10.5.1?

I am using ArcGIS 10.5.1 and Python 2.7.13. I have also ArcGIS Pro on the same computer. Our license is in network server in our company. Import arcpy is currently not working. I had some tools to ...
3
votes
1answer
74 views

What is Esri's support plan for Python 2.7 beyond 2020 for ArcGIS Desktop? [closed]

According to PEP-373, Python 2.7 will retire on January 1, 2020 (Countdown Clock). That date was pushed back 5 years for those who couldn't migrate to Python 3. According to this product life cycle ...
0
votes
1answer
14 views

Entry point not found Error initiating GRASS GIS from Python

I cannot run any GRASS tools from within Python 2.7.15. While the GRASS environment, grass.script etc. are loading correctly and I can run basic checks like gscript.read_command('g.gisenv') gscript....
1
vote
0answers
41 views

Insert shp into existing Postgis table with python

I'm creating a Qgis python plugin that allows inserting shp into existing Postgis table, i've tried using ogr2ogr and it's workin when I run the command in FWTools Shell but when I try to run it in ...
0
votes
3answers
27 views

Trying to clip many layers using Python in ArcMap, getting error that an output already exists

I have a nationwide shapefile I want clipped into regions. There's not so many regions that I need to script iterating through each region, but there are enough where I want to batch process this. I ...
0
votes
1answer
40 views

Removing layer from TOC when it has space in name using ArcPy?

I am trying to remove layers from the TOC using Python Toolbox. It works provided that the layer names have no spaces in their names. Tho whole script looks like: class ...
0
votes
1answer
19 views

Python 2.7.8 crashes while using CopyFeatures in ArcGIS 10.3.1

I'm automating some of the ArcGIS workflows with Python scripts. My code started crushing with no error message as follows: The main issue was that there was no indication on the line, where it ...
0
votes
0answers
14 views

Deleting multiple columns in vector attribute table selecting by wildcards in GRASS

I need to delete a series of columns of a vector attribute table inside GRASS before starting further processing. I know I can use v.db.dropcolumn map=vector@PERMANENT columns=col1,col2,col3 But if ...
0
votes
0answers
91 views

Creating new attribute in polygons from raster values with GDAL?

I have shp files with polygons and I want to set a new attribute for each polygon and retrieve the value from a global raster map,using gdal. I found code to achieve this with points ( create a new ...
1
vote
1answer
63 views

django-raster rendering raster url

i want to add raster functionality in django using postgis database using django-raster package and this docs. here my code : models.py from django.contrib.gis.db import models class RasterWithName(...
1
vote
2answers
17 views

Toggle field in custom Arcpy script

I've got a script wherein I'd like to toggle (gray out) certain fields, unless a file has been specified. In the above image, I'd like Field A, B, and C to only be editable once a file has been ...
0
votes
1answer
41 views

How to create geom object from list of lat long coordinates

I have this geometry key that looks like this from which I want to create a Geom object so something like this MultiPolygon(((-xx.73833882299999 yy.41161324700006, -xx.73826573899998 yy.41172750400005....
1
vote
0answers
33 views

How to generalize shape with PyQGIS without much Distortion in the shape?

I was trying to generalize the the inner boundaries of the polygon. Looking for a PyQGIS solution for that any other possible python solution will be fine. I tried convex hull and simplify geometry ...
2
votes
1answer
58 views

Python plugin for QGIS 2.8.3 - issues related to combobox item data retrieval

Something unexpected is happening within a function connected to pyqt combo box currentIndexChanged event. Two combo boxes are populated and connected to a function to fire upon index change. The ...
4
votes
1answer
56 views

Cannot find polygons that are inside a big polygon using GeoPandas

First of all, some info about my system characteristics: Python 2.7 GeoPandas 0.3.0 I am working on a program, where I filter out the data of two shapefiles -link with data- (each shapefile is a ...
-1
votes
1answer
96 views

Updating QGIS attribute table automatically

I am writing a script that converts dxf drawing to a shapefile. Using my script now I can create a shapefile. Attribute table of that shapefile is initially empty and it has only one row. In that ...
0
votes
0answers
25 views

Running “r.lake” command in GRASS 7.4.0 from Jupyter notebook

I am currently using Jupyter notebook (Python 2.7) to run a GRASS (7.0.4) session on Windows 10. My code snippet is as follows: out_lake = gcore.start_command('r.lake', elevation = '115_hydrosheds', ...
1
vote
0answers
98 views

PyQGIS composer map add raster layer

i try to follow this example to create a map using pyqgis in standalone script. but in my case i don't have vector layer but i have raster layer. here the code : qgs = QgsApplication([], True) ...
0
votes
0answers
32 views

GRASS GIS - Entry point error for r.in.gdal

I am trying to run GRASS GIS 7.4.0 in Spyder (Python 2.7) - Windows 10 The simple code I am trying to run is as follows: import os import sys GISBASE = os.environ['GISBASE'] = 'C:\\Program Files\\...
1
vote
0answers
14 views

pyqgis composer legend error(no print)

i want to use composer in pyqgis standalone script to create some easy mas using one raster. my output image is correct i have the image but that code cant print show the legend in the map, any ...
0
votes
2answers
54 views

arcpy Geometry.union(Geometry) ValueError

In this script, I want to extract several polylines from one polyline. The data comes from this link : Lignes aériennes RTE au 22 décembre 2017 INF 45 kV In the flow, I merge the extracted polylines ...
1
vote
1answer
53 views

Running ArcPy geoprocessing tools on cursor rows?

I have a script using a Search Cursor to iteratively make copies of individual features for use as inputs in a geoprocessing tool, e.g., fc = <feature class> arcpy.MakeFeatureLayer_management(...
1
vote
0answers
40 views

Lock the nativity of the QGIS using PyQGIS [closed]

How to lock the nativity of the QGIS using PyQGIS icon = QtGui.QIcon(folPath + '\Dsmsoft.png') pixmap = icon.pixmap(302, 302, QtGui.QIcon.Normal, QtGui.QIcon.On) icon = QtGui.QIcon() ...
1
vote
0answers
28 views

Debugging mxd crawler error? [closed]

I found some conversation about listing the source paths for multiple mxd files and used the script provided at Crawling directory and listing all datasources using ArcPy?. It worked great on one ...
0
votes
1answer
43 views

Shapely with IronPython 2.7 [closed]

Will Shapely run with IronPython 2.7?
0
votes
0answers
13 views

Create polygon mask out of SAR Geom range azimuth coordinates

I have a SAR image, say s_img1, and a subset of min/max list of vertices as [(min_azimuth, min_range), (min_azimuth, max_range), (max_azimuth, min_range), (max_azimuth, max_range)] i.e they are a part ...
3
votes
2answers
60 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 ...