Questions tagged [python-2.7]

Version 2.7 of the Python programming language

Filter by
Sorted by
Tagged with
0
votes
2answers
100 views

Iterating through tables in map document and replacing workspace paths using ArcPy?

I am using Python 2.7 and ArcGIS 10.4.1 to create a script that walks through folders and scans for mxds. I use a set to get unique data sources and copy the data to a new folder keeping the same data ...
1
vote
0answers
53 views

ArcPy not seeing ArcSDE datasets from IDLE or PyScripter? [duplicate]

I tested the code below from ArcCatalog 10.5's python console and IDLE+PyScripter. While in ArcCatalog everything works correctly(code is supposed to list available datasets and feature layers), in ...
4
votes
1answer
944 views

python GDAL 'GetDriverByName', argument 1 of type 'char const *'

i want to use python GDAL to convert some rasters files but i take error in the create new tiff image and specific in the line driver= gdal.GetDriverByName('GTiff') update : python version 2.7 64 ...
0
votes
1answer
874 views

Creating standalone python Script using PyQGIS?

I have written a code which solve my problem for Demand Allocation. I have Input (.csv)File and Output is also (.csv) File. However I have to integrate this script in Java Application.(https://...
0
votes
1answer
569 views

Integrate QGIS Plugin with Java Project [closed]

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 ...
4
votes
1answer
288 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)...
1
vote
0answers
1k 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
58 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
44 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
457 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
360 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 (...
2
votes
1answer
415 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
67 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
96 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. ...
3
votes
3answers
1k views

Downloading 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 (...
1
vote
1answer
83 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
563 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
816 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
76 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 ...
1
vote
1answer
76 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
1k 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
221 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 ...
7
votes
1answer
2k 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
69 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
512 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
146 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
182 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
64 views

Python crashes while using CopyFeatures in ArcPy?

I'm using Python 2.7.8 and ArcGIS Desktop 10.3.1 to automate some of the ArcGIS workflows with Python scripts. My code started crushing with no error message as follows: The main issue was that there ...
1
vote
1answer
556 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
31 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 ...
2
votes
1answer
139 views

Creating 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
151 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
389 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 ...
5
votes
1answer
1k 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
622 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 ...
1
vote
0answers
358 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) ...
1
vote
0answers
19 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 ...
1
vote
2answers
659 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
400 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
64 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
59 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
178 views

Shapely with IronPython 2.7 [closed]

Will Shapely run with IronPython 2.7?
3
votes
2answers
152 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
141 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
66 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
288 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
520 views

ArcPy 64bit giving 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
2k 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
582 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 ...

1 2
3
4 5
14