Version 2.7 of the Python programming language

learn more… | top users | synonyms (1)

1
vote
0answers
24 views

Image orthorectification with XYZ and roll, pitch and yaw

There are a lot of raw images taken by UAV and the only parameters that I have are XYZ and roll, pitch, yaw in excel spreadsheet. I've been trying to orthorectify these images with ArcGIS, Er mapper ...
3
votes
2answers
38 views

Converting Python GDALDataset to C++ GDALDataset

I'm currently writing a C++ extension to python to speed up a raster data viewer which is running extremely slowly with our large datasets. I've managed to get a small speedup by writing a C++ ...
0
votes
1answer
48 views

Extracting channel banks from DEM and channel newtork

Currently I am working in project that require from me extracting channel banks. I have been thinking about the best method that I can use to come up with good function that extract the location of ...
1
vote
1answer
88 views

Trying to increment a field value for only the repeated records in a feature class using Python

NOTE: If you look at the excel tables just above the comment section it will give a clearer picture of what I want to achieve in my code. So the code below works in doing what I want it to do thus ...
0
votes
1answer
54 views

Calculating several cells into one cell in same table using ArcPy

I'm very new to Python and scripting in ArcGIS. I need to calculate some cells from one field in table into another one cell in another field in same table. Here's what i need: Here's what i try ...
0
votes
0answers
52 views

Merging selected features in one DBF table (polygons) using ArcPy?

Im absolutely new to Python and programming. How can i merge selected features in one DBF table (polygons) using Python in ArcGIS 10.2 for Desktop? Here's what i need: Here's what i've got: ...
2
votes
2answers
54 views

Update a group layer using arcpy

I work with several MXD'S and i try to update a group layer named "allHa" containing several layers with this code: import arcpy,os,sys,string import arcpy.mapping from arcpy import env ...
1
vote
0answers
41 views

How can i set layer polygon in center in QGIS using python?

I am trying to set a fixed zoom level whenever I layer is shifting on different polygon. I have coordinates for all the polygons , I need each polygon to be on center with certain zoom level so that ...
1
vote
0answers
35 views

Label layout on python in QGIS

Now the only issue is that in image I am not getting the labels, I have on polygon. Please help in that too Please see above attached screenshots here I need labels – I have updated QGIS it's version ...
3
votes
1answer
57 views

Layout show label and each polygon make serrated image

I want to develop "Print lay out functionality", but in output system is giving me whole image, I want to print only selected polygon. Also it is not displaying label names on print image. Please ...
2
votes
0answers
87 views

display of raster in QGIS - cells are not rotated

