Tagged Questions

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

learn more… | top users | synonyms

2
votes
1answer
224 views

Programmitcally Change Text Font for all Labels on MXD

I'd like to know if there is a way to change the text font for all layers and all label classes within a layer on a MXD. I use a font not often found on all computers for created maps. I love the ...
1
vote
1answer
135 views

Python: Grabbing X,Y coordinate from matching fields

Here is my table. What I am trying to do is write a python script to go over the Zip_Crid values. If there are matching values, I need to grab x1, y1, x2, y2 and put it in a new field. Haven't ...
1
vote
0answers
100 views

QGIS GPS bluetooth connection

I have setup a Haicom bluetooth gps on a machine running Windows8 and have used GPSGate to create some virtual COM ports. I have valid data arriving at the COM port, but then I run QGIS and try to ...
2
votes
3answers
388 views

Polyline selection of features with angle turns up to a specified angle

I'm looking for an automated way to select line features that have specified angle between vertexes. That in order to check water mains layer -steel pipes can have only 45 or 90 degrees turns and I ...
2
votes
1answer
515 views

Distance of points in polygon to nearest polygon edge

I have a polygon shapefile with about a dozen polygons (Area.shp). I have an equation that calculates a value for points (or small areas) as a function of distance to the edge of these polygons. I ...
2
votes
3answers
158 views

Software needed to recreate VBA forms using python for Arc 10.0

I'm new to programming and need to convert VBA scripted tools for the 10.1 upgrade. I need to recreate the forms and use Python scripting. How do I do this? I need the form to function in 10 ...
1
vote
1answer
89 views

Stop custom attribute form from resizing in Qgis

When I open a custom attribute form for a feature in Qgis it always gets resized to the default size of the original Qgis attribute form. I've tried to set the sizePolicy in QT Designer to Fixed ...
2
votes
1answer
150 views

Stumped on python looping and data dictionaries

I have been stumped getting my python code to work for a while now. I've been using python for the last several years on and off for simple things, but I am far from an expert in python. I am trying ...
6
votes
1answer
273 views

Geometry Projection Speed Test

Lately I've been using the OGR projection classes that come with ogr/gdal, but pyproj was recommended to me, so I thought I'd give it a try. To help me decide if I should make the switch, I did a ...
0
votes
1answer
1k views

How to fix “import qgis.core ImportError: DLL load failed” [duplicate]

I am trying to develop a GIS application in QGIS using the Python language. Unfortunately, I encountered a problem from the outset is that of import and qgis.core qgis.gui. the Problem in the python ...
5
votes
1answer
4k views

How to convert shapefile to SVG keeping internal data?

I am very new to GIS. I found a tutorial on how to make a choropleth using Python tools. I want to follow it but use my own data and map. However the tutorial uses a US map SVG file and I need to use ...
1
vote
1answer
181 views

Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11. # Batch Aggregate raster tool import arcpy from arcpy import env from ...
0
votes
1answer
99 views

Custom forms and location of python code

I'm working with custom forms for the attribute table of various qgis-object and it works realy well, but I would like to have my forms and their python files separated from the projects. This is not ...
4
votes
1answer
203 views

extend line to feature. programatically

Thanks in advance for any help. I'm trying to programmatically extend hundreds of lines (blue in image) to a single polyline feature (red in image). Sometimes the lines intersect each other, but I'd ...
2
votes
1answer
192 views

Using update cursor on a field with a domain

I have been replacing field calculations with python update cursors in many of my work flows and today I ran into a problem. The fields being updated have an attribute domain. so now, when I ...
4
votes
2answers
660 views

Execute SQL in File Geodatabase

Is there a way to execute SQL queries on file geodatabase from Python? I'm looking for the same functionality provided by arcpy.ArcSDESQLExecute for SDE databases. Thanks,
1
vote
1answer
163 views

Can I append to different tables using ogr2ogr?

I have been through many related questions and links but I am still confused as to how/if this is achievable. So, I have defined tables in my postgis database and I would like my ogr2ogr commnand to ...
1
vote
1answer
221 views

Problem with encoding UTF8 chars in Windows with pyQGIS

