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

learn more… | top users | synonyms

5
votes
5answers
2k views

Is there a way to disable code autocomplete in the Python window in ArcGIS 10.0

Autocomplete slows down my workflow in the Python window, especially if I am remoted into a machine. Is there a way to disable this? Alternatively, a way to disable this and then invoke as needed ...
1
vote
1answer
48 views

Can't write decimal data into shape (shp) attribute table with Python

I am trying to create a shapefile with Python GDAL/OGR library. I add to it a real number field, but when I write into it doesn't appear as it should but rounded. I will explain better with the code: ...
5
votes
1answer
406 views

Select and copy attributes features in ArcMap using Python add-in tool?

I'm trying to add a tool to an add-in toolbar to select features from an existing feature class and copy attributes to another feature class,from point to point. TopoHeight_Field_Name='Comment' def ...
0
votes
1answer
41 views

Moving file geodatabases in python without ArcPy

Please find my script below currently all i'm wanting to do is iterate through a folder and any subfolders extracting anything that is a .gdb directory + its contents to a new folder. import shutil, ...
0
votes
0answers
42 views

Reading shapefile directory in Python?

I am developing tool on ArcGIS ArcMap 10.0 with .NET and Python technology. In TOPOTORASTER tool , I give a line feature class. the line feature class path something like this: inputOne = ...
41
votes
3answers
7k views

How to smooth the polygons in a contour map

Here is a contour map for which all the polygons of levels are available. Let ask how to smooth the polygons keeping all vertices preserved in their exact locations? Indeed the contour is made on ...
1
vote
1answer
22 views

Importing Several Raster Layers, Doing Manipulations and Exporting The Newly Saved Rasters

I have the following code: src_ds = gdal.Open("/home/usr/Desktop/RasterFolder/Name.tif") if src_ds is None: print 'Unable to open %s' % src_filename sys.exit(1) myarray = ...
8
votes
1answer
113 views
+100

Mapnik failing through a webstack

I've inherited a pretty large / complex (internal) web portal (run under python 2.6.6), which has some mapping capabilities, using Mapnik 2.2.0. The web service has recently started throwing 500 ...
2
votes
0answers
39 views

Button to run Python Script on Custom Form Open QGIS

I'm very new to QGIS and Python (although years ago had some programming experience with C++), but have been muddling through with a fairly large project cataloging cemetery plots at the moment. I ...
2
votes
1answer
21 views

Lookup Projection Name from EPSG with pyproj

Is it possible to programmatically lookup a projection's name (e.g. Albers Equal-Area) from its EPSG using pyproj? I see pyproj.pj_list, but it does not contain a mapping to the EPSG. Thanks.
0
votes
1answer
32 views

Analyze height data using a digital elevation map

i ran the following code on python 2.7: import sys, struct from osgeo import gdal from osgeo import gdalconst minLat = -48 maxLat = -33 minLong = 165 maxLong = 179 dataset = ...
-1
votes
0answers
10 views

analysing height data using dem [duplicate]

i ran the following code on python 2.7: import sys, struct from osgeo import gdal from osgeo import gdalconst minLat = -48 maxLat = -33 minLong = 165 maxLong = 179 dataset = ...
0
votes
1answer
24 views

TopoToRaster Tool Execute problem in ArcGIS

I am trying to execute TopoToRaster tool (ArcToolbox>3D Aanalyst Tool>Raster Interpolation>Topo To Raster) in arcGis 10.0 with .NET. Topo to Raster Input But get exceptions. My code is here : ...
0
votes
1answer
19 views

How to delete features/records in ArcGIS Online hosted service using Python

How to delete features/records in ArcGIS Online hosted service using Python? I need to delete some features using Python from a feature services hosted in ArcGIS Online. I read a similar post that ...
0
votes
1answer
14 views

GRASS parser() error

I'm trying to use GRASS on python 2.7, but I'm having some problems at setting my script on IDLE, then I'm getting an error at parser() function: Here is my script: import os import sys gisbase = ...
0
votes
1answer
167 views

Can't get the correct version of GDAL installed to use ReadAsArray without getting error in Python

Using the instructions here . . . https://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/ I downloaded the following files: GDAL-1.11.1.win-amd64-py2.7.msi ...
2
votes
0answers
9 views