when viewing rotated rasters in QGIS - the overall raster is rotated (as designed), though each grid cell is not. (the nodata value doesn't appear to pick up as the default in QGIS either - ...
0
votes
0answers
29 views

Problem with Mapscript using QGIS 2.6.1 on Mac OS X

I would like to use the RT MapServer Exporter plugin of QGIS. I have Mapserver 6.4 and Python 2.7.11 both installed with Homebrew and Python 2.7.5 installed by default on my Mac. The Mapscript python ...
0
votes
1answer
80 views

ArcPy and File Geodatabase Character Encoding

I have a JSON file containing special characters, which can be represented in Unicode. However, as soon as I export that JSON file to a file geodatabase using arcpy, the special characters all ...
4
votes
1answer
84 views

Drawing polygon in qgs map canvas

I want to make a custom application which includes an option just like the "Select Features by Polygon" feature in the qgis. I am able to draw the polygon using following code: self.rb = ...
1
vote
0answers
48 views

How to change default symbol in Categorized symbol renderer (python console) or use different icons as vector layer symbols?

I have a point shapefile in QGIS 2.10 and I want to display one of its fields attributes based on its unique values (I always know that it has 4 unique values and their values so I do not care for the ...
2
votes
1answer
51 views

pyQGIS Plugin Window Behavior?

I have made the UI of a qgis plugin using qt creator. What I want is that the plugin window should stay on top of the qgis main window only but not other other applications. I have got this code: ...
1
vote
0answers
40 views

Creating spatial layer from MS SQL Server table?

I have a table in MSSQL that I am trying to use to create a spatial layer from using the QgsVectorLayer function to load the table as a layer, and then using Fiona to create a shapefile but I am ...
1
vote
1answer
70 views

Pretty table python module with variable number of rows [closed]

Is there a way to produce a table in a txt file using pretty table python module, using an i variable for the row count for the case I do not know the number of rows from the begining? For example I ...
2
votes
1answer
80 views

tile_writer: How to set PYTHONPATH? [closed]

I am a self-taught QGIS user with low computer skills, and therefore a frequent visitor to this forum. This is my first question. I run QGIS 2.10 on Ubuntu 15.10. I am trying to use Alexander Hajmal's ...
1
vote
1answer
38 views

Problem replicating ArcGIS Grouping Analysis 'grouping effectiveness' statistic results

I posted this question over on Esri's GeoNet, but have not yet gotten an answer. Using ArcGIS v10.2.1, I have been using the Grouping Analysis tool to generate a range of clusters from my data. I ...
4
votes
1answer
95 views

Polygon inner rings/holes issue

I am working on a script to smooth polygons. Essentially it, separates the inner and outer rings/polygons and send the coordinates to a smoothing def/function. The "smoothed" coordinates are then ...
1
vote
0answers
22 views

Can I use Python 2.7 to add a metadata for each attribute in the attribute table in QGIS 2.10?

i was wondering if i can add a metadata formula that i can fill for each attribute in the attribute table in QGIS, using the python console. for example the attribute X has metadata like : theme, ...
-1
votes
1answer
80 views

Python or Javascript focus (for self-directed study at university) [closed]

Next semester is my last at university. I have taken all 3 of the GIS courses offered in my program. Besides some very light interaction with Python though, their has been zero discussion of ...
1
vote
1answer
160 views

GeoPandas: return lat and long of a centroid point

I would like to return the lat and lon or x and y from the point object in the following series as I plan to link them with an API I built that links OSM and NetworkX. The centroids will be added as ...
1
vote
2answers
128 views

NetworkX: Saving Shortest path of OpenStreetMap data as an OGR friendly format

I am using this script to import OSM data into a GIS based model. This has to run independent from any software package such as QGIS, PostGIS, or ArcGIS. I then create a shortest path between two ...
0
votes
2answers
68 views

Selecting max(cursor) Value returns incorrect max from arcpy.da.UpdateCursor

I'm working through some da.UpdateCursor scripts to make updates to a fgdb. Although the script below works successfully as a rule, it returns the incorrect max value from one feature class. The ...
0
votes
0answers
39 views

OGR: How to save shapefile to HDD?

I'm new to OGR module and I can't figure out how to save new layer to my HDD. I allready have shapefile with lines and buffer and I want to clip lines with buffer. from osgeo import ogr ...
1
vote
0answers
28 views

Identify and delete overlaping or near lines with similar running

I have shapefiles with lines that shows surface water runoff. I need to clear and simplify these shapefiles by condition that if some lines are near by other and has similar running, this lines has to ...
2
votes
0answers
41 views

Unicode Decode Error while geocoding MMqgis

Running Qgis, trying to geocode a CSV file using MMQGIS Qgis gets to the 66th element (there are 119) and returns the error: Traceback (most recent call last): File ...
8
votes
3answers
171 views

How to Find out Point which falls between two parallel lines

I am facing one Problem in ArcGIS. I work on a navigation Database. In our database single lane streets are represented by a single Line, while a multi-lane street (Street with Divider in centre) is ...
3
votes
1answer
75 views

GeoProcessing Tool Parameter: CoordinateSystem vs SpatialReference

So I'm adding a couple tools to my python toolbox. Most of the time I just used CoordinateSystem and leave good enough alone. Today I tried SpatialReference and noticed the result is the same. The the ...
4
votes
3answers
68 views

Trying to list datasources in mxds

I've written a tool that prompts the user for a directory path, and optionally a single mxd. It then crawls the directory for mxds (or just the single one) and writes some of the properties of the ...
4
votes
1answer
67 views

gdal_grid out of memory allocating 64 bytes

Python 2.7.4 32-bit GDAL 1.10.1 I have a Python script which takes a point file with x,y,z coordinates, makes a vrt of it and then tries to create a Geotiff from it with gdal_grid. During testing ...
2
votes
1answer
133 views

Reclassify a raster value to -9999 and set it to the nodata value using python and or gdal

I modified a script which reclassifies a raster. It is based on the script by Roger in his blog (the second script) and it works pretty well.The problem I am facing is as follows: I would like to ...
2
votes
2answers
198 views

Raster reclassify using python, gdal and numpy

I would like to reclassify a raster file from a raster with 10 classes to a raster with 8 classes using pyhton, gdal and/or numpy. The classes are represented as integers. I have tried following the ...
1
vote
1answer
45 views

How can I set polygon width in python?

Here i am try to set polygon outline width but it give me error. Please flow below code. from PIL import Image,ImageDraw img = Image.new("RGB", (1024, 1024), "white") draw = ImageDraw.Draw(img) ...
2
votes
0answers
88 views

Multiprocessing in python qgis?

When i try to do mutliprocessing in python Qgis it doesn't work from multiprocessing import Process,Lock import multiprocessing def name1(l,i): print i if __name__=='__main__': lock=Lock() ...
1
vote
1answer
116 views

Can we count the points in polygon using pyqgis code? [duplicate]

Does anyone know how to calculate the point in polygon from the given points and the buffer output using python qgis. I have every thing loading the data and retrieving the output. But now I want to ...
2
votes
2answers
98 views

Finding the pixel coordinates using GDAL/numpy

Is there a way to get the XY cordinates of a pixel based on the array index using numpy/gdal? I have a new set of extents for a raster and, based on these newer extents, want to determine the ...
0
votes
1answer
95 views

how to update values from python list into feature class

I have a feature class and python list. Feature class has 80 fields and 500 records. List also has 80 sub-list and 500 elements in each. So basically they are same dimension so to say. I want to ...
1
vote
0answers
41 views

How to load and execute python scripts from a local path after python console is triggered in QGIS?

I had created a file named "startup.py" in users python home directory (... .qgis2/python) and i had triggered the python console in startup.py file by import qgis ...
1
vote
1answer
91 views

How to use da.UpdateCursor with dictionary?

I'm working through some da.UpdateCursor scripts to make updates to a fgdb. Although the script below works successfully, I want to use the dictionary that I have created rather than the manual [ ] ...
3
votes
1answer
169 views

Using Square brackets in ArcPy update cursor?

I am looking for guidance regrading the usage or meaning of the square brackets in arcpy update cursor (Win 7, ArcGIS 10.2, Python 2.7.5) Although I have serched long and hard with various web ...
1
vote
2answers
167 views

-9999 (no data value) becomes 0 when writing array to GDAL memory file

I am trying to reproject and resample (1000m ->> 30m) a raster image (shape 238X406) using gdal.ReprojectImage() function in Python. The input file has -9999 cells as no data value. The result is an ...
2
votes
1answer
92 views

How to use spatial filter in PyQGIS?

I have a buffer and need to filter a multipoint layer (QGSVectorLayer) so that I would get only features intersecting the buffer. What I've found: a) setFilterRect() This doesn't accept polygon ...
4
votes
1answer
110 views

date in shapefile created by geospatial python module appears wrong, but isn't

I noticed something weird when messing with the geospatial python's shapefile module (no complaints here, this module is awesome and the only pure python way to write shapefiles). When adding date ...
1
vote
1answer
71 views

ExecuteError: ERROR 000358 - Using a variable within arcpy.Select_analysis() [duplicate]

I have looked at the solution here and while it is very similar to the question I'm asking I ran into the same issue after implementing its syntax. I feel like I'm still missing something related to ...
3
votes
2answers
105 views

How can I create a QGIS plugin that needs an external Python library?

I’m trying to enhance QGIS's Profiletool plugin by adding DXF export functionnality. For this, I need to to import dxfwrite library. As it's installed on my computer, i added the following lines to ...
0
votes
0answers
53 views

Python version issue

I am using arcgis 10.1 and running this script on python version 2.7.2. # Import standard library modules import arcpy, os, sys from arcpy import env # Allow for file overwrite ...
2
votes
1answer
186 views

Plotting “large” image with points with matplotlib - MemoryError

I want to plot an image of 3193 x 3293 pixels with 1502 points. When running in a smaller image and less points (934,722 pixels and 60 points), everything runs perfectly. I wrote like this: # I am ...