Python is an open source interpreted programming language used in many GIS programs.
1
vote
3answers
61 views
Apply rotation before FeatureToRaster_conversion
I am converting polygon shapefiles to rasters. With arcpy I am using the function FeatureToRaster_conversion.
gp.FeatureToRaster_conversion(InFeatures, InField, OutRaster, InCellSize)
This function ...
3
votes
2answers
62 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 ...
2
votes
2answers
85 views
What Python package to use to calculate midpoint?
I asked a question earlier about how to calculate a midpoint. I was wondering if there is a Python library that does this alreay?
2
votes
2answers
187 views
Python code : Help with using Search Cursor and Messaging the Total Count of Items from Field in Layer that was Searched
My program works but it is not displaying a message of the total sheet count found in attribute table that the search cursor searched through. For Example: It goes through the mxd chosen by user finds ...
2
votes
2answers
165 views
OSR Python testSR.ImportFromEPSG(4326) returns empty spatial reference
This is empty using Python .ImportFromEPSG(4326):
import osr
#this fails:
testSR = osr.SpatialReference()
testSR.ImportFromEPSG(4326)
print testSR.ExportToPrettyWkt()
#why did the import from EPSG ...
1
vote
2answers
277 views
How to make editable polygons in Google Maps?
I've just recently started learning Google maps, JavaScript, etc., and have a few questions about a project that I'd like to do. I'm wanting to take some ESRI shapefiles, convert them to KML, and then ...
2
votes
1answer
88 views
Need help assigning values to field using OGR in python
I've got a similar question to this one How to programatically populate a shapefile field with polygon areas in OGR?, but the solution doesn't seem to be working for me. I am trying to import a ...
2
votes
1answer
141 views
Create a 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
...
2
votes
1answer
60 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
122 views
Refresh combo box in add-in
I've got an add-in with a combo box and want to refresh the list in the combo box after an event in one of the other tools in the same add-in toolbar.
Can I call the combo box somehow to refresh it ...
2
votes
1answer
216 views
RT Sql Layer plugin giving an error
I am trying to use the aforementioned plugin with QGIS 1.7 and Postgres 9.0/PostGIS 1.5.
Added a PostGIS spatial layer w/out a problem and then clicked on the RT Sql layer button which displayed the ...
1
vote
1answer
79 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]
...
1
vote
1answer
71 views
View HTML field data with QT4 browers as a QGIS Run Feature Action Tool
I've successfully populated a sqlite table with an HTML-encoded-table as a field attribute, and so there is literally a Table within a single field value in sqlite, for each record. This is going to ...
1
vote
1answer
78 views
How to run “create mask” from the console?
There's a plugin called "create mask" for qGIS and trying out some simple scripting from the Python console.
I would like to call it after I select the vector features I want, then do more related ...
1
vote
1answer
81 views
Difficulties in dissolving stream orders
I've been trying to dissolve streams, using orders programatically and I came across this VB script. The reason is that if I use ArcGIS dissolve, it merges the confluence of the same orders. I would ...
1
vote
1answer
187 views
Slow tiles generation for leaflet js
I am currently trying to use leaflet to display images (jpeg or png) instead of maps, I have followed the instructions on this blog post to create the tiles using gdal2tiles.py here is the code we ...
1
vote
1answer
52 views
Showing map in Grass Layer Manager/Map Display via Python
I've created some raster(tif) maps using Grass libraries in Python. I want to opem them automatically in Grass GIS Map Display or Layer Manager after creation. I don't want to use GUI for this. What ...
1
vote
1answer
96 views
Using reader Feature Type Name as Writer Feature Type Name in FME
I've search and searched for a way to do this, but no method seems to work. Basically I want to use the input feature class name (feature type in FME) as the output name. This normally works, ...
1
vote
1answer
124 views
Python SQL connection causes crash in ArcMap
I have the following code which I have striped down to just included the part that is causing a crash in ArcMap.
import pymssql
# Connect to the Research db using Windows Integrated Authentication.
...
1
vote
1answer
103 views
can't generate/display signed float values using python/gdal
I'm trying to create a raster with signed float values as the pixel values and display the results in MapWindow on windows.
What is the proper gdal band type to use? I've tried both gdal.GDT_Byte ...
0
votes
1answer
29 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
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 ...
0
votes
1answer
16 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
1answer
37 views
Maintain 8-bit pixel depth in Raster Calculator
Would anyone know how to maintain 8-bit pixels when computing raster calculations in ArcMap?
0
votes
1answer
49 views
How to find locations for hydro power using raster analysis?
I have a stream network and DEM file both in raster format. I need to extract values from DEM to stream network. For the analysis in stream network after that, I need to find out the places for hydro ...
0
votes
1answer
31 views
How to Average neighboring county data and store in original?
I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
0
votes
1answer
34 views
Rendering a layer in ArcMAP using ArcObjects and Pyhon
I succesfully wrote a script to render a Uniquevaluerenderer in a layer in ArcMAP using symbols from 4 parameters (values) read from the attribute table of the layer. I used ArcObjects and VBA, but ...
0
votes
1answer
65 views
How can i select many rows from a table?
I want to create an action that select many rows from PostGIS table to show many lines in QGIS.
How can i select many rows from table with python to add these rows in a layer?
Thank you
0
votes
1answer
26 views
Local variance image in python using gdal and a running window approach
I want a local variance image with a 3x3 of a geospatial raster image using python. My approach so far was to read in the raster band as an array, then using matrix notation to run a moving window and ...
0
votes
1answer
64 views
Join multiple shapes in a workspace based on a common field
I’m completely stucked!!! I’m working with meteorological data (wind) but I have to arrange the data for a program to be able to process it. I have text files, two per day (one with the wind direction ...
0
votes
1answer
42 views
How to reopen a plugin-window in QGIS?
I am currently taking my first steps in playing around with programming a plugin in python 2.7 for QGIS 1.8. While my plugin does what it should, I would like to make it more userfriendly. At the ...
0
votes
1answer
23 views
Mapnik - Error on rendering linestring
I am using Mapnik 2.0.1rc0 on a Windows 7 with python 2.7 32bits inside a GeoDjango App using xml. The datasource come from spatialite 4.0. My tiling script can render polygon and point features ...
0
votes
1answer
86 views
Where Clause problems when all parts are user input variables
I have written some generic user ipnut code for a toolbox script (ArcGIS 10.0) but because everything is a variable I don't know how to write the SQL whereclause.
Please can someone help and suggest ...
0
votes
1answer
50 views
How to save after using fet.setFeatureId in pyQGIS?
By using the following code, I want to change the id of the line when saving the line. But the setFeatureId command, gives a false when doing the commitChanges(). Any idea how to change the id?
vl = ...
0
votes
1answer
98 views
How to clip raster by multiple polygons in multi rasters?
Using QGIS, I want to clip a raster by multiple polygons contained in a single shapefile. I read that gdalwarp can clip my raster by multiple polygons BUT the output is a single merged clipped raster. ...
0
votes
1answer
29 views
using ZonalStatisticsAsTable in python script
I use a python script in which the function ZonalStatisticsAsTable is called. In ArcGIS9.3 it all worked fine. Our company just went to ArcGIS 10.1 and now it doesn't work anymore.
When looking ...
0
votes
1answer
46 views
Change ID for each line in vectorlayer in python
I am creating a vectorlayer with lines by doing this in python:
for i in frange(1, noOfPoints, 1):
polyLine = line()
polyLine.AddPoint_2D(minE,minN - addEastRange +(i-1)*linespacingEast)
...
0
votes
1answer
125 views
How to properly add a Python Module to a Plugin?
I've been trying to use a module that is installed in my local version of python, but whenever I open the plugin itself, it does not manage to locate said module. The module in this case is Noise ...
0
votes
1answer
110 views
Invalid topology error when running script
I am trying to run a python script and I get an invalid topology rule when I get to the feature to line tool. I am using arc 10.1 but I think the script was written in 10.0. I know it was built in ...
0
votes
1answer
171 views
What causes PythonFactory failure in FME?
2011-10-04 09:59:18| 2.3| 0.1|FATAL |PythonFactory failed to load python symbol `module2.py'
2011-10-04 09:59:18| 2.3| 0.0|FATAL |Factory proxy not initialized
2011-10-04 09:59:18| 2.3| ...

