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

learn more… | top users | synonyms

1
vote
3answers
127 views

Problem with python script to control GRASS GIS from outside - How to import grass.script under Win 8.1?

I am working with GRASS 6.4.3 and python 2.7.6 under WIN 8.1. I am a novice with computer science and coding, and I have seen many posts including those:Is it possible to use GRASS GIS in Python ...
1
vote
0answers
43 views

How can I draw features on GeoTIFF in Python?

I have a set of data (coords + value) and want to turn it into a heatmap in GeoTIFF. Should I calculate pixels and set them as array, or there are shortcuts? This is what I do now: driver = ...
0
votes
1answer
45 views

automatic save outputs variables in the folder workspace using pyhon for arc map 10.1

I want to create python script with aim to import him in environment arcmap 10.1 and to make a hydrologic analysis because the scipt meybe can have many outputs raster file or feature class would ...
0
votes
1answer
39 views

visualize bounding box to a polygon

I try to make plugin in QGIS that compare 2 bounding box data, ex: (-32.61442167739459, -32.017601026186576, 13.015663782506067, 13.428145228091406) and (-38.6102467739459, -38.017601026186576, ...
0
votes
1answer
67 views

Using Python for Polygon Neighbors Analysis in ArcGIS 10.1: Script producing erroneous results

I'm struggling with a python script that is supposed to calculate a field for a polygon feature class. The calculation is of the average of a field value (P_TOT_DEV) for each of a given polygon's ...
3
votes
3answers
176 views

PostGIS: parse geometry wkb with OGR

I'm trying to pull a LineString geometry out of PostGIS and parse it with OGR (python bindinds). from osgeo import ogr import psycopg2 connection = psycopg2.connect("...") cursor = ...
1
vote
0answers
16 views

Able to circumvent QgsCredentials script called from Pre-execution

I've got a stored project that, when opened is connecting to my PostgreSQL DB, and is loading several layers. All good. I'm using a script that is called from Pre-execution (Processing/Options and ...
0
votes
0answers
41 views

Using ArcPy, is there a way to change the color of a symbol in a UniqueValuesSymbology object?

I have an template mxd I reference with several pre-defined layers. The only variable I need to modify is the color of certain symbols in the layer. I have tried to modify and dig around the Symbology ...
0
votes
2answers
70 views

I get an ERROR 000622 when it checks for arcpy.DefineProjection_management

So the purpose of my code is to create a loop that copies shapefiles from a folder to my folder and change its projection 'GCS_WGS_1984'. Each shapefile starts with the year follow by the month and ...
0
votes
2answers
41 views

What output colour format is expected by the QGIS data defined properties widget?

I'm trying to write a python function that takes a BGSREF attribute from a BGS geology shapefile and uses it to colour up the geology polygons of a shapefile. I posted my non-code working as a part ...
0
votes
0answers
34 views

Nearest road in the vicinity of a point without queries (openstreetmap)

I know that many similar questions about map fitting have been asked. Everywhere there were answers about sql queries like this: SELECT ST_AsText (ST_ClosestPoint (pt, line)) AS cp_pt_line, ...
1
vote
1answer
33 views

Tick boxes for a qgis plugin written in python

in a python plugin for qgis I want the user to be able to select one or more of several options via tick boxes. I imagine it to look like e.g. Qgis 2.2 tool "Vector" -> "Data Management Tools" -> ...
0
votes
0answers
36 views

QGIS Plugin to open metadata and show metadata information

I try make plugin to open and read metadata (.xml) and show information inside metadata like map scale, map fiture and bounding box and auto fill it to QLineEdit This code i use to open metadata ...
1
vote
0answers
33 views

ArcGIS Geoprocessing Service fails on data loading

I have a Desktop Script tool that works fine when run on desktop, but does not work when the results are turned into a geoprocessing serice. Running ArcGIS 10.2 on Desktop and 10.2 on server. I have ...
1
vote
1answer
72 views

Load and display a layer using PYQGIS

I'm having a go at using pyqgis from within the QGIS python console to load a layer from SQL Server and display it. I feel like I'm part way there but I'm having a real issue getting the layer to ...
0
votes
0answers
34 views

Getting “Segmentation fault: 11” with ogr in Python

This is the code I'm trying to run: In [1]: from osgeo import ogr In [2]: datasource = ogr.Open('testdata.shp') In [3]: datasource.GetLayerCount() Out[3]: 1 In [4]: layer = ...
0
votes
0answers
34 views

Suggestions on how to create an Owner Index for a Plat Book?

I've been tasked with creating a county wide plat book for publication this june. The cartography portion is fairly straightforward as I am using ESRI's Data Driven pages for ArcInfo 10 to produce the ...
0
votes
0answers
35 views

Algorithm to find coordinates at selected intervals along a polyline?

I am developing an algorithm to search down a river at selected intervals and return the coordinates. See below: def Downstream(start, interval, data, offset=0, out=None): if out is None: ...
2
votes
0answers
62 views

How to detect broken hyperlinks with arcpy?

I have zero experience with python but am trying to search for broken hyperlinks in a large gdb (temporarily converted to a shapefile)- Used code from a previous question (Hyperlink broken path - ...
2
votes
2answers
57 views

How do I load mapinfo mid/mif into geopandas?

I suspect this is a trivial question to answer but how do I load mapinfo mid/mif files into geopandas? While it's trivial to load and manipulate .shp files, I can't work out what code to use: Here's ...
1
vote
4answers
63 views

Formula to Check Latitude & Longitude is within Area without Google Maps Api

I got this Example Map SampleMap: http://techinfo.co.id/test/map.php I make Boundary Polygon shape , -6.875165174925262, 107.56293296813965 -6.882663904407988, 107.66730308532715 ...
2
votes
1answer
57 views

How to Export multiple selected features to PDFs with Python?

I have 77 polygons that mark areas of a satellite image that I want to export as separate PDFs. Each of the PDFs should contain just the polygon (and as much as the surroundings to fill out the data ...
3
votes
1answer
45 views

How to get output value from Feature Compare (schema) and append to existing csv?

I am working on a data integration project and am trying to single out feature classes which have a schema that varies from two base feature classes (one for point, one for polyline features). I've ...
-1
votes
1answer
44 views

NameError: name 'QImage' is not defined [closed]

Traceback (most recent call last): File "", line 1, in File "F:/QGIS/bin/test.py", line 6, in img = QImage(QSize(800,600), QImage.Format_ARGB32_Premultiplied) NameError: name 'QImage' is not ...
0
votes
0answers
56 views

Error getting spatial reference as string in arcpy

I am trying to get the string associated with a spatial reference to print into an xml using arcpy and xml.cElementTree. Using the snippet: ... spatial_ref = arcpy.GetParameterAsText(3) ... Prj = ...
1
vote
1answer
23 views

How to refer to a variable from the conditional statement in the ExtractByAttributes function in ArcGIS 10?

Trying to use the ExtractByAttributes for rasters so that I have multiple attribute values that I want to extract. This works fine: myraster = arcpy.sa.ExtractByAttributes("source_raster", "VALUE IN ...
0
votes
1answer
60 views

Python Built-in Map and Zip function in QGIS 2.0 Processing Script--syntax error

I am attempting to run my Python script using the Processing Toolbox in QGIS 2.0. I've used the built-in Python function map() and zip() several times and am now receiving a syntax error even though ...
0
votes
1answer
42 views

Programmatically modify attributes for vector layer in QGIS

I am trying to programmatically modify attributes for a vector layer, using calculated values currently stocked in a dictionary. Any pointers on where i'm going wrong? my dictionary has the feature ...
3
votes
3answers
310 views

Intermediate Data in Python Code

Is there a way to incorporate intermediate data (so that I do not have to select an output save location) in a python script that I turned into a tool? import arcpy, os from arcpy import env ...
1
vote
2answers
51 views

ArcServer 10.1- Get Original Document location (mxd) from published web service using python

I need to extract the document location of a published web service. Is there any way this can be accomplished in python? I know where the maps are sitting on the server, and i know the name of the ...
0
votes
1answer
47 views

Best Way to Get a List of Selected Rows for a Specific Layer using Layer Object in ArcGIS

What is the fastest/cleanest way to get a collection of rows that are selected in a certain layer? For some background, I am trying to hide selected features in a specified layer. The solution ...
0
votes
1answer
35 views

How to restrict read only *.mxd file?

I have an *.mxd file and I don't want to save any edits to it after each session. Is there a way in 'arcpy' or python in general to restrict edit of *.mxd file? Any suggestions would be appreciative.
1
vote
2answers
70 views

Add joined data in fiona with new schema

Looked more closely at problem on how to add data to a shapefile using fiona. Docs for fiona very unclear on how to do this. I know how to add a schema after that looks very unwieldy and can not ...
1
vote
0answers
71 views

How to use paths with non ASCII characters for subprocess calls with ArcGIS

I know that it is possible to create calls using unicode character encoding like \xf8 for non ASCII characters but how do I do it writing a path in a script just like: 'e:\gis\python_ø\notepad.exe' ...
7
votes
1answer
416 views

What Lidar processing tools are available in Python?

I have been using FUSION and the command line FUSION Lidar Toolkit (LTK) to process Lidar data. A broad Google search ("Lidar Python") yielded libLAS and pyLAS as Python lidar libraries, however, ...
1
vote
1answer
57 views

Gdalinfo and QuantumGIS does not recognize Spatial Reference even though Python does

I apply the following Spatial Reference to a file: spatialRef = osr.SpatialReference() spatialRef.ImportFromEPSG(3411) outraster.SetProjection(spatialRef.ExportToWkt() ) geotransform = ...
1
vote
0answers
30 views

How to replace accented strings in attribute tables using Python or VBA ArcGIS 10.2 [duplicate]

I need to replace accented words, into the Field Calculator, to the same non-accented ones. For example: María ---> Maria Need some help with this VB Code: Dim data as integer Dim contador Dim ...
1
vote
1answer
52 views

Python package for processing GRIB data in windows

I would like to know what python packages can be used to process GRIB (Gridded Binary) data on a Windows system. I know there is something called pygrib, but to use that I have to use cygwin windows ...
1
vote
1answer
38 views

How to “Apply Edits” to an ArcGIS Server edit session using Python

ArcGIS Server allows the user to apply edits in an editable layer. Eg the sample layer at http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/3/applyEdits will accept a ...
0
votes
2answers
208 views

Qgis - Couldn't load plugin 'processing' - name 'QsciLexerCustom' is not defined - Manjaro

UPDATED I receive the following error when I start Qgis: Couldn't load plugin 'processing' from ['/usr/share/qgis/python', '/home/v/.qgis2/python', '/home/v/.qgis2/python/plugins', ...
1
vote
0answers
12 views

ArcGIS 000210 error copy to feature class [duplicate]

I have a script tool that: Creates a feature dataset within a file geodatabase Performs a Select by Attributes on a cadastral layer Copies the selected polygons into the feature dataset. The copied ...
2
votes
2answers
115 views

What is the most efficient way to iterate through folders and geodatabases?

I am looking at cataloging some data, and I have code that works, it just seems to take a lot of time to run through all of the items. The way this data is structured is a bit of a hindrance, ...
0
votes
1answer
80 views

How to use for loop to add and calculate new field?

I am trying to use for loop to add and calculate a newfield for 2 shapefiles and a different new field for 2 other shapefiles. When I tried to do these 2 loops as one, it did not work so I separated ...
2
votes
1answer
111 views

Python Mapping in Matplotlib Cartopy Color One Country

I have plotted a map of the world using matplotlib Cartopy. Now I want to select a specific country in the map in this case the United States and change the color. I think this is possible but not ...
2
votes
2answers
105 views

How to trim strings in Field Calculator?

I am currently working on a County plat book and am in the process of prepping the "Owner_Nm" field that will serve as my annotation layer. I am trying to whittle down the owner names, based on ...
2
votes
0answers
48 views

Identify different networks inside a line shapefile

I'm dealing with a quite big line shapefile containing road tracks. The roads are connected to each other, creating distinct networks. These networks are independent and they are not connected to each ...
0
votes
1answer
61 views

PyQt4 pushbutton not connecting for my QGIS plugin

I'm trying to display information in a text browser with the push of a button in my QGIS plugin. The .ui is created using PyQt4 (button's object name is calcConso). No error message, but the button ...
5
votes
0answers
77 views

Calling external files in Python Geoprocessing Service

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
0
votes
1answer
54 views

How to get from Lat/Lon to this format?

I have twitter data with coordinates such as: [-7.2377761, 112.73091137] I'm working with a python geo library called osgeo. The sample code indicates creating a point like this. point = ...
1
vote
2answers
98 views

From coordinates find country using Python

I have tweets with coordinates. I'm trying to bucket the tweets by country using the coordinate information. I know that I can achieve this using some hosted web services but all of these have API ...