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

learn more… | top users | synonyms

1
vote
0answers
13 views

Identify, Get, recover ArcGIS for Server (AGS) user?

have some one try or succed in recover the ArcGIS for Server (AGS) User name used in the connection, i need this cause i'm doing some edits to a Enterprise GDB, SQL Server with the same user and ...
2
votes
1answer
12 views

Intersect Shapefiles using Shapely

What I'd like to try and do is intersect some point buffers with census tracts, maintain their ID's and the tracts attributes. I found a sample from ...
1
vote
3answers
24 views

Subsetting a x,y,z text file with a polygon shapefile

I have a txt file with x,y,z format. The file size is almost 8 GB. So I don’t want to process in ArcMAP. What I wanted to do is, I have a polygon shapefile and I wanted to Clip all the points within ...
0
votes
0answers
9 views

Issue using Osmconvert with Python

I want to use osmconvert to parse down the size of my diff files for just the area I'm interested in because osmconvert is way faster than osm2pgsql, which loads the data. When I call the command ...
0
votes
0answers
17 views

Custom ArcGIS Server Backup Python Script

I am running into issues using the ArcGIS REST API import site operation because the server is federated with Portal and only has a domain certificate (i.e. not CA-signed). So I am looking for a ...
1
vote
1answer
67 views

How to work with accentuated strings in Python scripts in ArcGIS Desktop Field Calculator?

` pre-logic: def myCalc(name,nameVal): if (name == nameVal): return 1 else: return 0 var_name= myCalc(!Epulettipus!,"Lakóépület") ` This doesn't work with accentuated strings. (But ...
0
votes
2answers
43 views

Writing Python script in Field Calculator in ArcGIS Desktop?

I'm a programmer, I have programmed in C#, Java, but not with Python. And I'm not a geographic worker. How can I write a python script into Field Calculator to be able to check the other column value. ...
1
vote
0answers
20 views

Copying XY to clipboard using Python Add-In (ArcMap)

I am trying to create a simple tool to copy XY from where i click the mouse button. What i have done already is: create add-in files using Python Add-In Wizard create toolbar and tool inside it in ...
1
vote
0answers
13 views

Python 2.6 Module for GDAL 1.9.2, ImportError

I work on an internal network(IE I cant get the latest 1.11 stuff) and have GDAL 1.9.2 setup on a Red Hat Linux Enterprise Server 6. My linux box has python 2.6.6 however the python binding I received ...
0
votes
2answers
40 views

How to extract portion of a string for a field value

This is simple but driving me mad. I am using Modelbuilder to iterate through a folder of feature classes, and need to add a field that extracts a portion of the filename. Example: CF0140r01.shp I ...
0
votes
1answer
23 views

Properly writing floats to feature properties of a new shapefile in Fiona

The following piece of code is successfully returning a shp following the driver and crs of a model shp. But I cannot make it to hold the float values I am writing to it: import numpy as np #just to ...
0
votes
1answer
29 views

Poly shapefile using pyshp

I have a script for creating points shapefiles, but I can not fix it for make a new polyline shp file. I have obtained the data from a excel file and extract data in three differents lists ...
0
votes
1answer
18 views

osm2pgsql doesn't run in a QGis plugin

I have a problem with osm2pgsql when it runs in a qgis plugin. The function i use looks like this: osm2pgsql = "osm2pgsql -s -d {databaseName} -U {databaseUser} -H {databaseHost} -E ...
3
votes
3answers
41 views

Calculate field using variables as fields

When I calculate a field like this: field_0="field_name0" arcpy.CalculateField_management("Layer", field_0, '!field_name1! / !field_name2!', "PYTHON_9.3") It works! The field "field_name0" in the ...
0
votes
0answers
17 views

Fitting Time-series Values with a Gaussian Function

I'm trying to fit a stack of NDVI values to a Gaussian model to allow for determining dates of certain NDVI values using Python and NumPy/SciPy. I've attempted to do this with ...
1
vote
0answers
23 views

Reprojecting and Clipping in one script using Python Subprocess module and GDAL

I am trying to reproject a .tif file then clip it to the boundaries of a shapefile using GDAL Warp. I want to do this in a single script, and have successfully used the Python subprocess module to ...
0
votes
0answers
23 views

