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

learn more… | top users | synonyms

1
vote
0answers
89 views

Python Script Producing Empty Cost Path Rasters

I'm trying to run a script that will create cost paths for a large number of randomly generated points then assign the cost to those points. But my script is beginning to create cost path rasters ...
1
vote
0answers
221 views

Install shapely for QGIS on Mac

I know there are a number of similar questions, but none of them have answers that allow me to use shapely in QGIS. In particular I am trying to install the Contour plugin, but this fails with the ...
1
vote
0answers
73 views

Subset a GeoTIFF image into regular grids and extract mean latitude, mean longitude, and mean RGB for each grid

How can I subset a GeoTIFF image with 1000 by 1000 pixels into regular square grids of 50 by 50 pixels (400 grid objects in total); and calculate mean latitude, mean longitude, and mean RGB for each ...
1
vote
0answers
194 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 ...
1
vote
0answers
219 views

Python Addin toolbar- Environment mask parameter not being recognised?

I've created a button on a python addin toolbar which uses the selected features from the selected layer in the TOC, creates a feature layer from that selection and uses that feature layer to set the ...
1
vote
0answers
177 views

How to write vector layer to csv file with geometry by PYTHON?

I use Python try to write vector layer file to csv file with this code QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV") It can export to xyz.csv but only ...
1
vote
1answer
171 views

OD cost matrix Arcpy [closed]

I'm trying to create an OD cost matrix python script. I'm doing an OD cost matrix analysis. I'll find out the average time with patients to hospitals over 10 years. When I do this analysis, the ...
1
vote
0answers
149 views

Change ArcGIS License using Script [duplicate]

I am using ArcGIS Desktop 10 and we have three different servers for accessing concurrent use licenses of ArcView, ArcEditor and ArcInfo. So, whenever I need to switch to other product, I have close ...
1
vote
0answers
242 views

Calculating the Centroid of polygon in modelbuilder (VBA to Python) [closed]

Got an easy one, that's got me stuck. I'm moving some models that were created in 9.3.1 to work in 10. Part of the model is calculating the X coordinate of a polygon to a specified field. The code ...
1
vote
0answers
70 views

Python GDAL/OGR: check lines geometries connectivity

I'm working with shapefiles representing roads, so basically it's stored as (poly)lines. I need to perform a road connectivity checking. In other words, I want to ensure that roads meant to ...
1
vote
0answers
141 views

Problems running zonal statistics - not all zones represented

I have been working on a Python script to automate the steps illustrated by whuber here:Create points around the edge of viewshed results I am trying to create a horizon graph illustrating the ...
1
vote
0answers
21 views

Calculate complete spatial randomness using Python [duplicate]

