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

learn more… | top users | synonyms

0
votes
1answer
23 views

How to use wildcards for characters inside the name [on hold]

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
12 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
24 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.
0
votes
0answers
22 views

How to solve problem of non-ascii character on a zipfile on a plugin? [on hold]

I'm making a plugin that needs extract files from a zipfile before processes them. For this I'm using zipfile lib. The ZIP file contains filenames with non-ascii chars. If I run this code on a "QGIS ...
2
votes
1answer
18 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
20 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
4 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
26 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
35 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
13 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
29 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
8 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
36 views

Field Calculation Python acceleration of gravity [on hold]

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
28 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
1answer
44 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
21 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
59 views

Python script working incorrectly?

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
21 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 ...
-1
votes
0answers
23 views

Flood fill in python

I am quite new to python and programming in general and I am trying to execute some code from a book. The code I am having troubles with should execute a flood fill function on an elevation raster ...
0
votes
0answers
4 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 ...
-1
votes
1answer
25 views

NumPy Array to Feature Writes only first array object to feature class

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
27 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
107 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
31 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
30 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
57 views

Python vs R for analzing spatial data [on hold]

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
9 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
37 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
16 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
28 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
127 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
35 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 ...
1
vote
1answer
48 views

How do you use Windows folders as acrpy Parameters

I am having problems trying to perform simple folder management operations in an ArcGIS python toolbox. First here's some code snippets (I have left out all of the stuff that does not pertain to this ...
0
votes
0answers
37 views

google geocoding api usage restrictions and other free api options

I would like to use the google geocoding api to geocode a few thousand addresses. I understand the daily limit for a free account is 2,500. I want to retrieve the coordinates and then map them in ...
0
votes
0answers
28 views

Identifying Left and Right Mouse Button Clicks in PyQgis application

I am relatively new to PyQt. I am trying create a custom plugin for Qgis which enables the user to select some features by drawing polygon on the canvas using mouse clicks and then performs ...
1
vote
1answer
28 views

Can I mimic the “open” action in QGIS with python and manipulate the field content used for the action?

I am using QGIS actions (type: "open") to link ECM searches to objects on the map. The basic syntax is very simple: protocol://searchterm1=[%"field1"%]&searchterm2=[%"field2"%] However, some ...
0
votes
0answers
22 views

Quick way to select by attribute and zoom to selection in QGIS

I need to visually control hundreds of points in a layer on top of aerial photographs. Using the attribute table, selecting (with column filter expression) and zooming manually is cumbersome - so I ...
0
votes
1answer
19 views

Batch Mosaic Rasters: arcpy.MosaicToNewRaster_management (ERROR 000628: Cannot set input into parameter coordinate_system_for_the_raster)

I am trying to batch mosaic rasters using arcpy.MosaicToNewRaster_management in arcpy: #This is for mosaicking a lot of rasters import arcpy from arcpy import env ...
0
votes
0answers
26 views

Importing tif image from PostgreSQL Database to webpage

I am trying to import tif images from PostgreSQL Database to my website. In the website, I need to make a button control which will open the images. I think I have to use Pyhton as a server side ...
5
votes
2answers
130 views

Advanced python labeling in ArcMap - working with null values

I'm trying to label certain features using a specific field (osm_name_58_en). However, when this field is null, I want to label the feature with (som_english_32_name). If both are null then I want ...
1
vote
1answer
31 views

Auto-update a feature class with Python + .csv?

I am hoping to find out how to automatically update a feature class. We have semi-regular updates to an ArcGIS Viewer for Flex website. Looks like a Python script may be the way to go about it (and I ...
3
votes
1answer
69 views

ArcMap 10.3 - Anything Python related causes crash to desktop

Problem: ArcMap crashes to desktop anytime I use a Python related function (Toolboxes, Field Calulator, Etc) How I got to this point: I was trying to gain some familiarity with Python programming ...
0
votes
0answers
42 views

How to create a Shapefile of a subset of input features in PyQGIS?

I'm having some trouble applying my Python skills to develop some scripts in PyQGIS. For me it's far simpler to write it in ArcPy, but then again I wouldn't get that much satisfaction after finishing ...
1
vote
1answer
29 views

QGIS Python Scripting permission denied

I've just started a Python Scripting tutorial on QGIS. The problem arrives right at the end, when I have to use this script: output_file = open('c:/Users/Ujaval/Desktop/airports.txt', 'w') for f in ...
3
votes
4answers
178 views

Removing first and third zeros of a fieldname in label expression

The fieldname only has three characters. I dont want to display zeros in the first and third values. example below. 010 = 1 100 = 10 01Y = 1Y 10Y = 10Y I have figured out how to strip out zeros ...
1
vote
0answers
29 views

GDAL equivalent to ArcGIS Union?

I have a single shapefile full of overlapping polygons. The ArcGIS Union tool will generate individual, non-overlapping polygons with that geometry. Is there a way to do this with GDAL/OGR or another ...
2
votes
2answers
66 views

Cutting a polygon out of another polygon with python [duplicate]

Licence: ArcEditor Version: ArcMap 10.0 i have some issues to separat my data with python. To illustrate the problem, i have simplifyed the data with figures. I want to cut the blue polygon ...
1
vote
0answers
14 views

Cloud and cloud shadow identification with MERIS

I am looking at MERIS images to use for marine applications (Chl-a. SPM) and would like to confidently remove cloud and cloud shadow pixels from the data. I have a few ideas: Using the blue band ...
0
votes
0answers
13 views

Create a list of affected tiles from polygon / Gridding a polygon

Given a projection, a zoom level, a grid definition and a coverage polygon - what is the easiest/fastest way to obtain a list of map tile indexes touched by the polygon? Are there any existing tools, ...