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

learn more… | top users | synonyms

2
votes
1answer
418 views

Python script for dark object subtraction on Landsat 8 Imagery

Does anyone know of any python scripts that will allow me to conduct such a process? I am limited to open source software and have minor experience in Python.
1
vote
2answers
41 views

Arcpy fail to loop between files in different directories

I want to perform a loop of intersections between different files in different directories. Here is my code: Intersects = ['Name1','Name2','Name3','Name4','Name5'] #Names of my files ...
0
votes
0answers
12 views

Layer stacking many images using Python and Erdas Imagine Spatial Modeler

I have downloaded huge amounts of Sentinel 2 data to cover a large area of the Himalayas and need to layer stack each tile. I have decided to use Python to do this using the LayerStack tool from Erdas ...
1
vote
1answer
47 views

Why does joining all layers in a group not work?

I am attempting to re-join all layers within a group to another layer ("Main.shp") outside of this group. The idea is for users to change values in one of the group's layers. As these layers are ...
3
votes
1answer
60 views

Export raster layer in python to specific folder

I am trying to export existing raster layers as tif files. I just want to avoid saving each raster manually. this is the code I am trying to use, but it doesn't seem to work: from PyQt4.QtCore import ...
0
votes
0answers
23 views

Assign a point to polygon using pandas and shapely

I have a series of Easting and Northing coordinates in pandas dataframe along with other columns of information. I know the coordinates fall within and administrative area and want to match the ...
3
votes
2answers
43 views

Cannot load vectorlayer PyQgis

I am having a hard time loading a vectorlayer from the console. Not from the Pythonconsole within QGIS, but from the console on my computer. I later want to write a standalone script! That is what I ...
0
votes
1answer
35 views

Using Python to execute merge of rasters Linux

I need help with a python script to iterate merge (gdal_merge.py) of rasters: For each folder located in /home/geodata/sentinel2/ look in subfolder IMG_DATA and merge the three rasters with ...
6
votes
1answer
97 views

Adding GDAL as dependency to Python package?

I am trying to package a Python script that uses GDAL for PyPI. I started by including a direct reference in my setup.py: install_requires=['GDAL==1.11.2'], This way the package failed to install in ...
3
votes
1answer
169 views

QGIS using the heatmapplugin from the console

I have to make a lot of heatmaps from csv's. Therefore I'm making a python script to run in the console. So far I can load csv's and save them as shapefiles. To get to the heatmapplugin I'm using the ...
1
vote
1answer
174 views

Couldn't load plugin PRISM due an error when calling its classFactory() method in QGIS1.8 inWin8

When I load a plugin in QGIS ,met some problems : I had tried copy other Python27's files to QGIS's Python 27 file but it still does't work. Couldn't load plugin PRISM due an error when calling ...
0
votes
1answer
220 views

Can't get the correct version of GDAL installed to use ReadAsArray without getting error in Python

Using the instructions here . . . https://pythongisandstuff.wordpress.com/2011/07/07/installing-gdal-and-ogr-for-python-on-windows/ I downloaded the following files: GDAL-1.11.1.win-amd64-py2.7.msi ...
0
votes
1answer
26 views

Empty file after saving…? [closed]

Code below is working, but after opening - there are No features in shp file. What can be a problem? import osgeo, os from osgeo import ogr, gdal shpFile = r'C:\Users\ReBurns.shp' driver = ...
3
votes
0answers
155 views

How to change the group icon in legend via Python in QGIS 2.6?

How to change the group icon in legend via Python in QGIS 2.6? At version 1.x I did it this way: self.legendTree = self.iface.mainWindow().findChild(QDockWidget,"Legend").findChild(QTreeWidget) ...
4
votes
1answer
246 views

Updating attribute table from an Excel file using Python