Qt TextLineEdit: Retrieve string instead of QString [migrated]

I am using Qt and want to get string from text field. I found below solution but it returns a QString. I just want to avoid writing extra code to extract string further. Can anyone suggest a simple ...
0
votes
0answers
28 views

Convert WGS84 coordinates to ECEF Cartasian (XYZ) coordinates using pyproj

I need to convert WGS84 to ECEF to map some points to a 3D sphere. I've trawled through the pyproj docs, but can't find specifics on the matter. Basically I want to input the WGS84 GPS lon/lat ...
4
votes
1answer
59 views

Predict/estimate point values for unsurveyed areas based on vegetation type

I have point data from deer surveys and would like to predict values for areas not surveyed based on vegetation type (Grass, Disturbed, Oak, Pine, Mixed etc.) So far I have dissolved my vegetation ...
2
votes
0answers
38 views

How do I speed up testing debugging when I am loading a large module as part of my program? [on hold]

I'm using PyScripter to do some python geocoding automation and I'm coming across the situation where I am waiting several tens of seconds for a large module to be imported. This is very inconvenient ...
0
votes
0answers
26 views

(python) distance between a point and a list of segments

I have a line (made of multiple adjacent segments) and a set of points, and I want to find all the points which are within a given distance (40m mainly but could change) from that line. segments ...
1
vote
2answers
2k views

OSR Python testSR.ImportFromEPSG(4326) returns empty spatial reference

This is empty using Python .ImportFromEPSG(4326): import osr #this fails: testSR = osr.SpatialReference() testSR.ImportFromEPSG(4326) print testSR.ExportToPrettyWkt() #why did the import from EPSG ...
3
votes
1answer
222 views

Trying to use Tkinter to open dialog box in ArcMap

The following script works great from the command line but crashes from the pythonaddin: import Tkinter import tkFileDialog root = Tkinter.Tk() root.withdraw() pathtest = ...
1
vote
0answers
32 views

Building QGIS 2.8.6 on Win 7 32bit?

I'm trying to build QGIS 2.8.6 on Windows 7 32 bit using MSVC Express 10. The build process completes without errors, but with a bunch of warnings. When I run the qgis.exe after installation, it only ...
0
votes
0answers
41 views

Adding a Field to a Feature Class using Python

I'm trying to create a script that adds an integer field to a File GDB, calculates it, buffers it, then clips it to a different GDB featureclass. Can anyone help me, I'm stuck so far!? I'll provide my ...
4
votes
1answer
38 views

How to toggle group visibility in QGIS using Python?

I've tried this, but it doesn't work out. root = QgsProject.instance().layerTreeRoot() group1 = root.insertGroup(0, "PGB") legend = i.legendInterface() legend.isGroupVisible(group1) ...
1
vote
2answers
964 views

Cannot import gdal_array

I attempted to use GDAL without installing due to not having rights to install on this computer. I managed to get several gdal modules working, but when I attempted to use ReadAsArray() I received the ...
0
votes
1answer
48 views

Unable to handle mouse hover in QGIS

I want to get map/layer information (no profile or lat/long) on mouse hover on popup in a QGIS map. I don't know how to do it, please let me know?
0
votes
1answer
54 views

Is there a python-module to convert data to a Shapefile (w/o GIS)?

Input data can be excel, text, whatever. I would like to produce shapefiles from data on a computer without GIS installed. Is there anything out there? Fiona seems to be such a module. Are there any ...
1
vote
2answers
81 views

How accurate i pythons is_land? Alternatives?

I was planning to use Pythons is_land function, to differentiate between land and sea. However, after some inspection, I have major concerns in the accuracy. I cant find anything about this in the ...
0
votes
2answers
441 views

Spatial ETL Tools won't run “AttributeError: 'module' object has no attribute, etc.”

I have a python script that runs 5 Spatial ETL tools that I wish to run as a scheduled task. Each of the tools will run successfully from ArcCatalog and also from the ArcCatalog Command line. If I ...
2
votes
1answer
40 views

QGIS - PYQGIS Import gpx as vector layer

I'm trying to use the python console to import some gpx files as vector layers. When I do it manually I have to choose which layers to add, my options are: I've tried various versions of the code ...
0
votes
0answers
24 views

