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

learn more… | top users | synonyms

1
vote
1answer
38 views

Use field calculator to reclassify values from three different fields to populate a new field AND determine overlap with different raster

I want to reclassify values of 3 different fields AND determine if one of those fields is located inside a different polygon to populate the values of my new field. Everything is raster. I created a ...
0
votes
0answers
53 views

Copy features to dataset in a loop

I'm trying to write script, that looks at the feature classes in a geodatabase and depending on what the feature class ends with, it creates a new dataset in the geodatabase and copies the file into ...
2
votes
2answers
72 views

Assign field values (double) based on values of other field (string) using field calculator

I want to assign numbers to a field, WScore (double), based on field values of Soils (string). They are in the same table of a raster. I'm not trying to add text to a double. What I want to do is ...
2
votes
1answer
84 views

How to read X,Y from mouse click in Python

I am looking for some advice… I am trying to build a tool that will precisely (10digit, eg: AA1234512345) identify British National Grid (BNG) by clicking on a map. The ArcGis default tool can only ...
1
vote
0answers
19 views

how to export multiple layers in single click to other folder

i have more then 100 layers which need to exported to another folder for further analysis is there any way i can do that in a single click. I tried to use package map but it says georeferencing ...
1
vote
1answer
39 views

Extent to xy coordinate- arcpy

I work with arcview 10.3, and i try to extent to xy coordinate with arcpy? I am using this code: import arcpy, os, sys from arcpy import env env.workspace = r"C:\Project" pnt = '178434 ,662446' ...
2
votes
1answer
53 views

FieldMap in Arcpy Merge for Selected Fields Only

I am trying to use FieldMap in arcpy to merge only a few of the same fields from 8 feature classes. There are many different fields in all of the different feature classes, but I have identified the 9 ...
4
votes
1answer
99 views

Guidelines for using ArcObjects from Python

By far, How do I access ArcObjects from Python? is my most read and referenced Q&A on GIS Stack Exchange. In spite of that success, it's probably one of my weakest areas when it comes to actual ...
1
vote
1answer
36 views

How to Compact geodatabases in multiple directories using ArcPy?

I am trying to write a script to walk through all folders in my workspace and find and compact all geodatabases in my workspace. I feel like I'm on the right track but I am stuck. import acrpy, os ...
1
vote
0answers
46 views

Geoprocessing Service on ArcGIS Server to Export File

ArcGIS Server / Geoprocessing Question I have a geoprocessing service that will perform a selection on a layer based on a provided expression. I would like to output the result as a csv file (or ...
0
votes
1answer
49 views

Basic Python Reclass question in Field Calculator

I'm trying to reclass values in field calculator using Python. I want any value >= '5' to remain the same (return same value). Anything else to be = '0'. Yes, DIST_EDGE are numbers. I'm getting an ...
2
votes
0answers
50 views

Working with rasters in file geodatabase (.gdb) with GDAL

I'm working on a tool that converts raster layers to arrays for processing with NumPy, and ideally I would like to be able to work with rasters that come packaged in a .gdb without exporting them all ...
0
votes
3answers
65 views

Only read specific attribute columns of a shapefile with Geopandas / Fiona

Having geopandas installed in my Python environment, I can read a shapefile into a geodataframe with In: import geopandas as gpd myShapefile = gpd.read_file(path_to_my_shapefile) print(myShapefile) ...
3
votes
1answer
95 views

ArcGis Python Security Concerns

I’m working for a large organization which are using ArcGis Desktop on some (windows) clients. The security requirements for the system is very strict, and a part of that is prohibiting the users the ...
3
votes
0answers
39 views

point feature to raster with count of unique points

I am using ArcGIS 10.1 with Python 2.7 I have a point layer with thousands of points that each hold an id value of its owner. One owner can have multiple points, meaning that points can have the same ...
1
vote
2answers
66 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 ...
2
votes
2answers
61 views

Select Layer By Attribute to be used in for loop

I'm trying to iterate through a feature class and select each feature one by one by using the OBJECTID field. When I use a single value, the SelectLayerByAttribute works, but how do I compare the ...
2
votes
1answer
67 views

Arcmap Maplex labeling engine bug workaround - labeling expressions won't recognize multiple spaces

I am labeling points in ArcMap using the Maplex labeling engine using a short Python script. The labels are rotated depending on an 'angle' field. def FindLabel ( [name], [city], [num] ): Buffer = ...
2
votes
1answer
28 views

QGIS Python SQLite using variable

I have been looking for answers and working on this for many hours. In the spatialite database table nodes, id is an integer. idValToNode = 854 sql = 'UPDATE nodes SET obsolete = 0 WHERE id ...
2
votes
1answer
33 views

Command line error and missing dependency in QGIS

I have two problems with QGIS 2.6.1 1) When i am trying to open command line i get error: An error occurred during the execution of Python code: Traceback (most recent call last): File ...
0
votes
2answers
39 views

