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

learn more… | top users | synonyms

0
votes
0answers
15 views

Creating a link layer by connecting a point layer to a line layer

In the map shown below, I have manually created the dummy lines (in green). Using python, and without using PostGIS or sextante, I would like to automate the creation of these dummy links between a ...
3
votes
1answer
26 views

Pick random points in an earth circle

All I need is the ability to create random points within a radius of another point. so given self.fence.latitude and self.fence.longitude and self.fence.radius I should be able to generate random ...
1
vote
0answers
20 views

how to differentiate between common parts of the triangle and extract linestring from it

Can you help me break down shape A to different linestrings: lines 2 & 3 AND line 1? The shape contains three different polygons (A, B, C). I wish to determine the start/end point of each part ...
2
votes
0answers
19 views

Rounding error in qgis point sampling tool

I'm not sure if this is a bug or of it is due to the implementation. I am using a raster that has values greater than 1,000,000 and Qgis displays these numbers in a scientific notation. For instance, ...
0
votes
0answers
20 views

Python OGR, psycopg, postgis - geometry is null when updating

I'm attempting a python script that takes data from a file and updates only the geometry and a key field in a post gis table. But no matter what I try the geometry always seems to be updated null. ...
0
votes
1answer
53 views

While looping with arcpy: ERROR 010240: Could not save raster dataset

Hi I am very new to python coding and have been struggling with this for a while I cannot see the reason for this error! Any help will be greatly appreciated. Here is the code that is causing this ...
0
votes
1answer
37 views

How to append a vector layer using Qgis and Python?

I am working on scripting some data processing using Qgis and Python, but I'm running across issues that I need to debug. Since my data is really large, and run-times can be lengthy, I would like to ...
3
votes
2answers
49 views

use a selection of features in ArcMap in Python script

I am trying to write a python script and am stuck on the first obstacle. I want the user to select features in ArcMap and then use these selected features in a python script. Is that at all possible ...
1
vote
1answer
58 views

Looking for PyQGIS Syntax Examples/Guide

I am a long-time user of arcgis with intermediate experience python scripting for automation of geoprocessing workflows. I am moving towards using QGIS on the regular and I would like to dive into ...
3
votes
1answer
56 views

Iterating through an numpy array and index to a value in another numpy array

I am struggling to get this code to work I want to iterate through an numpy array and based on the result, index to a value in another numpy array and then save that in a new position based on that ...
4
votes
0answers
83 views

Finding the “center of gravity” of multiple points where points have unequal weights [closed]

I'm trying to reduce a set of lat/lons (each with it's own weight) into one lat/lon that is the center of mass of all of the points. however when I map the results the average point falls no where ...
2
votes
2answers
44 views

How to travers fields of records without introducing them all in the function?

In my previous question I wanted to reach a field in the field calculation; however, it was pretty easy to introduce a few more inputs for that function. Now, I am facing a problem which needs around ...
3
votes
2answers
83 views

Move the cursor backward - opposite of row = rows.next()

I'd appreciate if anyone could please tell me if there is a way to go up one row in python cursor. opposite of row = rows.next() Thank you!
4
votes
1answer
44 views

arcpy “The table name is invalid”

I wrote a script that, ideally, loads raw .las (LiDAR data) files into a geodatabase, then creates a terrain from the multipoint files that are created. When I run the script though I get: ...
5
votes
3answers
166 views

Migrate in a new programming GIS language

The last five years I have been working with VBA and ArcObjects for developing a specific application within ArcGIS. That project that began around 2008-2009 carried out with VBA and ArcObjects which ...
1
vote
2answers
58 views

Copying netCDF coordinate system

I have many NEXRAD precipitation netCDF files which I created from the raw files using the netCDF-Java API (ver. 4.3.17). I am now trying to compute monthly average rainfall rates and returning a new ...
6
votes
1answer
73 views

Python in ArcGIS: How to add a space between upper and lowercase letters in TOC

I'd like to use python to update the TOC by adding a space (white space) for layer names that are like this: "BoundaryBuffer" or "WaterEdge" and replace them with "Boundary Buffer" or "Water Edge". ...
-1
votes
1answer
38 views

Is it possible to import/run AML script into GRASS?