Is it possible to read shapefile field aliases values using fiona?

I am using fiona to read a shapefile, but not sure about how to get field aliases. Is this possible using this great library?
1
vote
1answer
38 views

How to add IDs of the links composing a polygon?

I built up a polygon layer from a road network for finding roundabouts using the compactness factor of a polygon. Then I have to intersect the extracted roundabout polygons with the road network so ...
2
votes
1answer
63 views

calling gdal_merge.py into another python script running GDAL processes

Good Afternoon All, I am wanting to use gdal_merge.py to merge a series of .tif files prior to clipping the merged file to a shapefile boundary, but want to do so as part of another larger script ...
4
votes
1answer
32 views

GP service (from Python script tool) time-out: how to execute finally: statement

I am trying to build more fail-management logic into some of the GP services I develop. As a part of the business logic within the script tool I build, I write some data into the tables and thus lock ...
-1
votes
0answers
20 views

My own base map in Python MatPlotLib

Is it possible to load my own base map for plotting data with matplotlib ? I have some problems trying to freeze a script with matplotlib Base map included. Then I think that I can use my own base ...
2
votes
1answer
82 views

ArcGIS 10.0, Field Calculator Nested “if” statement with strings

I need to assign a value depending on other two columns "FNP" and "Teilort". I wrote this script in phyton for field calculator. It actually works (no error messages) but the results in every cell is ...
2
votes
0answers
42 views

Correcting addresses with Python or Model Builder

