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

learn more… | top users | synonyms

1
vote
2answers
69 views

Arcpy - Calculate total time, last value minus first value

For the script tool I've written (below), one of the things I want to do is after user input has pulled tabular data (into a feature class) I want to take the last value of the 'logdt' and subtract it ...
0
votes
1answer
25 views

Python brkLyr.supports (“dataSource”) Error

This is supposed to loop through a directory of MXD's and look for broken links and create a report. I am getting an error, an exception I believe, on one of the data sources. In the MXD it shows a ...
0
votes
1answer
68 views

Convert length in decimal degrees to feet

I've got attributes for a length that the Near tool calculated, and it gave them to me in decimal degrees. I need them in feet. Is it possible to do this with the Calculate Field tool? I tried ...
1
vote
1answer
45 views

Country border between two points

I am trying to extract country borders between two points, using Python. The border is a Shapely Polygon.exterior or LinearRing, the start and end points are Shapely Points. My idea is the following: ...
-5
votes
1answer
40 views

Field calculator with next() function? [closed]

I want to do calculate with script, field - field.next () with incrementation of 2 rows
0
votes
0answers
15 views

build and installed QGIS 2.6 from source but its not loading layers with error “ minidump written to /some directory/”

After successful build and install it was showing me many .dlls missing and i have tried to copy .dlls from apps forlder in OSGEO4W folder and it solved but latter after launching the gui of qgis ...
4
votes
2answers
143 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... ...
1
vote
1answer
80 views

Python heatmap from data

Is it possible to make something like this using python ? How should i best structure my data in order to make this map and what should i use to draw it. Code is not necessarily required. I just need ...
1
vote
0answers
43 views

Remove Frame Border from USGS scanned images in ArcGIS

I have a couple of USGS scanned maps like I want to remove the frame border from these images so that I can use them in ArcGIS. Is there algorithm or python script that I can run to remove the ...
0
votes
0answers
64 views

Error in python code for map automation (loop)

I try to make this code work but I cannot find the error (not very familiar with python) The code should basically run through a file GDB where all the feature classes are stored. It then should ...
2
votes
0answers
68 views

How to create line segments between pairs of pixels in a raster?

I want to draw several lines between pixels (please see the image below) according to some criteria : First Criterion: The distance between 2 pixels is less than 2000m and greater than 500m ...
3
votes
4answers
116 views

Workflow for identifying gaps in polyline shapefile

So I have a polyline shapefile showing the border of a city, however there are multiple gaps in the shapefile ranging from ~2m to well over 1km that are almost impossible to see when viewing the area ...
0
votes
2answers
41 views

It's possible to use gdal_calc.py with an entire path of rasters?

I try to use gdal_calc.py to scale and transform a time-series of MODIS images. I've done that when i worked with a single image in the -A variable and a mask in -B, but i need to work with a ...
1
vote
0answers
20 views

Converting Tiles to Geopackage with Python

I am trying to convert tiles (as png) into geopackage. In order to do so, I would like to use the geopackage-python tool. However, when executing the script I run into the following error: Layer 14 ...
1
vote
1answer
73 views

Removing Shadows from Aerial Imagery in ArcGIS

I am creating an automatic change detection tool in Python for ArcGIS 10.2 using aerial imagery. The tool works but it also detects shadow change. I have been able to create a classified raster of ...
0
votes
0answers
33 views

Automating Raster Calculator [duplicate]

I am seeing mixed answers on other posts so I thought I would ask here. Is there a way to automate the raster calculator? I am trying to create a series of inundation maps at fine increments. It ...
1
vote
0answers
35 views

QGIS / Python differences in result

I am working on a script that automatically calculates something for me. To be sure, I checked the result of the calculation with QGIS. Here are the statistics: STATISTICS PYTHON-CODE: MAXIMUM = ...
0
votes
2answers
35 views

Accessing Rest Api of Geoserver using python

is there anyway to access Rest Api of Geoserver using python other than gsconfig. since it doesn't support for me.i'm using python3.4 Like creating workspace,adding layers programmatically to ...
1
vote
2answers
62 views