First time rasterio error

First of all, I am new to python and rasterio. I am trying to open a simple raster with 5 bands using the rasterio module in python. This is what I am trying to achieve: import rasterio with ...
0
votes
0answers
29 views

Python GPS Observation Equations

I've been trying to write some code that will take pseudo-ranges and satellite positions and then compute the observer's position. I've been trying to follow through this book, but the crucial stage ...
2
votes
1answer
207 views

How to delete features/records in ArcGIS Server using Python

How can I use python to delete records from a table, or features from a featureclass, when they are stored in ArcGIS Server? using REST "delete features" in arcgis api for javascript shows ...
-6
votes
0answers
27 views

Exporting Multi Maps like JPEG,etc with Python? [on hold]

I need to Export Multi Maps like JPEG or .... ETC with Python
1
vote
0answers
19 views

Foreign Key error, creating new splite db?

Attempting to use a plugin in QGIS (midvatten) that utilizes splite. I am attempting to create a db in a different EPSG than the plug in defaults to, im getting "foreign key constraint failed" as my ...
3
votes
1answer
543 views

Spatial Interpolation Methods like PRISM

I am looking for some kind of software (free software) that allows me to make an interpolation like PRISM software. The interpolation used in PRISM is a local regression and accounts for ...
2
votes
2answers
208 views

Convert DateTime field to Just Date in Label Expression

I have a DateTime field (ex: CreatedDate) and would like to only show the date with the label. How would I setup the label expression to do this using python?
1
vote
1answer
41 views

Find Feature class into another feature data

I am trying to find the feature classes from one feature data into another feature classes. But I'm getting nothing at the end as a result of the matc statement. The data in the arc environment is ...
2
votes
1answer
281 views

How to programmatically set a rule-based renderer in QGIS?

These days im in a process of developing a plugin , which highlights/change color of set of features in a vector layer depending on some calculation. i found nice article about QGIS – Rule based ...
0
votes
1answer
50 views

QGIS loop/iterator with python in function editor (field calculator)

I am trying to create a loop to rename the fields of my attribute table. The fields should start at 1 and increment by one until the end of the table (e.g. 1,2,3,4,5,...,n) my code on the python ...
2
votes
2answers
36 views

Is there a size limit when adding features to ArcGIS Server programatically using POST?

I'm inserting new points using the ArcGIS Server REST API addFeatures method - this is working correctly. However, I'm finding that when the JSON reaches a certain (undefined) threshold the POST ...
1
vote
1answer
271 views

How to calculate zonal statistics from multi-band raster for each polygon using python?

I want to calculate the zonal statastics from multi band raster for a polygon layer. When I am using this snippet of code: vectorlayer=qgis.utils.iface.mapCanvas().layer(0) rasterfile = ...
8
votes
4answers
2k views

Accessing attribute table within shapefile and replace values?

I would like to find a Python script that will access an attribute table within a shapefile and either update or replace records inside a field column. More specifically, I would like to use the ...
0
votes
0answers
31 views

Equivalent to .replace() for integers? [closed]

I've recently been using the str.replace() method to change field values in string fields. Since this seems to be way faster than calculating field values, i was wondering if there is an equivalent ...
7
votes
2answers
4k views

How to send long JSON objects (polygon geometry, table rows) in POST request to Geoprocessing Service?

I am seeking to understand my options for sending long JSON objects in a request to a Geoprocessing Service. In particular, I am looking for some example code to illustrate how to include two long ...
1
vote
2answers
42 views

Recording the ArcPy script execution method

I have composed an ArcPy script which is run via a windows scheduler.The same script is loaded into a script tool so a user can run the process manually. I've used: get parameters as text, with or's ...
-1
votes
0answers
18 views

Python Script for seeing if 2 polygons overlap or not [closed]

I am trying to create a function that would tell me whether two polygons intersect or not with the inputs being the lower left, lower right, upper right, upper left of each polygon. Such as ...
0
votes
0answers
19 views

ESRI Hyperlink via VB or python [closed]

I am using ArcGIS 10.3 I'd like to have a featureclass support a hybrid hyperlink. The first part would be a web address where the only difference among the features is the last 6 characters (which ...