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

learn more… | top users | synonyms

1
vote
1answer
53 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 = ...
0
votes
1answer
43 views

Extracting from attribute tables by arcpy

I'm having some trouble connecting ideas on how to solve a problem. What I have is a shapefile from which I have to extract from one field, which contains 3 types of attributes (BS, RS, BRN). For each ...
0
votes
1answer
81 views

Python geoprocessing tool for ArcGIS online

I am looking to create a geoprocessing tool using python in arcGIS 10.2 that will be used in the ArcGIS online web app builder. This will be my first tool for a web application and I would like some ...
1
vote
0answers
55 views

Import shapefiles into PostGIS using Python with psycopg2

I want to import shapefiles to PostGIS using Python with arcpy & psycopg2 to connect to PostGIS. I don't want to use the existing shapefile loader nor ogr, just write my own import tool. My steps ...
0
votes
0answers
21 views

How to customize and add additional features in GeoNode

I need some advice on how to start customizing my GeoNode installation. I tried reading up on GeoNode documentations on how to do it but it always boils down to customizing or adding to the Django ...
2
votes
1answer
106 views

Convert coordinates to differnt Spatial Reference System in Python

I am trying to convert co-ordinates (-33.75, 150) from epsg:3857 to epsg:28356 in Python. Using both of the examples in post How to convert projected coordinates to lat/lon using Python?, I get the ...
1
vote
1answer
69 views

QGIS processing script: Move points by specified distance and add segment

