Python is an open source interpreted programming language used in many GIS programs.
1
vote
0answers
13 views
Current map document in python tool
I am attempting to use this code in a tool that I am working on:
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
XMIN = df.extent.XMin
YMIN = df.extent.YMin
XMAX ...
0
votes
0answers
21 views
How to get Perpendicular cross section along the river using python and Arc Map 10? [duplicate]
I need to draw the perpendicular line segment along the river at a regular interval. How can i obtain like this output using Python and Arc Map 10 ? I would be very grateful if you give some idea..
3
votes
2answers
48 views
Python split table by “State” field and export to individual tables?
So I have never posted here before. I have used the site a lot for help so many thanks to all the great contributors. So, I have used ArcGIS online to perform batch geocoding (18,000) records and it ...
0
votes
1answer
23 views
QGIS Python - Convert geometry from Postgres to QgsPoint()
I have made a query in Postgres to get some points to use with python.
This points are in geometry data. How can I convert that geometry in decimals to use QgsPoint() in python?
Thank you
-1
votes
1answer
47 views
How can i draw a perpendicular line in a stream segment in a regular interval of 30m? [duplicate]
I have a stream segment which is polyline feature. Now I want to draw a line which is perpendicular to stream segment at a interval of 30m. How can i do it using python ? Do you have idea on this .
1
vote
1answer
57 views
Can I open a form in layer action?
I want to open a form (made in QTDesign) in the layer action. It is possible?
0
votes
0answers
14 views
AddLocations_na not loading routes properly from python script
I am trying to do network analysis with python from ArcGIS 10.0 but AddLocations_na is not loading the routes from the routes attribute table. It works for depots and orders quite well however.
The ...
0
votes
1answer
32 views
How to insert values from one table into another?
I am trying to write a script that iterates through each row of a table, calculates for this row something. The result of this calculation is finally stored in another table (with just one row). Now I ...
0
votes
0answers
17 views
QGis non blocking notifications with pyqgis [duplicate]
I'm searching for the way to use the new QGis non blocking notification system with the QGis python wrapper. I found informations on this fonctionnality but nothing on how to use this especially with ...
2
votes
1answer
42 views
Tabulate Area crashes Python and ArcGIS
I have a script that runs Tabulate Area on a single feature class multiple times with different rasters. In total Tabulate Area runs 5 times. 2 of the input rasters are provided as arguments to the ...
0
votes
1answer
27 views
Arcpy Network Analyst solver error
Hello GIS Stack Exchange,
I am finding it difficult to load locations to sublayers using python in ArcGIS 10.0 network analyst Vehicle routing problem.
I'm also having some trouble debugging my ...
0
votes
0answers
19 views
using python and arcpy , how can I compute the direction and angle of a line segment? [duplicate]
if start_point_x < end_point_x and start_point_y > end_point_y:
slope = ((end_point_y - start_point_y)/(end_point_x - start_point_x))
radian = math.atan(slope)
degrees = ...
1
vote
0answers
28 views
Calculating the Centroid of polygon in modelbuilder (VBA to Python) [closed]
Got an easy one, that's got me stuck.
I'm moving some models that were created in 9.3.1 to work in 10.
Part of the model is calculating the X coordinate of a polygon to a specified field.
The code ...
0
votes
1answer
43 views
arcpy.setValue for Condition from Dictionary
Hi: I am trying to create a function to update multiple fields based on different criteria. I want to pass the field name and condition thru' a dictionary (please see the function description in the ...
1
vote
1answer
42 views
Python GDAL: find out spikes and pits in DEM
I'm working with on a DEM (Geotiff) in Python GDAL, and I'd like to find out the spikes or pits in my terrain.
I have no idea how to proceed, does anyone have good algorithm to help me out?
Thanks,
eo
...
1
vote
1answer
46 views
Set Extents of MXD to new layer data source?
Alright here I go again this forum has been good to me. I add a layer and replace its data with a shapefile I created using the following bit of python:
layer = ...
1
vote
3answers
93 views
Create Text files from a loop with Python? [closed]
I need to create some files to hyperlink to from Arcmap. I have a folder of jpeg files (100.jpg, 101.jpg etc...). I need to loop through them and create a text file of the same name except replace the ...
1
vote
2answers
48 views
ArcGIS 10.1: “ERROR 000223: Cannot extract event table properties” when iterating through multiple files/folder
I am trying to convert ~270k csv-files with lat/long-data to layerfiles. The files are split into folders by year, i.e. ~30 folders with ~9k csv-files in each.
I have written a script to iterate ...
2
votes
2answers
53 views
Field calculator or update cursor?
I have a feature class in which one field (let's call it "Field_A"), as yet empty, is to be populated by the contents of another field ("Field_B") multiplied by a certain number (I'll call it the ...
0
votes
0answers
25 views
Python GDAL/OGR: check lines geometries connectivity
I'm working with shapefiles representing roads, so basically it's stored as (poly)lines.
I need to perform a road connectivity checking. In other words, I want to ensure that roads meant to ...
0
votes
1answer
24 views
Make Route with Python and network analyst in ArcGIS 10
Good Day,
I'm having trouble debugging my python code to create a network analyst layer in ArcGIS 10.0. Basically when run from a script tool the code completes successfully without actually doing ...
3
votes
1answer
38 views
Is it possible to batch clip rasters in Quantum GIS?
I have been able to batch clip rasters in one directory using python in ArcGIS. However, I am not sure how to do the same in Quantum using the python console. Is this possible? If there are different ...
1
vote
0answers
48 views
+50
spatialite.dll with Python and QGIS - the specified module could not be found
I'm having a bit of a nightmare getting to the bottom of this DLL loading problem. The stand alone script works absolutely fine but the exact same code does not work within QGIS.
import sys
from ...
2
votes
1answer
68 views
Python script to update attributes crashing during loop
I have a script to update a field in one feature class from a selected record in another feature class. This is done through looping through records in one feature class selecting appropriate the ...
-3
votes
1answer
54 views
how to call a function when I press the button? [closed]
def function(self):
QMessageBox.information(self.iface.mainWindow(),
QCoreApplication.translate('HelloWorld', "HelloWorld"),
QCoreApplication.translate('HelloWorld', ...
0
votes
1answer
50 views
How to access the button on the form?
I have a form that appears when you start the plugin.How do I properly apply to the button on the form, so that when you click on the button performed "function".
import sys,os
import win32api
from ...
0
votes
0answers
34 views
How specify a corridor minwidth?
I’m trying to make a corridor between two substations with ArcGIS, a macro corridor and a micro corridor.
I have two questions in this respect and would be grateful for your suggestions.
a) How can ...
1
vote
1answer
69 views
Editing attribute tables using Python
I am new to Python, so sorry for such a trivial question. There is a shapefile (let's call it Structures.shp) and the script I'm writing needs to update the value of only one record in only one field ...
1
vote
1answer
51 views
How to add attributes to shapefile with Python and pyshp?
I'm using pyshp for creating a shapefile. I need to populate tens of fields with values using the record() method of shapefile.Writer. I have those values as a list, but have no idea how to send it to ...
0
votes
0answers
52 views
Congressional Redistricting
I have a project coming up where I need to create new congressional district looking at only total population data. I am planning on using the census tract level of data, but I am having some ...
2
votes
1answer
46 views
GDAL/Python: How do I get coordinate system name from SpatialReference?
In Python, using GDAL, I've extracted a raster's projection as a WKT string as follows:
wkt = dataset.GetProjection()
# wkt is ...
1
vote
1answer
55 views
Setting More Than One Workspace
I have a number of tables that contain known values in a field. For example, I have a soil type table with one field in it. That field contains a list of known soil types. I have another table that ...
3
votes
1answer
57 views
How can I list SDE versions using Python?
I have an SDE geodatabase with different versions for each user.
How can I list each version using Python?
0
votes
1answer
22 views
ArcGIS 9.3 geoprocessing service output consideration
I'm developing geoprocessing service which do few processes with geographic data. I would like to get somehow geometry of those data and use it in my web aplication (JS ArcGIS API). Now I'm wondering ...
1
vote
1answer
43 views
Need python code example - setting a combo listbox to Null
I want to be able to set the value of a field to Null using python, but I get an error.
I am using arcpy.CalculateField_management
Any help would be appreciated.
Rob Smith
0
votes
1answer
24 views
Convert Mapnik TMS python script from EPSG:4326 to 3857
May I ask help from this group to convert this Mapnik 2.1 python script from EPSG 4326 to 3857? I am not enough familiar with projections, and I am missing some points somewhere... Particularly, Im ...
0
votes
1answer
64 views
How can I create a line with three points with Python in QGIS?
I'm new to Python and I'm having some dificulties. I want to create a simple layer with a line in the console of QGIS with Python. How can I do that?
0
votes
1answer
25 views
Check if layer is a QGSVectorLayer from Python Plugin within QGIS
I am trying to extend some concepts in the QGIS Workshop tutorial. Basically, I would like to check if the layer is of type "QGSVectorLayer". In the QGIS Python console, I am able to type
canvas = ...
1
vote
1answer
37 views
Generate unique ID upon creating a feature?
Looking for a way to generate a unique Global ID within a feature set when a new feature is created. For example, every time a sewer manhole is added, we need to generate a new unique Global ID that ...
0
votes
1answer
12 views
python gdal_polygonize error
I am trying to use gdal_polygonize to create a polygon from a binary raster.
My code is:
os.system('gdal_polygonize.py ' + filename + ' -f ESRI Shapefile ' + shapefile)
where filename is a string ...
0
votes
0answers
37 views
Location of gdalwrap? [closed]
the problem I get before
And now I can make it work without error
but now, there is another problem I get: after I call the gdalwarp to run the clip
I use Popen instead of call and recive error ...
1
vote
1answer
17 views
OGR UnionCascaded gives strange lines (flat polygons)
I'm using OGR to perform a union using UnionCascaded. All my polygons have been created by GDAL polygonize which ensures that all polygons follow pixel edges and should therefore align nicely. But I ...
1
vote
0answers
17 views
How to align QProgressBar label in QGIS messagebar? [migrated]
Unable to align the QProgressbar label in Qgis Messagebar. see the image below
While progressbar is updating,the label is vanished. so i tried the alignment for progressbar as shown below but its ...
5
votes
2answers
83 views
How to do advanced Python labeling in Arcmap?
Does anyone have a good reference for advanced/complicated labeling expressions in Arcmap? I am attempting to write a Python label expression that would involve multiple label definitions.
Here is ...
3
votes
2answers
61 views
How to computational efficiently check if there are any overlapping polygons in a group of polygons?
I need to do some processing with groups of polygons. If any of the polygons in the group overlaps other polygon the result is unpredictable and don't throw any error. So, I need to detect if there is ...
1
vote
2answers
56 views
ArcMap label expressions with Python
Having trouble here: I'm trying to use python to write selective label expressions. I have several concentrations and depending on its "_Ex" number I either want it labeled red, not red, or not ...
-1
votes
1answer
55 views
QGIS and Python - create line with multiple points in postgis
How can I create a line, with Python functions, with many points that are records in Postgis?
Thank you
6
votes
2answers
87 views
Refresh open attribute table in ArcMap (arcpy)
I am running the Calculate Field GP tool from the arcpy in ArcMap. When a row value is updated, it does not show up untill I use the Reload Cache tool (Table Options > Reload Cache). How do I refresh ...
1
vote
1answer
78 views
Search cursor stops selecting after two iterations
I have a script which selects an extent from a grid and exports the data frame.
import os, arcpy
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
...
4
votes
1answer
37 views
Using matplotlib to create and export graphs automatically from ArcMap
I am going to start a project soon where, after the data has been processed in various ways, an output jpg showing a graph of the data should be produced. The workflow is as follows:
1. A feature ...

