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

learn more… | top users | synonyms

4
votes
1answer
56 views

Difference in destination location between pyproj and geopy

I am looking at ways to calculate (in Python) the destination location from a point given bearing and range. Based on the results comparison from the 2 libraries in subject(geopy and pyproj), I ...
0
votes
0answers
23 views

Installing GDAL Python bindings on Windows [duplicate]

This has been addressed before (How to install GDAL with Python on windows?), but I wanted to bring the question up again, to see if anybody has come up with a better method in the last 5 years, and ...
0
votes
0answers
25 views

How to build a raster populated with an equation in a python toolbox?

I am working on creating a python toolbox to solve for WiFi signal properties based on various inputs, and for the end result I would like to have the output in the form of a raster. I need this ...
1
vote
1answer
463 views

Using GDAL to read dted files

How do I get the elevation at a certain point using gdal to read in a dted file? I don't see much useful information out on the web. I'm sorry I should have been more specific. How would I ...
5
votes
2answers
767 views

Python Script to convert a mass of KMLs to a single fGDB

I have a mass of KML files, approx 350+ that I need in a single fGDB. I lifted a string of code from ESRI help to attempt to do this - I got it working to the point of creating all the individual ...
0
votes
1answer
33 views

Convert multi KML and KMZ into shapefile using ArcPy?

I try to convert with arcpy (python 2.7.8) 50 KML and KMZ files, that i downloaded from google earth into shapefiles. All files located in many sub-Folders. All Sub Folders are located in one large ...
0
votes
0answers
50 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
0answers
48 views

Gdal Python Problem : Black strips in geotiff

I am trying to use GDAL (2.0.0) Python API in Blender, but I am having some difficulties. I am trying to save geotiffs for : - a 2D numpy array storing 32bits floats - a 3 channels rgb numpy array ...
11
votes
2answers
4k views

How to read Excel sheet in ArcPy script?

I'm writing a python code to convert X,Y points in excel to shapefile. In this process i have toread xy points from shhet1. What is the step i have to include in my process to read data from sheet1 of ...
0
votes
1answer
250 views

Cause of ArcGIS Raster Calculator Parsing error <type 'exceptions.SyntaxError'>: invalid syntax?

This is my first attempt at much code in the raster calculator of ArcMap 10.0, but I think I'm close. I have nine rasters (A-I below) and want a new raster with value = 1 where any of the rasters ...
0
votes
1answer
21 views

Using ST_LINE_INTERPOLATE_POINT in OGR and python

I'm interested in finding the midpoint on a linestring using OGR and python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in python using the ExecuteSQL() method? ...
5
votes
3answers
321 views

Replacement for ArcScripts

Does an equivalent of ArcScripts exist? I know of the the ArcGIS resource center and "Code Galleries" but does something that equates to ArcScripts where users share useful ArcGIS code exist? The new ...
2
votes
0answers
32 views

Cul-de-sac (curve) turns generation in flow for parallel lines using ArcGIS for Desktop?

I'm using ArcMap 10.2 and I need to generate a parallel lines within the polygon and connect them one to other with the curve, with the proper radius and return radius (the same as cul-de-sac tool ...
1
vote
0answers
33 views

Using ModelBuilder or Python parser of Field Calculator to check values between two datasets?

I have a *.dbf that I need to check values against for a shapefile. I need to report whether the values match the dbf in the shapefile and, if not, what the value should have been (in two new ...
2
votes
1answer
149 views

How to print 2 maps in the same PDF page using PyQGIS?

I am trying to generate a one-page PDF document containing the following items: 1) On the left half, a full state map (say, New York State). 2) On the top right quadrant, a map that zooms in to one ...
1
vote
1answer
51 views

QStringList() error in plugin of QGIS 2.10

I have made a Dialog in PyQt for use it like a plugin under QGIS 2.10 The Dialog works fine like a standalone application, but if I try to call it like a QGIS plugin, I get this error: ...
0
votes
0answers
33 views

ZeroDivisionError

I was conducting Mean Coodinates process functions with weighted fields when I began faces ZeroDivision errors in some processes. The Shapefile Data has been joined together with imported Spreadsheet ...
4
votes
2answers
47 views