I have the problem to show characters (äöü) in a utf8 format in Windows. In Linux there is no problem and everything is displayed correctly. I use at the second line: # -*- coding: utf-8 -*- and ...
1
vote
3answers
1k views

How can I translate Modis HDF To GeoTiff

I've a MODIS04 L2, and I want to extract band 8:Image_Optical_Depth_Land_And_Ocean. I use Quantum GIS to open this band, because Quantum GIS see this is not coordinates so this allow me to select ...
2
votes
2answers
121 views

Determine ArcCatalog's currrently selected folder using Python

Is there a way to get the current directory opened in ArcCatalog 10.0 using Python? Something like os.getcwd() but instead gives the selected folder on the catalog tree. Cheers
1
vote
1answer
98 views

How do I change the isNullable property for a field?

Once in awhile I encounter a field in my featureclasses that have their isNullable property set to No. Is there a simple way using python to correct this? I came up with this code, but ...
5
votes
1answer
573 views

Subsetting GeoTIFF with Python

I'm sub-setting a GeoTIFF with the GDAL Python binding and numpy. Essentially, I am providing a central location (coordinates of a flux tower) from which I produce a subsetted image. I then want to ...
2
votes
2answers
607 views

Python GDAL/OGR: retrieved feature is NoneType

I'm doing some scripts in Python to deal with shapefiles, and I have an issue I don't understand. I'm looping over a shapefile, and I want to retrieve the geometry of each feature, but very often I ...
2
votes
1answer
663 views

How to zoom to a selected feature with pyQGIS

I want to create a function that selects a feature and zooms to it (similar in QGIS). Therefore there is following function: QgsMapLayerRegistry.instance().addMapLayer(self.vlayer) def zoomTo(self): ...
0
votes
1answer
542 views

How to read attributes in pyQGIS and QGIS 1.8 without setSelectedFeature

I add a vector layer to a map with QgsMapLayerRegistry.instance().addMapLayer(self.vlayer) later the attributes are read with def select_all(layer): layer.select([]) ...
2
votes
1answer
542 views

Tool to convert Mike Urban network (shapefiles) to EPAnet network

This might be a too localized question, but I hope I'm not the only one here doing pipe network analyses in Mike Urban. I have a model in Mike Urban, and the client wants it in EPAnet format (since ...
0
votes
3answers
295 views

Why does CalculateField set values to <Null> when output extent is in a different coordinate system?

I'm quite new to ArcGIS, and now I have to work on a script that goes through a list of feature classes to: add a field to their attribute table and fill that field with a number that I retrieve ...
1
vote
1answer
422 views

Converting Tab to Shp Using OGR2OGR with Python on linux

First i downloaded http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and i am importing this. How can i get ogr2ogr to run in my script? nothing seems to be working and i not sure ...
0
votes
2answers
231 views

“ERROR 000840 | The value is not a Relationship Class”

I'm stumped here. I've seen this error in other posts but not quite in the same context. I'm trying to run the arcpy.management.CreateRelationshipClass() tool in ArcGIS 10.0. Absolutely everything ...
1
vote
0answers
37 views

Problem in analyzing data in a stream segment

I have to find out the head difference along the stream segment. For that I used Spatial Analyst Tool>Extraction>Sample. With that I got the elevation values in points. But after doing so, i found ...
0
votes
1answer
275 views

Opening/closing an MXD that uses “production mapping” for dynamic tables in Python

I am currently working on a project that requires using a python/arcpy tool to allow a user to create a map series report PDF. Without getting into much detail, the tool is used when in ArcCatalog or ...
0
votes
0answers
211 views

Issues when importing line shapefiles into NetworkX

Note that although I am using Python Console from within QGIS for this, I don't think it's a QGIS issue. Below is the difference of how NetworkX is dealing with 2 line layers created by the same ...
2
votes
3answers
777 views

How to get index number of list item using Python?

this gives me a list of all 55 layers in my mxd import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layer")[0] for lyr in arcpy.mapping.ListLayers(mxd, ...
4
votes
1answer
322 views

Python - ArcMap: Fastest method to loop over Mxd's

