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

learn more… | top users | synonyms

0
votes
0answers
7 views

Importing segmenation results from python to ecognition

I used opencv watershed segmentation to create segmented objects. However, I don't know how to import polygon objects created (objects inside the blue circle) into ecognition. Thanks so much for your ...
1
vote
0answers
36 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)) ...
-1
votes
1answer
33 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
18 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
28 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
votes
0answers
29 views

Split polygon based on line qgis [on hold]

I would like to split polygons based on intersection of a polyline. How can i do this with python in QGIS? Thanks
1
vote
2answers
20 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
60 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 ...
0
votes
1answer
59 views

Loop does not move on to the next row?

I want two make some operation, and I need to determinate the start and end point! I have two tables and I want to do this : get value (RefName) of the first row from the table 1(Join_Output_12) ...
1
vote
1answer
77 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
20 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
22 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
85 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 ...
2
votes
2answers
52 views

List all feature layers

I will often create many temporary layer files with MakeFeatureLayer_management. I was wondering if there was a means to list the temporary layer files I've created. I've tried setting the workspace ...
1
vote
0answers
12 views

plugin compile with make would not compile module [closed]

Ubuntu 14.04 QGIS 2.6 PyQt4 I'm following one of many tutorials on 'plugin builder', here is the latest one I'm trying with: http://www.digital-geography.com/build-qgis-plugin/ It all seems very ...
0
votes
1answer
53 views

UpdateLayer with arcpy

I am trying to use updatelayer in three mxd's. Each mxd has 3 data frames. I am getting an error, can anyone help? import arcpy,os,sys,string import arcpy.mapping from arcpy import env env.workspace ...
1
vote
0answers
31 views

Passing Value for Dictionary Look Up in Field Calculator fails [closed]

I've a field calculator that I am trying to use that uses a csv file to look up appropriate value based on key that is passed provided to the function. As provided below, the only values calculated ...
3
votes
2answers
67 views

Creating a weekly FGDB backup of ArcSDE?

I need to create a script that will copy our county's parcel data, maintained in SDE/SQL, to a file geodatabase. This script will be run as a scheduled task over the weekend. What GP tool do you ...
3
votes
1answer
77 views

Access ESRI .GDB in PyQGIS

I can access ESRI .GDB data using OSGeo's OGR. The following code gives feature class names embedded in .GDB... from osgeo import ogr driver = ogr.GetDriverByName("FileGDB") data = ...
2
votes
1answer
75 views

Access ArcCatalog Window through ArcPY

I want to create a button in ArcCatalog that takes the metadata from the selected file in ArcCatalog and prints it to a text file. The metadata extraction part is done, and I have succssfully tested ...
2
votes
2answers
28 views

Output raster from IDW interpolation tool is from 3.40282e+038 to -3.40282e+038 in ArcPy

I am not familiar with Python in ArcGIS, so I used ModelBuilder first to set the environment and put the tool in. The model worked right and the output raster seemed good. Then I exported the model ...
0
votes
1answer
35 views

Can not SET a Value in table using Python?

I'am trying to set values in table, the code run good, i don't got errors, but nothing is done ! I'm using Arcgis10.1, arcpy and Python This is the code : import arcpy import math import arcview ...
-2
votes
0answers
24 views

AttributeError: 'module' object has no attribute 'users' [closed]

I'm new to PYTHON. I keep getting above error. B elow is my code #!/usr/bin/python import socket import sys #with open('./users.txt', 'r') as f: with open('./users.txt') as f: for users in ...
2
votes
0answers
48 views

Help with Python/GDAL documentation

The instructions from the url http://gdal.org/gdal_tutorial.html give the following example: dataset = gdal.Open( filename, GA_ReadOnly) with the following description: It's interpretation is ...
2
votes
0answers
52 views

Iteratively exporting from Table to .txt in Model Builder (ArcMap) not appending correctly

I am solving a location-allocation type of problem where I use a loop to go through several specifications of the problem. The model runs fine, and produces the vizualization outputs just as expected. ...
1
vote
1answer
48 views

Creating Self Executing Python Script (*.py)?

Trying to figure out how to create self executing python scripts with using the ArcGIS python window. I'm ok (generally) when developing and running scripts inside the python ArcGIS windows but ...
1
vote
4answers
64 views

NameError: variable not defined even though set multiple times

This code original worked when run through the python command window in ArcCatalog. After I added the script to a toolbox I have had all sorts of troubles. The most frustrating error has been: ...
3
votes
1answer
27 views

Help with Python script to query feature server

For the purpose of saving the data locally from a feature server online I have written code below: import arcpy fcout = r'C:\Forum\Hydrants\test01.shp' url = ...
1
vote
1answer
79 views

Find and replace text based on feature class attribute

I've been struggling with this problem for a few days. It seems to be more programmatic than geospatial in nature, so I'm open to suggestions to redirect this elsewhere. I have a text file ...
2
votes
1answer
52 views

geting geograpic locations from an address list

I have a table with 150 addresses. I would like to automaticly generate a point shapefile/PostGIS layer from all of them. Is that possible in any way or do I have to search for every single address to ...
0
votes
0answers
24 views