Construct sql expression with python tool and pass it as argument to Select tool

I am trying to construct an sql expression using python and afterwards pass it as an input to the arc catalogue select tool. As shown in the following image I am passing a station_ID as a string to my ...
1
vote
2answers
47 views

handling QgsVectorLayer (pyQGis begginer question)

I have a simple question. I am trying to start with pyQgis, but I have found it really hard to get a GOOD api Documentation, simple but yet useful. The one of you who did programming in the old ...
2
votes
2answers
30 views

Error 000358 or Error 999999 invalid SQL

i've been searching arround all the answers in the questions of Error 358 and beyond, but i doesn't fix my problems, i tried every post and so on the problems stills there. I make two options in my ...
4
votes
2answers
59 views

How to convert float raster to vector with python GDAL

I have float raster and now I want to convert it to vector. How is it possible with python gdal library? I have tried with gdal_polygonize.py of gdal utilities in command line and it worked excellent. ...
0
votes
1answer
27 views

combine two FOR LOOPS (MakeFeatureLayer_management)

I want to combine two FOR LOOPS but I have no idea how. It should give me in each TYPE Layer "under" Layers, where are new Layers for each MONTH (see picture) The two loops in itself works. # ...
1
vote
1answer
82 views

Updating row in list of feature classes using dictionary in Python?

I have a list of feature classes (fcList) that I would like to do the following. - add a field (fire_dis) - update row from a single value from a dictionary(fcnaDict) - more specifically I am ...
0
votes
0answers
22 views

increase gdal_polygonize's capacity

I have a very big PNG (82500x40900) with more than 5000 polygons. I want to use gdal_polygonize but the geojson output shows that gdal_polygonizer stopped after 4770 polygons and the geojson isn't ...
1
vote
0answers
52 views

Python script split up

I have a python script which works with Grass 6.4. At some point during the project I decided to split this big python script into several scripts. I have made all necessary variables global, created ...
4
votes
1answer
80 views

Line vs. Polygon Intersection Coordinates

I am working with Python, Shapely and Fiona... Is there any way where I can give in an input of a line shapefile and a polygon shapefile, and get a result of the intersection points and their ...
2
votes
3answers
69 views

Using GDAL translate in Pythonwin

I want GDAL translate in Pythonwin to process some GeoPDFs to GeoTiffs. I can't call up GDAL module in Pywin. I used the OSGeo4 installer for original GDAL install and can leverage GDAL properly from ...
1
vote
2answers
55 views

Changing variable name in for loop

I am trying to run a simple python script that changes a feature to a polygon. However, I want the outputted polygon to have the same name an the inputted feature. The code that I ran, outputs the ...
0
votes
1answer
57 views

Use arcpy to query by date field in ArcGIS for Desktop?

I have an ArcGIS table in a file geodatabase that contains a date field. I would like to write a python (arcpy) function that creates and returns a table view for a date-range given a starting and/or ...
0
votes
0answers
11 views

Divided road segments and number subdivided of them [duplicate]

I use software ArcGIS 10.2.2. let me try to explain with an example: I divided the road segment called A that is 60 km long as each of them is 1 km by XToolPro. totally I have 60 subdivided. But ...
0
votes
2answers
93 views

How to concatenate row values with Python?