How to use subprocess module to run QGIS toolbox modules

I've been trying to use subprocess for a while now, but can't get it to work when calling QGIS modules. Here's my script: import subprocess call("processing.runalg('gdalogr:merge', ...
0
votes
1answer
43 views

How to use wildcards for characters inside the name [closed]

I have shapefiles in that form RCs4s3s2c10_S2C10 RCs4s3s2c20_S2C20 RCs4s3s2c30_S2C30 RCs4s3s2c40_S2C40 RCs4s3s2c50_S2C50 RCs4s3s2c60_S2C60 RCs4s3s2cb_S2CB RCs4s3s2c10_1_S2C10 RCs4s3s2c20_1_S2C20 ...
0
votes
0answers
26 views

How to Post Kartograph File on Wordpress?

I can't for the life of me figure out how I can post what I created with Kartograph.py to my Wordpress site. I have the following files and the created the following with Kartograph:
2
votes
1answer
61 views

Replace Expression in Field Calculator to include a Numeric Range

There has to be an easier way to clean up address data, I hope? GeoCoding, I need to remove APT# and any number or letter that follows.
2
votes
1answer
30 views

Determining the cosine of the angles between two lines using dot product

SCENARIO:I have a certain buffered region (lets say a one way road segment), which will have only one allowed direction represented by vector A. And, there are several other lines which may or may not ...
0
votes
1answer
27 views

Error 000177: Failed to create relationship class in Python

I am trying to use python to create a relationship class between a feature class and dbf. I keep getting, "ERROR 000177: Relationship classes can only be created in the same database that ...
1
vote
0answers
9 views

Error in installing gsconfig python library for manipulating a GeoServer instance via the GeoServer RESTConfig API

I like to install gsconfig python libraries I got error like this Collecting gsconfig Downloading gsconfig-0.6.13.tar.gz Traceback (most recent call last): File "<string>", line 20, in ...
1
vote
0answers
50 views

Use Gdal from Python IDE

I am just starting to experiment with writing python scripts. I have been using QGIS and the Osgeo4w shell for sometime now. I would like to be able to call Gdal from the python IDE i have installed ...
1
vote
0answers
66 views

Are there any Python scripts available for Hydrology to compute watershed Basin from csv file?

Let's say I have surface data available in CSV format (x,y,z). In order to create a watershed basin from surface data, there are some intermediate steps we need to follow. ASCII to surface raster ...
0
votes
0answers
17 views

Calculating Odd and Even side of road using PyQGIS and GRASS

I'm trying to programmatically and automatically assign odd and even sides of a road to number homes using QGIS and GRASS. I noticed this other post, which gives a solution using PostGIS and I have ...
2
votes
1answer
47 views

problems overwriting files in ArcSDE with python script

I'm having a great deal of difficulty overwriting files when using ArcSDE. The usual 'arcpy.env.overwriteOutput' method doesn't seem to work. When I run this script: import arcpy from arcpy import ...
0
votes
1answer
21 views

Can you force cartoDB to read a file as a synced table

I'm writing a script that downloads from a data source every hour. I then do some processing on it and convert it to a kml saved in my google drive. As the data is updating every hour I want to be ...
1
vote
1answer
53 views

Field Calculation Python acceleration of gravity [closed]

In my problem i have a column DISTANCE and a column TIME and i want to calculate with python in field calculator how much time it needs to make that distance (for example 1000m) if you are moving with ...
1
vote
0answers
72 views

Update Data Driven Pages Index layer via Python

I am trying to find a way to update the index layer for data driven pages through arcpy. I understand that to access DDP from arcpy.mapping you need to be referencing a MXD that has DDP enabled. My ...
2
votes
2answers
71 views

Creating a really large shapefile without eating all the virtual memory

I am doing something similar to below to create a really large (large than memory on my machine) shapefile: shapes = shapefile.Writer(shapefile.POINT) shapes.autoBalance = 1 shapes.field('MyId','N') ...
0
votes
1answer
36 views

How to update raster color ramp with new min/max values using PyQGIS?