Meaning of AttributeError: 'module' object has no attribute 'da'? [duplicate]

error is : AttributeError: 'module' object has no attribute 'da' Code is below: import arcpy import os from arcpy import env # Set local variables inWorkspace = "Q:\\NHD project\\Connection ...
0
votes
0answers
15 views

Make qgsmapcanvas.extent().size equal to qwidget.size()

I am using Qt and QGIS to write a touch device application. Right now, I have a QWidget which is the child of qgsmapcanvas, and both of them are full screen. However, the qwidget size is (1920,1080), ...
2
votes
2answers
50 views

How to encode a point geometry in Geojson?

I have point geometry in posgresql which I query as follows: select ST_AsText(geom) as pointgeom from pointable. I'm using python as server side script. I want to pass the result as Geojson response ...
1
vote
1answer
27 views

MakeFeatureLayer_management wrong output

I have a huge database with Sightings from whales and dolphins from 1995 till today. So I want to sort the database with python. Till now I can make FeatureLayers for each year for ...
0
votes
0answers
33 views

Rename open MXD using ArcPy

Is there a method in ArcPy that will rename the MXD you currently have open? I don't what to use mxd.saveACopy("newFileName") as it will just save a COPY with a new name, not rename the current MXD. ...
2
votes
2answers
29 views

Add both string and automated numbers in series to attribute table using field calculator

I would like to fill a column in my attribute table with an string that ends in a numeric value. Example: Object001 Object002 Object003 I would like to automate the process of filling in the ...
1
vote
1answer
42 views

how multiply a ranges of values for other value on python

I need multiply ranges>1.5 and <=4.5 * 9, but I am new in this type of language. please help me. def CalcD(Level_water) if Level>1.5 and <=4,5 * 9
0
votes
0answers
36 views

QT GUI make for QGIS plugin

I was used to develop qgis2leaf on a Ubuntu machine and after each change on the PyQT dialog I've used "make" in the terminal to "compile" the GUI. How does this work on a Windows machine?
2
votes
3answers
189 views

Executing Python code takes a lot of time (more than 2 hours)? (Arcgis10.1)

I am executing this Python code, in which I am trying to determinate the position of neighbor parcel (north, south, east, west). It works fine but it took 2 hours for just 50 parcels! I think that ...
0
votes
1answer
44 views

How to draw perpendicular/Parallel line using pyQGIS?

While digitizing a line with multiple segment, how to create a particular segment parallel to (or) Perpendicular to another feature using pyQgis?
3
votes
2answers
47 views

ArcGIS Removing values from a shapefile with Python

I've got a monster shapefile with lots of duplicate records, however each duplicate record has an accuracy rating. I want to remove all duplicate records with a lower accuracy rating. This would be ...
0
votes
1answer
24 views

How to set the spatial reference to a OGR layer using the Python API?

I create new a Ogr Layer with the Datasource.GetLayer() method: driver = ogr.Open(input_file).GetDriver() datasource = driver.Open(input_file, 0) input_layer = datasource.GetLayer() If the input ...
1
vote
2answers
66 views

Using Python For a Field Calc

In AcrMap 10.2 I'm trying to add a field and run this script in Field Calc: !shape.isMultipart! to see if I have any multipart lines. I keep getting geoprocessing failures. I am clicking the ...
3
votes
1answer
24 views

ArcMap Using Python to Rename a Feature Class based on Print Results

I would like to rename a feature class based on the EDITOR and DATE fields. I wrote this code: import arcpy fc = "C:\Users\PythonTesting.gdb\MyFile" f1, f2, f3 = "EDITOR", "DATE", "OBJECTID" ...
2
votes
1answer
44 views

Install QGIS on Ubuntu with GDAL built from source?

I am trying to install QGIS on Ubuntu 14.04. While I can easily install it via the package manager or apt-get, I find that QGIS, when installed, does not have Python support as expected. The symptoms ...
0
votes
0answers
45 views

name 'row' is not defined error appears overnight

I'm using arcpy with arcgis 10.0. I strived days to write my first python script, and I finally get what I want until...a new error occured during the night. The script you can see below was tested ...
0
votes
0answers
26 views

How do I auto-populate more than one other attribute field with values based on the value of another field within the same record?

Based on value selection from one attribute field, would it be possible to auto-populate many fields within the same record with predefined values either from a range of values within another field or ...
0
votes
1answer
55 views

Error 000728 field does not exist within table - field already exists

I am running arcpy.AddField_management to add a field called "cnid" and update it with x centroid values. For add.field I get the error "cnid" already exists. I tried print.field name and I cannot ...
1
vote
0answers
35 views

mark points on shapefile using python

I want to mark specific lat long coordinates on a shapefile using python. I am trying to use the plot function from matplotlib to do it. In the examples that have been provided, a basemap object needs ...
0
votes
1answer
48 views

Syntax error using ArcPy Spatial Analyst module in Python [closed]

I'm very new to using python and figure I'm missing something obvious in the following script. I keep getting a "syntax error" message no matter how much I fiddle around with the first few lines. I ...