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

learn more… | top users | synonyms

3
votes
2answers
511 views

Python: how to create a point shape-file from a text file

I'm writing a python code to read the points in a polygon shape-file and save them in a point shape file. I'm not sure about my approach so if you have a better idea (even if it is totally different ...
0
votes
2answers
329 views

problems with py2exe, shapely and fiona

I have a short python script, called test: import fiona with fiona.open("C:\\Essai_compil", 'r') as l_Obs_shp: for shp in l_Obs_shp: print shp['geometry'] I want to compile with ...
0
votes
1answer
123 views

Error with save path. Does not exist or is not supported

The final save raster file errors without message with Does not exist or is not support. But it does exist. If you can find anything wrong with this script I would be very greatfull. I had a vast ...
2
votes
1answer
492 views

How to use GROUP BY with arcpy.da.SearchCursor in file geodatabase?

fc = "C:\Users\AuxS3-4\Documents\ArcGIS/Default.gdb\Malla" fields = ('OBJECTID','Sentido','Carriles','idMalla') sqlclause=(None, "GROUP BY Sentido") cursor = arcpy.da.SearchCursor(fc, ...
1
vote
1answer
133 views

Python/GDAL: Best way to read in raster for use in A* search algortihm

I want to create a least cost path program with Python and GDAL since I couldn't find any open source cost path additions for use in Python. As recommended here the best approach is to use A* ...
1
vote
1answer
134 views

How to get a the minimum value of a raster layer in qgis with python? [closed]

I'm very new user of QGis and I work with landsat 5 images. In this framework, I would like to make an atmospheric correction subtracting the minimum value present in each band (1 to 4). My ...
1
vote
2answers
284 views

How do you get all the results from a Selection made by Attribute or Location using ArcPy?

Using arcpy I'm trying to get the results of a selection, or what is currently selected as a list. Basically I'm attempting to build an addin which on click will either perform an operation where I ...
1
vote
2answers
166 views

Using a different projection to calculate areas using the Field Calculator

I have a dataset that is in a WGS84_UTM projected coordinate system, can I force the Field Calculator to use another coordinate system when I use it to calculate areas using pythons ...
0
votes
0answers
79 views

Loop - convert layer to raster coming up blank

I am looping through files, selecting out building footprints one by one and converting the selected building footprint to a raster. The script worked fine for about 2 hours this morning then stopped ...
5
votes
2answers
602 views

Python: how to speed up spatial search (nearest point)?

I'm working on a program that determines the closest location from a given point. The point cloud I'm testing against is very big (~800.000). However, this doesn't really explain why my implementation ...
3
votes
2answers
459 views

Can we create a temporary in-memory geodatabase using python?

I have been using in-memory workspace for creating temporary features, but I was wondering if we could create a temporary in-memory geodatabase (using python) and then use it for importing other ...
1
vote
0answers
63 views

Should I move from ArcGIS modelbuilder to python? [closed]

I have been learning how to use ModelBuilder with ArcGIS 10.2, and I like that it shows me visually how to process data using ArcGIS's functions. I think visually. I see, however, many replies by ...
2
votes
1answer
322 views

ArcGIS 10.0 get sde information out of .mxd

The overall goal here is to iterate through several directories of .mxd files and document which SQL Server instance of SDE they are pointing to, with the database name and feature class names. All ...
0
votes
1answer
184 views

Better way to handle HDF and GeoTIFF files

I am using GDAL and MODIS reprojection tool in my python project and want to know better way for math new indices of HDF data (MODIS data). Also I want to visualize them in web. Which format is more ...
0
votes
1answer
126 views

ERROR: “Can't save to disk (check for space, write permission, or name)” while creating TIN in memory

I get the following error while creating TIN in memory : ERROR 999999: Error executing function. Can't save to disk (check for space, write permission, or name). Failed to execute (CreateTin). I ...
1
vote
1answer
525 views

How to create a feature class in memory?

I am trying to create a feature class in memory but I am not sure how to use the syntax. My code looks like this: FC = arcpy.CreateFeatureclass_management("", "in_memory/FC", "POLYGON", "", ...
1
vote
1answer
69 views

Model converted to Script - No editing mode? [closed]

I have a model that an ESRI associate sent me as an example. When I run the model everything is great. I click on the model and because the seleting features is a parameter, it automatically starts ...
4
votes
1answer
130 views

How to populate SQL options for ModelBuilder parameter from ArcSDE feature class?

I am creating a very basic model tool for a class project and I am running into trouble getting the SQL values to populate. I have read the ArcGIS 10: How to populate SQL options for parameter in tool ...
7
votes
2answers
927 views

Split a feature when intersecting with a feature of another layer using PyQGIS/Python?

I have a buffer layer (green polygon) which I want to split to two polygons whenever it crosses a barrier (blue line). I have been trying to use "splitGeometry" method, but I just can't get it to ...
2
votes
0answers
215 views

Buffering a Raster with GDAL and Numpy

I am using GDAL to convert a raster dataset into a numpy.array and then using numpy to buffer the data in the raster. For example, I need to know all the regions within 100ft of a school point ...
0
votes
1answer
501 views

How to obtain an extent of a whole shapefile?

I have got two shapefiles. One of them is a point shapefile and the second one is a polygon shapefile. I need to find out which of them has a larger extent and then set the environment extent to ...
0
votes
0answers
75 views

QGIS2.0 plugin with freeglut

Has anyone been successful in using QGIS 2.0 plugin which uses freeglut? I have tried all of the below to import freeglut but none of the freeglut functions are recogonized in my plugin. import ...
0
votes
0answers
61 views

Using arcpy.GetRasterProperties_management gives strange results

I have a loop which goes through folders and do some raster operations. Inside this loop I checked for a raster properties using arcpy.GetRasterProperties_management with NODATA parameter. And then ...
1
vote
1answer
177 views

Select a single entry using SearchCursor and create variable

I am trying to select a single entry of a floating point entry in a dbf table that contains 9 entries (sampled from a raster image), some of which is NULL using SearchCursor. I want to select one of ...
1
vote
4answers
420 views

Offline Python or C++ library for plotting locations on map?

I'd like to plot locations using longitude and latitude coordinates using Python or C++, is there a good library for such a task? I know that matplotlib is an option, I'm wondering if there are any ...
2
votes
0answers
89 views

Python scaling issues and possible subprocess conflicts?

I have always found such great analytical and programming expertise on StackExchange in the past that I hope you can help me. Background: I have a project that involves spatially joining and ...
1
vote
1answer
72 views

Field does not get updated with Geoprocessing Service

Can anybody tell why the field gets updated when I run this script in ArcMap but not when I run a geoprocessing service? Thanks #Import modules import os, sys, arcpy, traceback, arcgisscripting gp ...
1
vote
1answer
97 views

How to correctly use LIKE in the code block of a Reclass expression in ModelBuilder Calculate Field

I have a Reclass expression that works when i am search for single instance of a data field. I also wish the Reclass to work with a SQL type LIKE selection with Wildcards. e.g. I need to reclassify ...
0
votes
1answer
202 views

“shutil.rmtree” doesn't get rid of my intermediate folders

I have a script that works fine, but now I'd like to remove all the intermediate folders I created therein in order to save memory and to be clean. I've been trying using the "shutil.rmtree ()" ...
3
votes
1answer
209 views

How to programmatically detect a canvas refresh or pan/zoom in QGIS

For my python plugin I would like to remove a VertexMarker when the user pans/zooms there map. Which is the best way to detect a canvas refresh or pan/zoom carried out by the user? Can you suggest ...
5
votes
0answers
51 views

Altering the order of attributes in a table [duplicate]

I have gone through a sequence of table joins. The resultant table should be with the attributes rearranged in more logical order. I cannot find this functionality within Arc GIS or any mention of it ...
2
votes
2answers
51 views

Is there a way to replace just a specific character in a variable? [closed]

Here is an example township = township[3].replace("0", "") My goal being that if 10.0 is the current value for township I want to remove the zero after the . but not the one after the 1 with the ...
3
votes
1answer
318 views

How to render area that crosses 180°?

The problem is that the Chukotka Peninsula is located in the Western Hemisphere. So it is on the left side of Natural Earth Datasets. It needs to be moved to the right. I tried to use following ...
2
votes
2answers
63 views

Setting ProductCode for python script (Citrix environment)

I have set up a python script in ArcToolbox for our users. However when running it with ArcView 10.0 licensing the script fails with: ERROR 000824: The tool is not licensed I think it's an ...
2
votes
1answer
800 views

How to install QGIS 2.0 on Mint 15?

Trying to use QGIS 2.0 on Mint 15 (based on Ubuntu 13) I installed, uninstalled and re-installed QGIS from various repositories (ubuntugis-unstable, then qgis.org/debian raring - not clear for me ...
2
votes
0answers
36 views

ArcPy: Distortion towards edges when exporting to TIFF [duplicate]

I am writing a function to zoom to selection (based on a criteria) and Exporting it to TIFF. The problem I am getting is that the when I load the exported TIFF image in Map, I am seeing distortion ...
1
vote
1answer
633 views

GDAL loads in Python, but not IPython (Linux)

I am trying my hardest to utilize the work of the good folks at the GeoDa center, but I cannot seem to get all of the components to load. GDAL, in particular, has been giving me some difficulty. The ...
2
votes
2answers
160 views

How do I produce map images for Wikipedia?

I would like to make several map images (e.g. SVG or PNG) like those on wikipedia but in not popular projection. I am interested in scripting solution. Here I found this note: Generation Notes perl ...
1
vote
2answers
7k views

Export list of values into csv or txt file

I would like to know how to export in Arcgis a list of values calculated in python script into one of the following data formats: csv, txt, xls, dbase or other. I would also like to know how to create ...
1
vote
0answers
161 views

How to change the color of a selected feature with pyQGIS?

is it possible to change the color of a selected feature in qgis 1.8? To highlight a feature I use: vlayer.setSelectedFeatures(selectedList) box = vlayer.boundingBoxOfSelected() ...
1
vote
0answers
84 views

How to join attributes by location with command line

I would like to joint the attributes of 2 shapefiles by location but with a command line (linux). This feature is easy in QGIS but it is VERY slow. Is there a way of doing this with ogr or pyqgis ? ...
0
votes
0answers
23 views

Using sedac/GPW PopStats Service

I need to estimate population density based on a geographical area. I thought about using the Gridded Population of the World (GPW) service available here. Because I never used a RESTful WS before, ...
1
vote
0answers
180 views

merge_management

Here is the edited code: import arcpy import os from arcpy import env set the environment settings env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("Sub_NVF_*") ...
7
votes
2answers
176 views

How to access current job id from geoprocessing script running on esri server?

I want to programmatically access the current job id of a geoprocessing script running on ESRI 10.2. The script is what needs to know the job id, not the caller of the script. While searching, I ...
0
votes
1answer
168 views

Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a ...
3
votes
1answer
783 views

Getting the name of the mxd using python

I have a python script which reads through all the mxd's in a folder and changes their properties from relative file paths to absolute file paths. I now want to add a bit to the script to change the ...
2
votes
2answers
232 views

Does shapely within function identify inner holes?

I have a series of shapefiles that include both polygons and multipolygons. I am using ogr to extract them in wkb, and them I am using shapely to check if a point fall inside a polygon (or a ...
5
votes
1answer
279 views

ArcGIS - Python - Extend XY Line to Z Value

Long time reader, first time poster. So here's my goal: Working in ArcGIS, trying to work with Model Builder and Python Scripts. I have a series of lines and a single raster DEM. I'd like to extend ...
1
vote
1answer
241 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...
7
votes
1answer
207 views

Draw middle ordinate perpendicular to chord, out to curve, with arcpy

I've been assigned to find the radius of road curves. My boss found this article describing a pretty straightforward method of doing so: find the start/end points of the curve; create a chord; ...