I am trying to make a script in Python (or Model Builder in ArcGIS) for correcting addresses. I have a point shapefile with the addresses (it has X and Y, and fields for "number", "street name", and ...
4
votes
0answers
47 views

Why are my calls to SAGA routines in QGIS not working cross platform?

The ability to write and run cross platform scripts for QGIS using python is OUTSTANDING! However, when I try to run the SAGA:MERGESHAPESLAYERS algorithm from a python script it works fine in windows ...
1
vote
2answers
15 views

Converting a large set of GRIB2 files to a spreadsheet format

I have a large set of .pgrbf.grb2 files downloaded from the Climate Prediction Center, and I need to run statistical analyses comparing them to data that was produced locally in .csv format. I'm not ...
2
votes
1answer
47 views

problem transforming CRS coordinates EPSG:4269 to EPSG:3857 in python

source_srs = get_srs(shp_abs_path) source_epsg = source_srs.GetAttrValue("PROJCS|GEOGCS|AUTHORITY", 1) print source_epsg #prints 4269 target_epsg = 3857 # because these are headed to leafletjs ...
1
vote
1answer
36 views

Flip multiple vectors

I have thousands of vectors (out of several million) which I need to flip, for directionally purposes (Network Analyst). The vectors in question are annotated that their directionality has been ...
3
votes
1answer
96 views

How to convert polygon singleparts to multipart?

I am interested in converting a polygon featureclass created via Create Fishnet (Data Management) from singleparts to multipart. QGIS has a very handy tool called singleparts to multipart that does ...
1
vote
1answer
37 views

Open Source solution to batch process shortest distance between points along road networks?

I have the locations geocoded (a fairly small dataset, ~200), but I haven't found a straightforward way to load these data into QGIS and perform network analysis between nodes. Any suggestions? ...
0
votes
1answer
55 views

Creating Map from database

I'd like some general advice on creating dynamic maps. I have a bunch of geospatial points saved on SQL Server and PostgreSQL. People will enter new data into the databases from time to time. I want ...
2
votes
0answers
32 views

Nested conditional statement in ArcGIS on multiple rasters

I have a list of rasters in ArcGIS and I want to create a conditional (Con) nested statement based on all the rasters of the list. I want this to be reiterate through many lists (the number of rasters ...
6
votes
2answers
110 views

How to delete last part of a string starting from the 1st non numeric character? [closed]

I'm looking for a Python or VB statement to remove the last part of a string, starting where the 1st non Numeric character appears, using the Field Calculator in ArcMap 10. Here's an example of what ...
2
votes
0answers
41 views

ESRI's arcpy.asShape Bug Workaroud

I've read a few questions\answers about converting a GeoJSON Shape into an ESRI Object. Unfortunately most of the answers pointed to decoding the dictionary's manually. Im a bit more lazy ^_^ The ...
4
votes
0answers
47 views

Focal Statistics for Special Neighborhood

I'm looking to calculate focal statistics for each cell of a raster, within a neighborhood of a specified criteria. Background - I have three binary rasters, each representing a single vegetation ...
0
votes
1answer
41 views

Arcpy MakeFeatureLayer won't loop

The arcpy snippet below is intended to generate a list of technicians scheduled to work, and then generates a unique feature layer for each one's stops. fcStops = "TaskRoute1016" with ...
1
vote
1answer
45 views

Fiona + Shapely: Loading a set of LineStrings and writing their centroids to a shapefile, including original properties

I am using Fiona to load a set of links. Then I put every record in the rows of a pandas.DataFrame. Then I get the centroid of each LineString using Shapely. Afterwards I copy the schema of the ...
1
vote
1answer
22 views

To count the number of grid cells in a polygon

Is there a way ArcGIS could count the number of 15 seconds interval grid cells within a polygon after digitizing that polygon. This should appear in a field in the attribute table.
3
votes
1answer
46 views

Track progress of running GP tools (in arcpy script) programmatically?

I am looking for a way to access a GP tool running in a Python script to be able to see how much of the job has already been done. I have found SetProgressor function, but this one is available only ...
1
vote
2answers
22 views

Store result from gdallocationinfo as variable in python?

I'm trying to find the cell value at various locations in a set of rasters so I can count the number of real values (aka not 'NoData') that occur at all the locations within each raster. The various ...
1
vote
1answer
28 views

arcpy geometry difference method fails randomly, not reproducible

Has anyone used the arcpy geometry difference operator and seen unexplained errors like what I describe below? This is a weird one. I have a script that calculates wave fetch distance in the ocean ...
2
votes
1answer
51 views

Changes not persisting in ArcGIS server from ArcPy script

I have a ArcPy script (10.2) which connects to an ArcGIS server (10.0) versioned geodatabase, via an .sde connection file in the Database connections directory through direct connect on a Microsoft ...
3
votes
1answer
36 views

shapefile record has no attribute named bounds

This is the code that I am using to print the bounds of my shapefile. import fiona import shapely import shapely.geometry fc = fiona.open("filename.shp") shapefile_record = fc.next() shape = ...
2
votes
0answers
24 views

How to move feature using python console in qgis

i am building a qgis plugin that can create as much copies of a selected feature as i want and paste it to my required place.I have code to copy and paste feature select = ...
2
votes
1answer
35 views

Subset multiband tiff file using Python in ArcGIS for Desktop?

I have a multiband (1140) raster file in tiff format that I want to subset. Each band represents a prediction of monthly rainfall (12 bands for each year) over a 95 year period (12*95=1140). I need to ...
3
votes
3answers
73 views

Proj4 String for NAD83(2011) / Louisiana South (ftUS)

I am trying to convert NAD83(2011) / Louisiana South (ftUS) coordinates on survey maps to lat/lon using Proj4 in Python. Could someone please point me in the right direction? I have verified the ...
3
votes
1answer
49 views

How to automate the execution of Python console in QGIS?

I want to automate the execution of Python console in QGIS. When QGIS start, Python console starts at the same time, and Python predetermined code wants to be executed. Currently, in order to ...
2
votes
0answers
32 views

Kartograph - AttributeError: _Shape instance has no attribute 'parts'

I am new to GIS and open source tools so bear with me. I am attempting to convert a shapefile to svg by running kartograph as a python module. My source file (provided by the local GIS ...
1
vote
0answers
20 views

How to freeze basemap using cx_freeze

I am working on script and I´d like to freeze it for use in computers who haven´t got python installed- The script is running fine but when I freeze it using cx_freeze an error appears. at the end ...
3
votes
1answer
57 views

How to interpolate point set into value contours?

The task at hand is creating 'isobar' value contours that are interpolated from a point field of either the x/y or lat/lon type. I really have no idea where to begin mainly because this needs to be ...
1
vote
1answer
31 views

Why does QGIS 2.4 prematurely terminates on startup at “Starting Python”?

After reinstalling Python (3.4) as well as OSGeo4W and the QGIS Standalone, my QGIS always crashed when "Starting Python" on my Windows 7 64 Bit environment. It simply did not proceed to the QGIS-GUI ...