I currently use the csr() function from Splancs for R (http://cran.r-project.org/web/packages/splancs/splancs.pdf) to calculate complete spatial randomness (CSR) points to be used for spatial ...
1
vote
0answers
164 views

How to embed a PDF into an Excel spreadsheet? [closed]

This is what I want to do: Create report using a polygon feature class to output areas of polygons using some logic and the ExportReport() function (This I have accomplished) Create a PDF of the ...
1
vote
1answer
88 views

How to Average neighboring county data and store in original?

I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
1
vote
0answers
121 views

Averaging satellite data with missing values (using Python)

I am using sea surface temperature, chlorophyll, and other data parameters as covariants in a model, and I would like to average them over a particular time period. I am currently doing this using a ...
1
vote
0answers
93 views

How to programmatically change an SVG symbol in the Vector Layer?

I'm trying to change the symbol used in a layer via Python. I've been able to tunnel through a vector layer to the symbol layer, but I don't know how to change the symbol it's using. I'd like to ...
1
vote
0answers
58 views

Clipping Buffers

I have buffered a line shapefile where many lines are intersecting but not broken at intersections. I am trying to select each record in the buffer file and clip all intersecting polygons in the same ...
1
vote
0answers
47 views

How to identify grid shift file used by osgeo in Python?

I wrote a Python script reprojecting points from a source coordinate reference system (SCRS) to a target one (TCRS) both identified by an EPSG code. I would like my python script to retrieve details ...
1
vote
1answer
170 views

How can I change SQL query through a layer of an action (python)?

I have three layers from three diferent database tables. When I click in other layer I want to change (with an action) the query of that three layers. How can I do that? Thank you
1
vote
0answers
229 views

How to transfer the attributes of features based on their spatial relationship?

I'd like to check if a point feature class is placed on a line feature using python in ArcGIS 10.0. I have created a set of point features and placed them directly on a group of line features at ...
1
vote
0answers
261 views

How to calculate average value within a polygon(in Qgis with Python)?

Now I have a point and polygon shapefile and I want to calculate the points' average value within each polygons How to do it with python? I tried to find out but google gives me a lot of raster ...
1
vote
0answers
88 views

Using Python to Switch Layout Templates

Using ArcMap 10.1: Since there is not a way to control portrait or landscape of the layout view through python, is there a way to switch layout templates without opening a new mxd through python? ...
1
vote
1answer
395 views

Why does Add Field to Layer File give “ERROR 000840: The value is not a Feature Layer”?

I'm trying to add a field to a layer file, but it always gives an error. What I did was making a closest facility layer and save the result as a layer and after that I tried to add a field, but then ...
1
vote
1answer
104 views

How to save after using fet.setFeatureId in pyQGIS?

By using the following code, I want to change the id of the line when saving the line. But the setFeatureId command, gives a false when doing the commitChanges(). Any idea how to change the id? vl = ...
1
vote
0answers
442 views

QGIS plugins with python dependencies [closed]

Problem: I have a Windows XP machine with Python 2.7.3 installed at ‘C:\Python27' and the scipy module installed at ‘C:\Python27\Lib\site-packages'. I installed QGIS 1.8 recently and started ...
1
vote
0answers
205 views

ArcPy error: Add Feature Class to Terrain.

I'm writing a script to convert lidar data (in .las format) into a terrain without going through all the clicking and so I can send it out to neighboring states with similar programs (I'm using ArcGIS ...
1
vote
0answers
296 views

Get the distance between 2 WGS84 GEOSGeometries

I currently want to check if 2 given GEOSGeometry objects of type Point are within 100m of each other. (length flexible) Looking at previous asked questions on this topic, most of the answers were ...
1
vote
0answers
84 views

Creating Raster with values based on function output

I have a function that calculates a price based on the input slope and distance. I want to write the price to a raster as the rastervalue. How do I do that? OpenSource and ArcMap solutions would work. ...
1
vote
2answers
108 views

How to acces features attributes when creating renderer?

I'm trying to customize the rendering of a point layer in QGIS using python. Thus I have written a renderer class as explained in the documentation ...
1
vote
0answers
87 views

Couldn't load SIP module - python disabled

Recently my QGIS started refusing to load SIP module, from day to day without any significant changes in the system (I'm on Windows7 x64). Message thrown at startup: Nie można wczytać modułu SIP. ...
1
vote
0answers
96 views

Can not import qgis.core in python

I installed OSGeo4W. I have no other Python version on my computer. I can import osgeo. But when I try to import qgis.core I am getting the error: >>> import qgis.core Traceback (most ...
1
vote
0answers
51 views

Python Program for “QC of PDFs Created from Data Driven Pages”

I need some help. I am fairly new to Python. I found a sample code and I need to change a couple things in it for it to work. I need it to make sure that all PDFs were created from the Data Driven ...
1
vote
0answers
59 views

Script Tool Problems ArcMap 10.0

I Have a scipt tool that runs when input shape files are added from the table of contents (added from drop down menu.) However this tool will not run when they shape files are added using the add file ...
1
vote
1answer
230 views

Cannot install TimeManager 0.7: no module named six

I was able to extract and copy dateutil to C:\OSGeo4W\apps\qgis\python\dateutil and the error saying that dateutil wasn't found disappeared. But now I am getting the error no module named six. Tried ...
1
vote
0answers
97 views

Is there an inbuilt arcpy method to insert a new line? [duplicate]

I need to extract a list of all the files and folders within a top level folder. My first thought was to use os.walk in a small python script as it is a simple task. However, I cannot run scripts on ...
1
vote
0answers
91 views

How to select from relationship class using python

Good day to all, How can i Imitate the "related table" button and move from selected feature to his relaetd feature using python ? Thanx alot Geog
1
vote
0answers
131 views

Why is not ST_GeomFromEWKB() working?

The following SQL is working fine from the terminal: SELECT MIN(ST_Distance( ST_Transform(ST_GeomFromText('POINT(-3.163916 55.926528)',4326),32630), ...
1
vote
0answers
92 views

Extract an ArcSDE datasets (rasters/shape files) using python?

I would like to write a python script to extract/export a dataset (rasters/shape files) in ArcSDE. I saw this posts to connect to the server: Define Workspace for SDE Connection in Python But how ...
1
vote
0answers
154 views

How to handle mmqgis geocoding IOError: [Errno socket error] [Errno 101]?

I try to geocode a .csv file with QGIS + mmqgis plugin. But, since some days the plugin always crashes. I tried it with QGIS 1.8.0 on an Ubuntu 11.10, OSGeo-Live v6.0 (which is Xubuntu 12.04.2 LTS) ...
1
vote
0answers
55 views

How to clip Raster using multiple polygons and Python? [duplicate]

Possible Duplicate: clipping a raster by multiple datasets or polygons I have polygon layer and DEM and I want to write a program using python to cut the raster into multi-raster based on ...
1
vote
0answers
30 views

Script for populating field in ArcGIS 10 with consecutive numbers (where start numbers is decided by me) [duplicate]

Possible Duplicate: How to add automate values to attribute field? I need a script (for Arc GIS 10) by which I can populate a field against some selected polygons features. For instance, i ...
1
vote
0answers
123 views

Table record counts change when using python tool

I have a python tool which investigates mxd files and clips/projects and exports all visible datasets. Recently I've found that the record counts (even on non-clipped data) is different. It's ok if I ...
1
vote
1answer
145 views

Difficulties in dissolving stream orders

I've been trying to dissolve streams, using orders programatically and I came across this VB script. The reason is that if I use ArcGIS dissolve, it merges the confluence of the same orders. I would ...
1
vote
3answers
114 views

Apply rotation before FeatureToRaster_conversion

I am converting polygon shapefiles to rasters. With arcpy I am using the function FeatureToRaster_conversion. gp.FeatureToRaster_conversion(InFeatures, InField, OutRaster, InCellSize) This function ...
1
vote
1answer
264 views

How to re-project the EASE (Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?

I have nc files ,here is one file https://echange-fichiers.inra.fr/get?k=LUfqiyO1Dl7az5bihnS. from the metadata ,the projection is cylindrical and the resolution is 25 km: ...
1
vote
0answers
123 views

problem in read_shp() to generate a networkx.DiGraph from point and line shapefiles

I tried to use the Python module networkx and specifically the read-shp () to ensure the transformation of a graph to a file sharpe but I always find this error noting that this is the first time I ...
1
vote
0answers
194 views

Morphometric and hydrological analysis with Python and ArcGIS

How can I write a program using python, that calculates some morphometric and drainage indexes using numeric attributes in the attribute table with ArcGIS? The data I have in my table are area and ...
1
vote
2answers
289 views

Using reader Feature Type Name as Writer Feature Type Name in FME

I've search and searched for a way to do this, but no method seems to work. Basically I want to use the input feature class name (feature type in FME) as the output name. This normally works, ...
1
vote
1answer
2k views

How to change the symbology of the layer with python script in ArcGIS ? [duplicate]

Possible Duplicate: Change Symbology of layers from within ArcMap I need to write a script to change the symbology of the layer. I've read all the topics about symbology in ArcGIS-help and ...
1
vote
0answers
226 views

How to update polygon field with point count for multiple rows? (Temporal point-in-polygon)

I have a shapefile with several regions. It contains basic info like ID, Code, Name1, Name2, etc. It is overlaid with a shapefile of points (nearly 200k). Each point represents an event with a type ...