I am kinda new to Python, please excuse for such a trivial questions. There is a shapefile (let's call it Materials.shp). I have an attribute table with different fields (for example, windows, doors, ...
3
votes
1answer
35 views

Building a tool to both geocode and do topology check on the geocoded point (ArcGIS)

Never built a tool in ArcGIS. Would someone tell me if it's feasible to create a single tool (preferably using Python) which: Geocodes an address Checks to see if geocoded point falls within a ...
3
votes
1answer
36 views

PostGIS: floating point representation problem with ST_AsText

I have a table with geometries, all with about 13 digits of accuracy. While trying to represent them with ST_AsText though, most vertices come out in decimal notation, but some come out in scientific ...
3
votes
0answers
32 views

Translating ArcGIS field calculator python expressions in to QGIS field calculator python expression?

I'm transitioning to QGIS from ArcGIS. I'm having trouble getting my python field calculator expressions to work in the QGIS advanced python field calculator. Here is a screenshot of the working ...
1
vote
1answer
25 views

Remove/subset raster bands in Python GDAL

I'm trying to remove bands from a raster I have. Basically I just want the first band as a new GeoTIFF file. Here is my code so far: #!/usr/local/bin/python from osgeo import gdal # Load my GeoTIFF ...
3
votes
2answers
122 views

assign a number for each group in field calculator

I have several thousand features each of which has a name. The names are not unique. what I want to do with the field calculator is assign a number to each name so I can refer to a number and always ...
2
votes
1answer
40 views

Get intersection of circles shapely

I have a List of Points which I transform to circles. Code from here circles = [Point(random.random(), random.random()).buffer(random.random() * 0.1) for i in range(3)] I want to know which circles ...
0
votes
1answer
40 views

Python-ArcObjects mxDocument Stand Alone

if I need to work with classes MxDocument with the MapDocument that I have selected to work , for example style gallery, How can I instantiate ? InitStandalone() pMapDoc = ...
-3
votes
0answers
32 views

Python code to calculate area and perimeter [closed]

I want to calculate area and perimeter for many features (polygons) that have been saved in separate files. How can use python script to calculate these parameters and output them in one table for all ...
1
vote
1answer
230 views

Is it possible to embed python in code for HTML pop-ups in ArcGIS

When clicking a point feature I want the html pop-up to not only contain the data of the feature but also an image of the area around the feature (eg. 2 km^2). The image would have the base map 'World ...
1
vote
1answer
632 views

Debugging 'module' object has no attribute 'SdeWorkspaceFactory'?

I am new to python, am debugging one of existing python code, where am facing an error "'module' object has no attribute 'SdeWorkspaceFactory". Earlier this code was working fine but suddenly does not ...
2
votes
0answers
46 views

Deployment of optical fiber QGIS Python

The subject that I’m working on is the deployment of optical fiber . I have a shapefile which represents a country containing homes. And I have another shapefile representing an infrastructure plan of ...
5
votes
1answer
139 views

Python and ArcObjects- Stand Alone open MXD

I wrote a Python function using comtypes to access ArcObjects to programmatically change the size of layer symbols in an MXD. The function works great in the Python window of ArcMap. However, I need ...
2
votes
1answer
111 views

Trying to generate a PDF for each feature in a feature class based on an attribute with Python.

I have a feature class of points that represent storm water inlets. I am trying to automate a process that does the following. finds all of the inlets that have a field called "Marker" populated ...
9
votes
2answers
820 views

Histogram Matching using Python to improve mosaicking process of multiple overlapping rasters?

I am trying to do histogram matching using Python to improve the mosaicking process of multiple overlapping rasters. I am basing my code on that found at: ...
0
votes
2answers
34 views

Trouble getting shapely to run

I downloaded the GDAL complete Framework von Kyngchaos which also includes the GEOS Framework and shapely for python. I can import shapely without a problem, but when I try to perform some "geo ...
4
votes
2answers
47 views

How to get layers in x number of subgroups?

I have a project which has dozens of groups and subgroups. E.g.: Main_Group > Sub_Group_1 > Sub_Group_1A > Layer_1A > Layer_2A How can I access ...
2
votes
0answers
27 views

QGIS Function Editor/ Python question

I'm currently using the layer_property(layerName,'source') to produce a list of copyright statements for the Print Composer by putting that in an if() statement. However, that isn't very flexible as ...
1
vote
0answers
27 views

Eclipse PyDev has quit recognizing QGIS objects

I followed the instructions for setting up Eclipse with PyDev to start creating QGIS plug ins found here: http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/ide_debugging.html after doing ...
3
votes
2answers
56 views

Label and symbol with condition in layer properties under style tab

I have forest areas. I want to put tree.svg with condition. Layer properties-> style-> background -> shape ->svg Something like this: if (myfield<1300 , then show, ...
0
votes
0answers
25 views

IDE's that play well with python toolbox [closed]

I recently have learned about creating python toolboxes, and watched the video from ESRI. In the video I noticed that they were utilizing a pywin ide. Which brings me to my question can you use any ...
4
votes
1answer
35 views

Getting pixel values at single point using rasterio

To get a single pixel value at a point in a raster using rasterio, there is an example here: https://github.com/mapbox/rasterio/pull/275 However, is there a direct API within rasterio (and not the ...
3
votes
1answer
45 views

Update ID Field Using Common Types

Not exactly sure how to word this, but hopefully I do it in a way that accurately conveys what it is that I'm trying to do... I'm using Manifold GIS for this particular project, but I'm open to any ...
3
votes
3answers
49 views

How to get appropriate CRS for a position specified in lat/lon coordinates?

I have a set of city networks whose coordinates are specified in lat/lons. I wish to run an algorithm on each network that treats them as a planar graph. I'm using python and can use pyproj to project ...
1
vote
0answers
54 views

qgis python: select on screen and change (pre-set) properties accordingly

I have a map with different zones where I have drawn isochrones -where I will arrive within 15 min, within 30 min and so on. The picture attached shows the 15-120 min isochrones. This is set as a ...
0
votes
1answer
75 views

Python: Trying to figure out Geopy in python for reverse look ups

I am trying to test the following code on my system but I cannot get the correct output. Is this code correct for using geopy with GoogleV3? If so, how can I return country and continent name? ...
3
votes
1answer
679 views

Extract data from netcdf using a shapefile polygon in python

I need to subset data from a NetCDF using a specific shapefile. The data are sea surface temperature and ocean color at 1/4 degree resolution. I have 4 polygons describing the US. Northeast ...
7
votes
0answers
214 views

Automating creation of ServiceDefinition from Python script tool of ArcPy without broken project data source?

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
2
votes
2answers
159 views

How to iterate over layers and export them as PNG images with PyQGIS in a standalone script

I would like to export specific layers as a png from a QGIS .qgs map. From the table of contents the script would first export the "boundary, climits, and Div1_Irrig_1956_0" layers as one png. The ...
0
votes
2answers
33 views

Casting between PostGIS types in GeoAlchemy

I'm working with OpenStreetMap data, and loading it into a PostGIS database using osm2pgsql. The issue that I am currently dealing with is that osm2pgsql stores the shape as a geometry type. I'm ...
10
votes
1answer
204 views

Birch algorithm does not cluster as expected

I'm using Birch algorithm from scipy-learn Python package for clustering a set of points in one small city in sets of 10. I use following code: no = len(list_of_points)/10 brc = ...
0
votes
2answers
397 views

Conducting geographically weighted regression on a raster

I have a relatively big raster file on which I want to conduct geographically weighted regression. Size of raster ~ 2 GB and number of rows is around 100,000 One way might be to convert from raster ...
0
votes
1answer
1k 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 ...
2
votes
2answers
96 views

Using zoo-project WPS service in QGIS WPS-Client

I've created a python wps service in the zoo-project framework, which is used to calculate a Line of Sight based in on a start point, an end point and a start point height. The service works fine if i ...
0
votes
1answer
20 views

gdal writeArray causes appcrash at end of python script

i'm using OSGeo4W64 (gdal 2.0.2-8) with Python 2.7.5 on Windows 8.1 64bit. Editor is PyCharm 2016.1.2. I want to save an image with gdal, but i always get an error when the python script is complete. ...
0
votes
0answers
19 views

Points within a circle in Python - geoindex

I'm trying to use the geoindex package to perform a nearest neighbor query. For example, I have this two coordinates (in the real case I have a lot more): (40.607255, -73.75083) (40.7261465 ...