I am attempting to find the fastest method for looping over multiple map documents while keeping memory resources down. I'm running this script outside of Arcmap 10. I have 5 map documents which are ...
1
vote
1answer
509 views

Attribute error:'NoneType' object has no attribute

I tried to run a python script for getting the coordinate system of a feature/shapefile as follow >>> import arcpy >>> from arcpy import env >>> ...
2
votes
0answers
32 views

How to include checkbox or radio button in python script for arcgis tool? [duplicate]

I created an arcgis custom tool for converting an excel file to both kml and shapefile . Now I want to include radio button or checkbox to select according user interest for either kml or shapefile.
3
votes
0answers
285 views

Configure Python with Geoserver

I am developing a WebGIS application with: Openlayers 2.12 PostgreSQL 9.2 with PostGIS 2.0 extension Geoserver 2.2.3 Apache 2.0 configured with Tomcat 7.0.35 PROBLEM One of the services of the ...
10
votes
2answers
1k views

What software to use for making digital elevation models from UAV aerial imagery?

I have a an unmanned aerial vehicle (UAV, also called a drone) and would like to use it to create a digital elevation model and orthomosaic over a smaller area (10 km2). My platform will be able to ...
7
votes
1answer
214 views

Is Python essential for working in QGIS?

I am a beginner in QGIS. I Generally have a doubt: to work in QGIS is it necessary to know Python? whether i am asking we should know to write python programs to make certain modules run?
1
vote
0answers
57 views

Ubuntu Raring - Openlayers Plugin 1.8 or 1.9 Master

Relative newbie to Ubuntu and QGIS. Many questions are posted relating to the Openlayers plugin. It works fine in windows but I cannot get it to work or even appear in either 1.8 or 1.9. The "fetch ...
0
votes
1answer
418 views

How to run an AML in Python?

I am trying to run an AML in a python program I am writing and haven't been having much luck figuring out the correct way to run the AML. The AML requires ArcInfo Workstation to be from the GRID ...
1
vote
1answer
71 views

Get the ID of polygon in edition sessions of QGIS?

I did a Qt custom form for QGIS which contain a QlineEdit that must get the ID of the current polygon in edit session. For example, I start edit sessions I draw 3 polygons when the Qt form is opened ...
0
votes
1answer
35 views

Points Solar Radiation reformat problem

I am trying to produce a set of monthly solar radiation maps based on a monthly parameterization of the diffuse proportion and transmissivity (i.e. new values for both parameters each month). The ...
4
votes
2answers
746 views

Is it possible to route shapefiles using python and without ArcGIS, QGIS, or Pgrouting?

The question is pretty much in the title. Is there a way to route through a road line shapefile using python and some library without having to resort to converting the data into PostGIS/pgrouting or ...
9
votes
2answers
2k views

How to read an Excel sheet in ArcPy script

I'm writing a python code to convert X,Y points in excel to shapefile. In this process i have toread xy points from shhet1. What is the step i have to include in my process to read data from sheet1 of ...
4
votes
3answers
497 views

Checking if python script is run from ArcGIS (arcmap or on server) or a stand alone python script

For debugging purposes I have created a hardcoded conditional that checks it the script is run as stand alone or as an ArcGIS tool. Is there anyway to fugure this out at run time? e.g. some ...
9
votes
6answers
459 views

How to programmatically check if the number of shapes = number of table records?

I have a handful of approximately 1000 shapefiles that are corrupted (see attached error message). The shapefiles were generated from eCognition Developer 8. There is a script tool that seems to ...
0
votes
0answers
72 views

How to export png to file system with python?

I use python to make a plugin that contains shape file,color_bar,time_bar 3 items above now I want to export my result to a png image After I find the method to do it I find a similar way to ...
2
votes
2answers
567 views

Python script to read coordinate system of an input feature class? [duplicate]

How to read the coordinate system of an input feature class in python script. How we can use "Describe()" function and tool validator for that purpose
1
vote
1answer
95 views

How to set parameters for Describe() function?

I developed one tool in arcgis using python code, in the process i used Describe(feature class) function to know the coordinate system of input feature class. I got success while compiling code, But ...