I'm trying to update a single band psuedo color renderer with new min/max values from the python console. All the code samples i have been able to find deal with constructing a renderer from scratch, ...
-4
votes
1answer
70 views

Handling ArcPy locks in Python script?

i am writing script which uses different Tools of arcgis and implementing different functionalities .. My script consists in different Functions running in an order. Each function is connected to ...
0
votes
0answers
29 views

Checking if Terrain Model has pyramids or data sources using ArcPy/Python?

I asked this question in the Esri forums and got nothing but a lesson on LAS point cloud classifications—not even remotely what I had asked. I’m hoping someone here can point me in the right ...
0
votes
0answers
8 views

Load and View Layers with Specific Symbology in QGIS form

I want to create a form to access my desired layers with defined symbology through some push Buttons in QGIS. when you click a button, specific layer with a defined symbology will be shown, Could you ...
0
votes
0answers
13 views

Populate field by numbering different types of roads using field calculator [duplicate]

I am trying to populate the Func_class field by numbering each type of road in my attribute table. I have different road types such as 'secondary road','local road','main road' see picture etc I ...
-2
votes
1answer
36 views

NumPy Array to Feature Writes only first array object to feature class [closed]

I am consuming a json web-service with NumPy Array to Feature, I have many nested try/except blocks to consume the data/find errors/etc. The script is functional, however I am having trouble seeing ...
1
vote
1answer
32 views

How do I add packages to Standalone Qgis's Python?

I have installed the QGIS 2.8 on my Windows 8.1 system, using the Standalone Installer. I now wish to install the VectorBender plugin. The docs for this plugin say, that I need to install matplotlib ...
3
votes
1answer
118 views

Is there a quick way to see the fields in a table via arcpy?

I frequently find myself in Python debug mode, trying to examine the fields of a layer or table. arcpy.Describe(lyr).fields returns an array of <geoprocessing describe field object> which isn't ...
0
votes
0answers
44 views

How to reshape a polygon with a hole in qgis automatically?

I am new to qgis and appreciate any help/advice. I have a polygon shp file and some of my polygons are within another polygon (again:they are on the same layer). So I want to split the big polygon ...
1
vote
0answers
59 views

I am building QGIS 2.6.1 from source code on windows 7, 32 bit and after successfully building all projects I get this error

Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in ImportError: No module named qgis.core Python version: 2.7.4 (default, Apr ...
1
vote
0answers
85 views

Python vs R for analzing spatial data [closed]

I am relatively new to both the python and R programming languages, having a small amount of exposure to both. Which language has the edge when working with spatial data and when would you use R over ...
0
votes
0answers
13 views

AddFeatures returned values …?

i try to add Features in a polygon vector layer. i'm using for example the following lines : fet.setGeometry(ft_com.geometry()) bool=pro.addFeatures([fet]) bool returns me True (i see the added ...
0
votes
1answer
55 views

Vector to Raster using GDAL (gdal.RasterizeLayer) : Error in Output Raster(generating output raster with NAN values)

For rasterizing a vector layer, I have tried gdal.RasterizeLayer method for converting vector(shapefile) to raster(tiff). But its giving raster output with NAN values(complete black image). I need ...
0
votes
0answers
43 views

Can I use Redfearn's formula to convert between WGS84 and UTM?

I have GPS data at 1 point per second for several weeks in WGS84 latitude/longitude form. It was collected using a UBLOX GPS in 2015 in Australia (Zone 55s) Would it be correct to use Redfearn's ...
2
votes
0answers
38 views

How to clip or erase a csv file with a non-rectangular shapefile?

I can clip a csv file with a ogr2ogr having 4 extents of a rectangular polygon. Is it possible to clip a csv file with a non rectangular shapefile?
2
votes
2answers
156 views

How to make a movie from a ascii grid files?

Lets say I have several ascii grid files for each time step for a particular location. I would like to spit out the image for each of these ascii grid files and legend on the side bar. I also would ...
-1
votes
1answer
49 views

How to use a wildcard for a field to sort many shp

I want to use a wildcard for a field so as to sort a group of shapefiles. All of them have the same columns but there is one column in each of them with only the first 4 characters common. Is ...