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

learn more… | top users | synonyms

0
votes
0answers
75 views

Help with python, import update csv values to feature class fields

I am trying to update a bunch of field values from a csv file where there are existing (incorrect) values in my featureclass. After searching I came across a similar post (Help with Python Update ...
0
votes
4answers
30 views

How to remove period, comma, symbols using field calculator?

I want to delete . , # in attribute table using field calculator (VB Script or Python). How can I remove these using this example address: N. First St., Unit #1 (I don't need city or state name) I ...
0
votes
0answers
24 views

How to skip non-empty fields in a model?

I have a model which iterates through a GDB, populating the same attribute field in every feature class with a parameter value. In this way I can mark all FC's in the geodatabase as to what project ...
0
votes
1answer
17 views

Iterate through all fields in attribute table and multiply by field

I have a table with a whole bunch of census variables (race, age, education, etc). I want to multiply all of these fields by a factor that I calculated. For example: Field1 has values of 10,20,30,40 ...
1
vote
1answer
15 views

Conversion: Specific Humidity to Relative Humidity Using netCDF4

I am currently working with netCDF4 files from the NCEP Reanalysis dataset 1. The surface flux data does not include relative humidity, but I will need this for my calculations. I have found ...
0
votes
0answers
20 views

I need to count the number of features that fall inside a polygon feature [on hold]

Feature class that will be used as the grid and needs to contain the counts for each feature class is a United States polygon feature class. The feature classes to be summarized are points, lines and ...
1
vote
2answers
160 views

How to plot Storm Prediction Center (SPC) Shapefile using python

I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this ...
1
vote
0answers
12 views

QGIS 2.6 - installing exifread for photo2shape plugin

I've already seen Error loading plugin photo2shape even after installing exifread module and Error installing Photo2Shape QGIS 2.6 for Mac, and other forums, but can´t make it work. First I installed ...
3
votes
2answers
40 views

Using folder wildcards to copy files with Python

I would like to copy the data of one specific shapefile from a specific folder ("Grid") to a number of folders containing the name "Country". The country shapefiles would keep their original name. ...
2
votes
2answers
81 views

How to populate attribute table with sequential numbers?

Using Python, how can we populate a field in a feature class automatically in increasing order? The user must be able to provide the start number. For example, say he wants to populate values from 51 ...
0
votes
1answer
51 views

Problem with lists in Python expression in Field Calculator

I want a bit analytical respond for the mistakes I have done in my code cause I am new to programming. I am using ArcGis 10.2. and I must process a field with distances in an attribute table I have. ...
1
vote
1answer
23 views

pyProj Coordinate Transformation Incorrect

I'm using pyProj to transform extents between two different geographical systems. In a case when both my systems are the same I expect to get back the same extents as inputted but this isn't happening ...
1
vote
1answer
222 views

How to export a set of layers into multiple PDF(orAI)files, one layer at a time?

I am completely NEW to PYTHON(only took a 3-hr entry course in ESRI tutorial. I have a dataset contains files named as "1_A, 1_B, 1_C....12_A,12_B, 12_c,....200_A, 200_B, 200_C..etc." I need to export ...
2
votes
2answers
209 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 ...
2
votes
1answer
54 views

PyQGIS jump to specific row

Is it possible to go to a specified row number (or perhaps the next/previous) row using PyQGIS? This code gets the value of the first attribute in the first row of the table features = ...
0
votes
0answers
47 views

Simple problem with python and sql expression in Field Calculator [on hold]

I am using ArcGis 10.2. I have a problem with my syntax in field calculator although I have tried a lot. Probably it will be a funny task for many of you but I have spent 2 days until now. I have a ...
0
votes
2answers
29 views

How to use SQL within python in ArcGIS Labels

I'm trying to create labels across a one-to many relationship and have tried a simplified version of this method. My version looks like this: def FindLabel ( [NAME_V2] ): import arcpy ...
2
votes
4answers
139 views

Using Loop function with arcpy.Exists()?

I have a code snippet using elif that checks if a file exists and continues to check through the letters of the alphabet (for example _A, _B, _C etc). All works fine but I think there must a better ...
2
votes
2answers
170 views

How to calculate monthly maximum values from daily data in a 365 band grd?

I have a MINT2005.grd file which has 365 bands representing days of year from 2005. Each band is a 32x35 matrix representing the temperature at different latitude and longitude pair. How do I ...
1
vote
1answer
25 views

Rename output shapefiles in PyQGIS

I have a shapefile which resides in a folder, gets processed and the output is saved in another folder. Before the output, I would like to rename the shapefile slightly differently from the original: ...
0
votes
1answer
44 views

Using pandas in Python window of ArcGIS for Desktop?

How can I import pandas module in ArcGIS at figure. I want to calculate poisson and negative binomial, so I think I need import pandas or other modules. import pandas as pd Runtime error ...
0
votes
2answers
41 views

Convert jpg raster format to tif format

I have 120 rasters( jpg format ) and i want to convert them to tiff format to folder called "OtherFormat" in env.workspace with arcpy. In my code i try to convert all jpg file I read ...
1
vote
2answers
67 views

Using geodatabase for processing 7200 polylines?

I have 7200 lines and I want to divide each of them every 100 meters and take the coordinates of points from them. For that task should I create a geodatabase and put them in there? I am totally ...
4
votes
1answer
71 views

How to write to a single table via Python multiprocessing

A comment in the post Can multiprocessing with arcpy be run in a script tool? got me thinking, as I often need to do exactly this: Just beware of deadlocking situations (two Insert cursors in the ...
2
votes
1answer
53 views

Python code for decreasing polygon size based on percentage?

I would like to decrease the size of polygons by percentage and not by distance in order to implement this into ModelBuilder to loop over a number of polygons. To my knowledge this tool is available ...
3
votes
2answers
238 views

How to convert polygon singleparts to multipart?

I am interested in converting a polygon featureclass created via Create Fishnet (Data Management) from singleparts to multipart. QGIS has a very handy tool called singleparts to multipart that does ...
5
votes
2answers
609 views

Load and display a layer from SQL Server using PyQGIS

I'm having a go at using pyqgis from within the QGIS python console to load a layer from SQL Server and display it. I feel like I'm part way there but I'm having a real issue getting the layer to ...
3
votes
1answer
371 views

Configuring spatialite database access for Python 2.6.6

I'm working on a GIS project, and I would like to implement and test some geo-spatial algorithms in Python. For this purpose, I will not only need sqlite, but also spatialite, in order to store and ...
0
votes
1answer
34 views

Script not processing shapefiles from one folder to another

I am working on a script which takes shapefiles from one folder called "Original files", process them and then output the results into another folder named "Processed files. I asked a question on how ...
0
votes
0answers
20 views

How to import osm.pbf file into database with Python Imposm

I want to import a .osm.pbf file with the Python library Imposm. Currently my work flow is the following: import requests import os city_name = 'santiago_chile.osm.pbf' url = ...
2
votes
1answer
38 views

Replicating result of gdalwarp using gdal Python bindings

I am trying to re-project/resample with the GDAL python bindings, but am getting slightly different results compared to those from the command line utility gdalwarp. See update below for shorter ...
3
votes
1answer
64 views

Copy protection via license file for ModelBuilder models?

I've build a large model in the ArcGIS ModelBuilder and I want to share this toolbox with some other people BUT I don´t want to lose control over it. The first step was to set a password to my script, ...
-3
votes
1answer
47 views

Creating a desktop GIS with arcpy analysis [on hold]

What is the problem with this code? I want to make a desktop GIS with this code in ArcPy. Can anyone help me?
1
vote
2answers
46 views

Automation of changing symbology for a given layer

I have a shape file that is a 10-by-10 grid of squares. The shape file has 50 attribute columns (named p_1 through p_50) where each column has 100 entries (corresponding to the 100 grid squares) and ...
1
vote
1answer
45 views

When using Data Driven Pages is it possible to tell if a feature is contained within the layout?

I'm using polygons to drive my DataDriven Pages in ArcMap Standard 10.2. I have a point feature that shares a common attribute with the driver polygon, and using the Page Definition, I am showing ...
5
votes
1answer
339 views

data driven pages format

I have an issue, but I don't even know the terms needed to search for an answer. I'm exporting the pages to png files. The pages are divided by lots. Each page has a label with the lot number. In ...
0
votes
1answer
124 views

Loading graph (.grf fle) into MXD using ArcPy?

I have hundreds of pairs of FGDB and associated MXD files. I need to insert a graph in each mxd linked to its corresponding FGDB. No problem creating graph, but stuck on how to get graph into mxd ...
0
votes
1answer
267 views

Orthographic reprojection with mapnik

I am trying to create a google earth like wep application. My problem is that I can't get to render a full view of the earth. The zoom_all() function generates the following error : RuntimeError: ...
10
votes
2answers
5k views

Creating line of varying distance from origin point using Python in ArcGIS Desktop?

I'm trying to create a line feature from a single point, using a set distance and angle. Using ArcGIS and Python (I hope). I have a point at these coordinates: X = 400460.99, Y = 135836.76 From ...
0
votes
2answers
1k views

ArcGis Python Script, Calculate Field

Sorry for my English. I am trying to write a Python Script for ArcGis 10.2. #import system modules import arcpy import math from arcpy import env #Set environment options ...
0
votes
0answers
36 views

Calculating distance from PointGeometry object to polyline in arcpy

I created a PointGeometry object on ARCPY and I'm trying to measure the distance from that point to the closest point on a polyline table.. The PointGeometry object has an easy function for that ...
3
votes
0answers
37 views

Jenks Natural Breaks in Python: How to find the optimum number of breaks? [migrated]

I found this Python implementation of the Jenks Natural Breaks algorithm and I could make it run on my Windows 7 machine. It is pretty fast and it finds the breaks in few time, considering the size of ...
0
votes
1answer
72 views

Problem exporting ecw project- arcpy

I work with arcview 10.3. Every time i export maps with ecw raster format , python (version 2.7.8) get crashed and i see: I use this code: import arcpy,os,sys,string import arcpy.mapping from arcpy ...
0
votes
0answers
37 views

Spatial Interpolation/Resampling of Point Surface Data - Axes @ Different Resolutions

I have a simple set of data points in x,y,z format. This was data collected from a ground penetrating radar over a physical distance of: 45m x 25m With a resulting grid of: 90 x 100 (9000 points) ...
1
vote
1answer
54 views

Where is the python library of QGIS 2.8

where is the Python library for QGIS 2.8 on a mac (10.10)? I cannot find it... sys.path in the QGIS python console gave me some path, but where the interesting part is happening it replaces the ...
6
votes
1answer
844 views

How to automatically generate useful scales for data driven pages in ArcGIS desktop

I have been tasked with creating several hundred maps of properties that intersect a long pipeline. The maps will zoom to the part of the property which shows the intersection. The lengths of ...
0
votes
0answers
41 views

Speed up row-wise point in polygon with Geopandas

I have a geopandas GeoDataframe which contains some attributes and a geometry column which is filled with shapely Point(lon, lat) objects. Moreover, there is a GeoSeries which is equally indexed as ...
0
votes
3answers
61 views

SearchCursor Index Out of Range

I'm using ArcGIS 10.2 and trying to obtain values in a field using SearchCursor. Would someone help me with this? import arcpy oc = r"C:\Users\Scratch\oc.shp" catchments = ...
1
vote
1answer
40 views

In ArcPy, How to call specific columns of attribute table?

I'm trying to figure out how to spline specific columns of a shapefile attribute table, but my question is intermediate to this-- how do I select a range of columns, e.g. the 20th column to the ...
0
votes
0answers
28 views

Stopping a route using attributed length

I am working in a project where I need to run routes from several points on a route network and have them stop at a specific length. I have worked out their max distance want to use this attribute to ...