I try to move points (they come as WGS84, but I'm not sure if it works with unprojected CRS) by a specified distance and connect original and new point with a line segment with the below script, but ...
1
vote
1answer
27 views

Unable to execute a python script that was exported from ModelBuilder

I have a model that copies a single F.C form SDE geodatabase to a scratch geodatabase then copies it back with a new name to the same SDE geodatabase again. And this works perfectly form the model. ...
0
votes
0answers
14 views

Using a layer file to apply symbology to shapefile [duplicate]

I have code that doesn't work at the moment: # Import arcpy module import arcpy # Script arguments Input = arcpy.GetParameterAsText(0) if Input == '#' or not Input: Input = "frame" # provide a ...
1
vote
0answers
22 views

Action on group of features from layer in QGIS?

I need to implement a rename action on a selected group of features in a certain order. The idea is that I would rename one feature and then select the features that are 'next in line' and execute a ...
1
vote
1answer
36 views

How to convert from .shp to .csv using python and either gdal_translate of ogr2ogr

I am trying to convert .shp files to csv using either gdal_translate or ogr2ogr and python but its not work. if i run the following from qgis its not giving an error but at the same time its not ...
1
vote
1answer
60 views

why does my script not save a layer when it encounters a “ \” character in the string

i have some code that takes a field and finds every unique value in that field. it then creates a layer for each unique value. The code is working ok , but it is failing when there are \ characters ...
1
vote
0answers
34 views

Are there any conditions that could break the creation of an arcpy.Polygon object?

I have a script that generates a mesh network from vertex and centroid inputs, and it works for almost all my points. But for some records that get created in the feature class via the script, their ...
0
votes
2answers
64 views

Writing out comma separated values inside a single cell in a spreadsheet using python [closed]

Please excuse the long subject header. I have gotten pretty good at writing data out to csv files but i seem to have stumbled into this block. Anytime a ',' (comma) is used to join values, it shifts ...
0
votes
1answer
42 views

Combining and extracting attributes from 2 columns to populate a third (Concatenate)

I am working with a FEMA flood zone shapefile which contains a FIELD_ZONE field and a SUBTY field. I created a third field called ZONE_TYPE that needs to be populated by combining or extracting ...
1
vote
0answers
55 views

How to control QGIS from within Anaconda's Spyder (Continuum Analytics Python distribution) in Windows

I would like to control QGIS from within Anaconda's Spyder, in particular use the QGIS core modules. My config: Windows 7 Anaconda 64x for Python 2.7 Spyder 2.3 Postgresql 9.4 PostGIS 2.1 QGIS 2.8 ...
2
votes
0answers
57 views

How to access Landsat bucket from Amazon?

I tried to access amazon Landsat S3 bucket with the following python code import boto import boto.s3.connection from boto.s3.connection import S3Connection access_key = <userid> secret_key = ...
0
votes
0answers
20 views

Closest raster VALUE to a given x,y point [duplicate]

Is there a way in ArcGIS to find the closest VALUE in a raster to a given x,y point? There might only be NoData at a certain point, in which case I want to find the closest pixel value. I cant seem ...
0
votes
1answer
36 views

Intermediate files disappear in ArcGIS 10.1

I am working with ArcGIS 10.1 creating some slope and aspect files. I do this: DEM_park = ExtractByMask(mosaic_name, park_area) and it creates the DEM_park file in a default gdb with a default ...
1
vote
1answer
52 views

What defines where the files will be saved?

Hi I have a script I am using to save out layers automatically I have posted another question here ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where ...
2
votes
1answer
256 views

Change field names automatically

I have an attribute table with over 2500 fields. About 2000 fields start with the name "All_txt_" (eg "All_txt_Watermelon"). Is there a way to remove this "All_txt_" from all the fieldnames ...
-1
votes
1answer
53 views

How to read landsat images from Amazon S3 using python?

I would like to read and process landsat images from Amazon using pyton thanks,
1
vote
1answer
26 views

Using pyQGIS transform a layer of polygons into a layer of holes inside a bbox

I'm using python in QGIS. I have a layer of polygons (its a result of some earlier dissolving and has no overlapping polygons but some holes and islands in holes etc). I want to build a new layer ...
1
vote
2answers
45 views

Identify Census blocks inside urban areas (using pyshp or similar)

I am trying to find the Census blocks that are inside specific urban areas or urban clusters. The Census Bureau provides a list of urban areas/urban clusters with the following information: | ...
2
votes
2answers
45 views

Controlling default value of arcpy.AddField_management

I have a large collection of shapefiles that use text fields to hold numerical values. I have created new fields, and populated them with the numerical equivalent of the text field. When adding the ...
0
votes
1answer
65 views

OSGeo4W and GDAL - gdal2tiles.py error

Wondering why gdal2tiles is throwing errors, I've added the gdaldata and gdalplugins environmental variables and my python is at Python27/ArcGIS10.3/, and am wondering if that is messing with the ...
0
votes
0answers
57 views

UpdateCursor not iterating as desired, updating erroneously

(EDIT BELOW WITH WORKING CHANGES) I have a script in which I am trying to compare attributes in row n to row n+1. If all the attributes match, I want row n+1 to have a field ([Modifier]) updated to ...
1
vote
1answer
24 views

Cleaning shape file with multiple boundaries defined more than once

I have a shape file which contains a lot of polygons which define airspace. These polygons overlap and this is fine (e.g. different airspace configurations for the same airport). My problem is that ...
3
votes
4answers
177 views

How to get values of last row in table with ArcPy/SearchCursor?

I would like to base my query on the last row of a table? I know the basic syntax/functionality for my search cursor, how do I query only the last row; Below is an example of my search criteria, ...
0
votes
0answers
41 views

ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where Clause

I am putting together some code that makes a layer for each unique attribute within a given field. So if I had a shapefile that contained point data for locations of say postboxes in every city , for ...
0
votes
0answers
19 views

Arcpy MakeGraph “Parameters are not valid”

I have a Python add-in that should create a graph based on the location ID of a water quality testing station. The user clicks on the point and a relevant graph should be created in the layout window. ...
0
votes
0answers
43 views

how to compile a python script (proxy.cgi) in ubuntu?

I want to know please how to compile a python script ubuntu 14.10, I have a file proxy.cgi I want to compile in order to access to the geoserver. when I type localhost/cgi-bin/proxy.cgi, it displays ...
1
vote
2answers
62 views

Convert a string field to a number field using arcpy

Accidentally posted this in the general stack overflow forum first. I have a large (>1000) number of shape-files in which there are fields containing numbers that are defined as text fields. I need ...
1
vote
4answers
213 views

Python script for Field Calculator. ArcGis 10.2.2

I have a point shapefile with two columns i want to process. The first column is aspect and the second is aspect_m60, there is only one row with the aspect of my point. I have tried to write a script ...
2
votes
0answers
41 views

Error inserting new column in ArcSDE table (ERROR 999999)

I am using a python script to populate a table with values I get from rasters files. I use arcpy.AddField_management to add a new column and arcpy.CalculateField_management to insert the values for ...
0
votes
0answers
34 views

Python error in array declaration

I am getting a error as follows File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy__init__.py", line 2292, in NumPyArrayToRaster return _NumPyArrayToRaster(*args, **kwargs) ValueError: ...
1
vote
1answer
70 views

PyQgis, styling vector layers in different canvas

I'm developing a QGIS plugin and I need some help with styling layers in different canvas objects. In my dialog window I've got two QgsMapCanvas objects canvas1 and canvas2. Layers from registry are ...
0
votes
2answers
81 views

Convert a tiff Float32 image to 8bit tif (or jpeg) image using GDAL and Python

I need to convert a Float32 tiff image to 8bit format in order to display the image in a web page. In order to do that I need a jpg image but this conversion is not correctly done with GDAL because ...
0
votes
0answers
29 views

arcpy.da.Walk not adhering to datatype filter “Locator”

I have a file gdb containing feature classes and address locators. I am listing and storing the names of the datasets using arcpy.env.workspace = "C:\input.gdb" (root, fds, ftrs) = ...
0
votes
0answers
30 views

Never get the information about obective interpollation and optical interpollation

I have point data want to interpolate it and convert it into 3d grid format but i am not get any proper information which interpolation i have to used objective / optical. please let me know any ...
1
vote
1answer
48 views

Stand alone - Python Append (multiple shps from a folder to one dataset)

I have users creating data (shp) daily into a specific folder, I already know how to invoke GP tools to append these data sets into one. What I am trying to do is run a task (which I already know) to ...
2
votes
1answer
39 views

Clip Point Features to Polygons with Model Builder/ArcPy

Here is the context of my question: I have point features for about 2000 individual trees spread throughout 50 different tree districts. The tree districts are polygons in a polygon feature class and ...
0
votes
2answers
37 views

How to convert GeomSHP to WKB

I have imported a point shapefile called site_locations.shp into a personal geodatabase. Now I'm trying to retrieve the data from the database using SQL: dbpath = ...
2
votes
1answer
162 views

How to split filenames for their first word in Python? [closed]

I have 2 shapefiles, each one placed in a different folder: "C:\...\Folder O\Germany (O).shp" "C:\...\Folder P\Germany Berlin (P).shp" The following script finds the shapefiles and contains a ...
0
votes
0answers
64 views

Not matching schema problems when appending a list of CSV's into an existing FGDB table

So far I have the following code for creating the FGDB table and defining fields which works just fine. But when I try to append a list of csv's to this table I always get a matching schema error. Do ...
0
votes
1answer
26 views

raster to point in batch mode using Python

I have a list of raster files in tiff format and I want to convert that tiff to point using raster to point conversion (tool of ArcMap). This tool will convert the raster into a point shape file. I ...
1
vote
1answer
68 views

Plot points on map using Fiona and/or Shapely

I have written a parser in Python that extracts the coordinates out of a GPX file and I would like to view those points on a map. I have done a little research and it seems like either Fiona or ...
0
votes
1answer
33 views

enter coordinates into web form and retrieve results with python

There is a web site that will take XY coordinates and return the closest county/route/postmile within california. I'd like to be able to access the site, enter XY values and retrieve ...
2
votes
1answer
60 views

How to use the math tool (“times”) in ArcGIS modelbuilder to multiply two raster sets while using an iterator?

I have two sets of rasters (in the same gdb), representing "loss" and "forestmask". I would like to multiply each forestmask raster (value 1 = forest) with its corresponding loss raster (value ...
2
votes
0answers
60 views

RGB satellite image in Python with Basemap

Can anyone recommend a workflow or python library that will let me work with RGB images and BaseMap (or something equivalent - could be CartoPy). I have Landsat 8 images, and can load one in python ...