how to create geo-referenced random data?

I'm writing a dissertation on different parameter settings in GWR . In order to perform tests I'd need the availability of geo-referenced data that show some sort of spiatial correlation (i.e. values ...
0
votes
1answer
134 views

Extending ArcGIS Desktop using Python vs Visual Basic vs Java? [closed]

I have to extend the features of ArcGIS. I've been asked to create a model written in Python that can run out of ArcGIS 10. This model will have a simple user interface where the user can drag/drop ...
0
votes
1answer
518 views

Transforming between epsg:3857 and Google Maps Tile coordinates

Hio, I used to use a simple python project (https://github.com/hrldcpr/mercator.py) to convert between wgs84 and google maps tile coordinates. This project doesn't have a license, and looks like it ...
0
votes
1answer
26 views

map(arcpy.AddError, traceback.format_exc().split(“\n”))

What does this expression mean? I see this in many python scripts. try: ... except Exception as e: import traceback map(arcpy.AddError, traceback.format_exc().split("\n")) ...
0
votes
1answer
16 views

Multiply a stack of floating point rasters( composite raster ) with a constant

I am trying to multiply a floating point stack of rasters (10 layers) with a constant and round up to the next integer. I have the formula RoundUp(10*composite_raster) in raster calculator, but for ...
1
vote
1answer
27 views

Python tools won't open when clicked on

I am creating a python toolbox within ArcGIS 10.3 and I am having issues opening it up in ArcMap. I have been editing it, saving it, and running it within ArcMap this whole time to test it little by ...
7
votes
4answers
7k views

Programmatically start and stop map services with Python

Is it possible to programmatically stop and start ArcGIS Server map services using Python?
1
vote
1answer
31 views

Copying attributes from point layer to memory linestring layer PYQGIS

I've stacked a little bit with copying attributes. I have a Point Layer created from .csv file. For each feature in this layer, I'm creating a new Polyline geometry in memory layer. Cannot add ...
1
vote
1answer
39 views

How to calculate zonal statistics from multi-band raster for each polygon using python?

I want to calculate the zonal statastics from multi band raster for a polygon layer. When I am using this snippet of code: vectorlayer=qgis.utils.iface.mapCanvas().layer(0) rasterfile = ...
2
votes
2answers
315 views

How to determine the coordinates of the corners of the raster layer

How can we determine the coordinates of the corners of the raster layer? The image opens function QgsRasterLayer.
0
votes
2answers
71 views

Using Python to field calculate Lat/Long with decimal degrees rather than meters

The below is a snippet of a python script that I am writing that basically adds two fields - Latitude and Longitude, then calculates them. I could use the Add XY Tool which gets me to the same point. ...
1
vote
0answers
27 views

QGIS - Custom Icon to Show my Tool is Running?

I am running QGIS 2.6.1 (Brighton) I've some developers that have made some custom plug-ins, but our testers are complaining that they cannot tell when, if or what tool / plug-in is running. Is there ...
0
votes
1answer
61 views

Determine start/end points for line slope calculation [duplicate]

This is a follow up question based off of this question. I have a line feature class representing storm drains and a point feature class representing where storm drains are connected. The point ...
0
votes
0answers
23 views

Spatial segregation from a raster of racial distribution in the USA

I am trying to measure the degree of racial segregation at some geographic level (let's say the county level, for simplicity) in the USA. I have a shapefile with these geographic units. To do so, ...
2
votes
1answer
54 views

Processing algorithm fails from Python script

I'm trying to write a Python script performing a geoalgorithm. What is surprising me is the following: I first test the algorithm by QGIS (2.8) interface. In my case, the GRASS interpolator ...
0
votes
1answer
189 views

40k+ points from Shapefile, clustering them and populating on Google Maps/Webapp

I just started a new Python/Django webapp job related to GIS (and i'm totally new to GIS). Here is my task and what i have found so far, and i am stuck as to finding out what's the best way or the ...
4
votes
3answers
178 views

3d vector and geometry operations in open-source GIS

There is some really good open-source software available to work with 2D vectors. For example QGIS has operations like buffer / clip / dissolve / select by location / join attributes by location... ...
2
votes
0answers
34 views

Multiple layer intersection

I am trying to find a way with qgis/python to get the intersection area of more than 2 layers. All the tools in Qgis take just the 2 input layers. ='( For example in the image below, I have 4 ...
1
vote
2answers
182 views

Call output files in temporary directory through Processing Toolbox (python)

I need to create temporary files as intermediate output to be used with processing algorithms. So, I implemented this: Processing.runalgorithm("grass:v.to.rast.attribute", ........, None) This line ...
0
votes
2answers
31 views

How many percentage of sea area is covered with points?

I have a large number of lat/long positions at sea for a geographical area (stored as CSV). This geographical area also contains lots of land area. I want to divide the sea area into a grid (f.ex down ...
1
vote
0answers
38 views

Switching between python versions for Arcpy [duplicate]

I’m developing a multi-module project in Python. I’m new to GIS and my boss doesn’t have a strong technical background. I’ve been instructed to use the Arcpy module to do functions such as intersect. ...
1
vote
0answers
11 views

Can't import liblas into OSGeo4w Python on Windows machine

I installed the 32-bit version of OSGeo4w with the liblas-python packages on my Windows machine. When I try to import liblas into python, I get an error that no 'liblas' module can be found, even ...
2
votes
2answers
237 views

Issue while running grass from subprocess

I have a map based web application using geodjango. I needed to display the crime hotspots within a selected polygon area. I found that v.kernel is very good for generating heatmaps/hotspots. So in my ...
1
vote
1answer
40 views

FeatureToPolygon (to cut polygons by line) not working correctly outside of ArcGIS

I asked a question yesterday, about splitting polygons using a line, and I ended up using the approach that is described in the comments here. Although this worked with my test data, it causes a lot ...
1
vote
0answers
22 views

How accurate i pythons is_land? Alternatives?

I was planning to use Pythons is_land function, to differentiate between land and sea. However, after some inspection, I have major concerns in the accuracy. I cant find anything about this in the ...
0
votes
0answers
46 views

Code converting lat/long coordinates (WKT) to polygon (shapefile) not working

I am having a problem converting WKT to shapefile. I have a csv file consisting of three columns: ID, Name (of the area) and WKT comprising set of lat/long coordinates of area boundaries. For example, ...
0
votes
0answers
22 views

How can i upload two CSV file in QGIS Desktop App?

If I am using single file upload code it will work fine. self.dlg.lineEdit.clear() self.dlg.pushButton.clicked.connect(self.select_output_file) But I want to add more than one files it will give me ...
2
votes
1answer
245 views

How to use SAGA ShapesToGrid via Processing in a Python plugin?

I run these lines in my code: vectorlayer_vector = ftools_utils.getVectorLayerByName(inputLayer) Elevation = self.lineAttrib.currentText() cellSize = int(self.linePix.value()) outPath = ...
0
votes
0answers
48 views

SAGA version with QGIS 2.10

I want to know which version of SAGA is used with QGIS 2.10. I developed a standalone application which uses QGIS inside. I have problems using SAGA algorithms. SAGA is well installed but I found that ...
1
vote
0answers
10 views

Using arcgisimage along with python basemap

I am utilizing maps provided through the ArcGIS rest service when i plot information in Python, but have some problems understanding the different options I have when I request I map. The ...
6
votes
3answers
2k views

Creating square grid polygon shapefile with Python?

I have the following coordinates minx, maxx, miny ,maxy = 448262.080078, 450360.750122, 6262492.020081, 6262938.950073 I wish to create a square grid of size 1 m using python. import math ...
1
vote
2answers
117 views

Parsing Geoprocessing Service messages using ArcGIS API for JavaScript?

I am working on a JavaScript (JS) app where the user draws a polygon and then a python-based Geoprocessing (GP) Service task queries the parcels and generates mailing labels. The GP task works great, ...
1
vote
1answer
45 views

Calculating a z value in python

I have some contours where the z value is stored in the geometry and I want to display it as an attribute. I want to include this in a python script. I have an expression which does this in python ...