I have an AML script that has instructions to import tmp files of (grid, network, basin...) is there any way to run the script in GRASS? I tried to converted to Python but I couldn't do it for the ...
4
votes
4answers
82 views

How to rename a file in the output (ArcGIS python)?

raslist=arcpy.ListRasters() for ras in raslist: arcpy.ProjectRaster_management(ras,outfolder2+ras+'_Albers',spatialref2) print ras+' has been reprojected' I was using the above code for ...
3
votes
0answers
28 views

Using PROJ.4 library to transform from local coordinate system coordinates to global coordinate system using ground control points?

I have a point cloud whose coordinates are with respect to a local coordinate system. I also have ground control points with GPS values. Can I convert these local coordinates to a global coordinate ...
2
votes
1answer
51 views

How to sort features in a layer using OGR/Python?

How can I sort the features of an ogr layer by the values of a field? I tried naive variations of def sortlayer(ds, layer, field): lname = layer.GetName() lsort = ds.ExecuteSQL(b'select * ...
-1
votes
0answers
58 views

Beginner needs help with script [closed]

I am trying to get help with the following script. I am new to python and have been becoming increasingly lost. Can someone walk me through each step. I'd really appreciate it. ##### Step 1: ##### ...
0
votes
0answers
15 views

GRASS 6.4.3RC3, Python script and windows7

I'm trying to solve my problem for a long time. I hope someone can help me. I'm not expert but I really want to istall 2 add-on on grass 6.4.3RC3 on my win7. The add-ons are r.basin and r.ipso. I ...
1
vote
0answers
39 views

Why does XYToLine_management give ExecuteError ERROR 999999 The table was not found?

I've written this script to import a csv file using ArcGIS' flavor of python.. ArcPy.. It seems to run fine up until the XYtoLine tool runs and then it fails.. This is the error message... Traceback ...
0
votes
1answer
79 views

Can anyone tell me why my field calculator is returning this error?

All I am trying to do is pull into a text field, a section of another text field via: fieldB = !fieldA![some_index:other_index] However I keep receiving the error below and I can't figure out why. ...
0
votes
0answers
20 views

Python errore addons (win)

I have this type of error when I try to use r.ipso: C:\Program Files (x86)\GRASS GIS 6.4.3RC3\extrabin\python.exe: can't open file 'r.ipso.py': [Errno 2] No such file or directory while with r.basin ...
0
votes
0answers
7 views

Only accept alphanumeric characters and underscores for a string in python [migrated]

I'm currently writing validation code for a tool parameter in ArcMap 10 (updateMessages) and need to prevent users from using non-alphanumeric characters within a string as it will be used to name a ...
0
votes
0answers
33 views

Python script to create a point WITH attributes values

GIS platform: ArcGIS 10.1 I have coded up a Python script that determines the coordinates of where I need to create a new (calibration)point, but I can't work out how to add it to a feature class ...
0
votes
2answers
25 views

Why is Shapely not installing correctly?

I am trying to run Shapely on a new machine, and tried both installing it from source, using the installer on its webpage, and using pip install shapely. Every reference I try to make from the library ...
0
votes
1answer
32 views

OSRM API - nearest point fed into routing

I am using the OSRM API to (1) determine the nearest point on a road segment from a give random point with http://server:5000/nearest?loc=_lat_,_lon_ The returned coordinates are used then as an ...
1
vote
1answer
43 views

Can I add a feature class to an MXD with Python?

I'm using ArcGIS 10.1 and am trying to add a feature class that I create to an MXD, so that I can join to it. This all needs to be done using Python. Is this possible?
1
vote
0answers
25 views

Create a plugin in QGIS-

i want to develop a plugin in QGIS to access to my database in postgres : i want to import a file.sql that contains my SQL Code in a textbox , and execute this code to assign myd database. Any ...
0
votes
0answers
34 views

Field Calculator to count number of dupliceted recordes at another field [duplicate]

How To Use the Field Calculator python script to count the number of duplicated records of a field "A" and get the count at another field "B" Thanks for the help Geog
0
votes
2answers
89 views

How to install Shapely, but got stuck into Python language

I have a MAC OSX 10.7.5 and am trying to learn how to use QGIS. Following a couple of tutorials I came to know I have to install shapely. I followed the instructions by the multi-cited ...
7
votes
2answers
187 views

Is there a compelling case to learn/use Python Toolboxes (new at ArcGIS 10.1) over Python Script Tools?

I've written a few Python Toolboxes (which are new at ArcGIS 10.1), but am yet to decide whether/when I should write them rather than Python Script Tools in a standard toolbox. I thought the Online ...
2
votes
0answers
45 views

returning exceptions to user via AGS REST

I've got a python script that I run as a standalone and as a gp service in AGS (moving to 10.1 now...). For the standalone execution, I'm throwing a custom exception if there is no data found based on ...
2
votes
0answers
28 views

Is there any way to symbolize a user-supplied input parameter in ModelBuilder?

I have a model built in ESRI ModelBuilder that is run from its tool dialog, where the user supplies the input feature layer that then gets processed in the model. I need the input feature layer to ...
0
votes
1answer
35 views

r.basin.py GRASS addon

I have added this add on with g.extension on my grass 6.4.3RC3. But it doesnt work... this is the error I can see: Traceback (most recent call last): File "C:\Program Files (x86)\GRASS GIS ...
0
votes
0answers
48 views

ogr.GetDriverByName('FileGDB') returns None

I installed: gdal-110-1600-x64-core.msi GDAL-1.10.0.win-amd64-py2.7.msi gdal-110-1600-x64-filegdb.msi from www.gisinternals.com I can open my gdb on the command line: C:\data>ogrinfo ...
0
votes
0answers
20 views

Mapnik and Tilecache performance issue

I am working on GIS based web application using Mapnik and Tilecache with backend python. To display map in the browser, openlayers is used. Maps are generated by calling tilecache cgi url. I am ...
0
votes
1answer
33 views

Save longitude and latitude in Django

I had plotted a Javascript gMap.Using the marker,the values of latitude and longitude are displayed.I need to get that values and save it to database.What is the best way to do this and ,How to ...
3
votes
1answer
56 views

How to get default parameter value for script tool from csv file?

I am fairly new to python scripting. I have just figured out how to read and write input parameters for a python script from a csv file. Now I am being asked to pre-populate the script tool dialog in ...
1
vote
2answers
61 views

Python select by attribute using a variable counter

I am brand new to python and trying to learn how to do some simple loops but I have hit a snag. Below is what I am working with, I am trying to select the polygon row by row, but I keep getting EOL ...
3
votes
3answers
81 views

calculating a field in which null values may be present

I would like to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have null values for one or more of the fields. For example, ...
0
votes
0answers
28 views

code isn't creating an output file (ogr2ogr w/ python)

I have a python code that clips a shp file w/ a shp file using the gdal/ogr library. It seems to work but it does not create an output file. import subprocess # The features used to clip the input ...
2
votes
1answer
48 views

Error when using gdal/ogr and python to clip a “shp” file by a “shp” [duplicate]

I am new to the gdal/ogr library for python and I was wondering how to clip a shp file by another shp file. I think I am having trouble with the syntax. Thanks - Stefan I keep getting a windows error ...
0
votes
0answers
20 views

Drillhole Plan Trace in Arc [duplicate]

I'm struggling to find the math to do what I want. I want to plot a top down view of a drillhole in ArcMAP 10.0. I have the beginning UTM coordinate and then for every place in the hole that was ...
0
votes
0answers
52 views

Remove last 5 characters from Feature classes names

I need to remove the last 5 characters from all feature classes in a mssql database by removing the last 5 letters. I have MYSQLServer 2008 R, ArcGIS Server 10.0 Enterprise Standard, Arcsde 9.3 with ...
1
vote
1answer
42 views

How to reach a field value of a record in field calculator in ArcGIS 10.1

I have two fields showing number of people in two age groups "young" and "old". these people also live in a cell (point) whose distance to a specific facility is calculated. then I categorized these ...
1
vote
1answer
49 views

Trigger a python script to run after a row is added to the feature class

I have a Python script which runs on a SDE feature class daily (as a scheduled task). I would actually like this script to run whenever a new row is added to the feature class (data is captured in the ...

1 2 3 4 5 39