I want to concatenate a row who have the same src_Refname value ! like in the picture and get like this : is there any easy way to do it ? on using the tool described in the link, i try to ...
2
votes
0answers
53 views

Error when running Python script to replaceDataSource of multiple layers in multiple mxd's

I looked on all of your sites and did not find a solution to my problem. Almost all of our data has been copied to an SDE and now most of the layers in all of the mxd's need to be redirected to the ...
1
vote
1answer
49 views

How to change the values of the push buttons in QT designer [closed]

I am using the standard dialog box with ok and cancel options.i Have also added one more button exit. self.dlg.show() result=self.dlg.exec_() print 'The result is',result it is ...
-1
votes
0answers
49 views

Replace data frame with arcpy

I work on arcview 10.3. How can i replace an existing data frame in mxd with another data frame by using arcpy? I started write this code but i don't know how to do it: import arcpy,os,sys,string ...
-1
votes
0answers
49 views

Importing segmentation results from Python to eCognition?

I used OpenCV watershed segmentation to create segmented objects. However, I don't know how to import the polygon objects created (objects inside the blue circle) into eCognition.
2
votes
1answer
62 views

Area in KM from Polygon of coordinates

I have polygons from coordinates in (python shapely) that looks like this POLYGON ((24.8085317 46.8512821, 24.7986952 46.8574619, 24.8088238 46.8664741, 24.8155239 46.8576335, 24.8085317 46.8512821)) ...
0
votes
1answer
52 views

Search layer in MXDs

I work on arcview 10.3 and i try to find layer called "ways" in several mxds. i try this code but it does not work. anyone know how to do it?: import arcpy,os,sys,string import arcpy.mapping from ...
2
votes
0answers
21 views

Help getting a Mathematical Representation within a Layer's Attribute Table

I'v been playing around with Vector Coding and was wondering if there was any Plugins out there that might let me represent Vectors within a layer as it's Mathematic attributes in the Layer's ...
1
vote
0answers
32 views

How to create a boundary vector of objects after using watershed_segmentation python

I used watershed segmentation in opencv-python to separate object. However, after segmentation I don't know how to create boundary polygons of objects (red rounded in the image attached). Thanks ...
1
vote
2answers
25 views

Opening table from a geodatabase in Arcpy

I have tables in a geodatabase. I want to open and work with them in my script. The first step I appear to have to do is scripted underneath. My result of this script is all names of all tables in my ...
2
votes
2answers
83 views

QComboBox nested within a Qmenu?

Is it possible to nest a QComboBox inside of a Qmenu within QGIS? Below is my current code and an associated screenshot with the unexpected results. (orange = current incorrect placement, green = ...
4
votes
2answers
87 views

Performing a 'far analysis' using ArcGIS for Desktop?

I would like to perform an analysis that is the inverse of Near_analysis for ArcGIS. Instead of my result being NEAR_DIST and NEAR_FID, I'd like each feature to have a FAR_DIST and FAR_FID populated ...
1
vote
1answer
131 views

Determinate Parcel Neighbors using PYTHON

As you can see in the First picture, I have parcel 220, and i want to determinate the position of each of his neighbor ! So the idea was to calculate the bearing between the centroinde of 220, and the ...
1
vote
2answers
107 views

Calculate Date field in ArcPy

I'm trying to use arcpy.ExtractValuesToPoints() to get raster values to a points feature class for several raster files (8760). The goal is to get a time-slice view of how the values at certain ...
1
vote
1answer
28 views

Unable to find either renderd.py or generate_tiles.py

We created a Ubuntu 14.04.1 LTS x64 OSM tile server from packages using the excellent instructions provided by http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/ The tile ...
0
votes
2answers
38 views

Transforming Shapely Polygon and MultiPolygon objects

Is there an easy way of transforming Shapely objects (namely, Polygons and MultiPolygons) from one projection to another without having to dig around and extract coordinates by hand? In fact, I ...
2
votes
2answers
109 views

In ESRI ArcGIS, is there an equivalent to the RStudio Console Windows?

UPDATED I know ESRI provides scripting capacity, via the Python window, but I've had a hard time with it. Making the jump from the Field calculator to the Python window was too much to me. Trying to ...