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

learn more… | top users | synonyms

1
vote
1answer
23 views

geting geograpic locations from an address list

I have a table with 150 addresses. I would like to automaticly generate a point shapefile/PostGIS layer from all of them. Is that possible in any way or do I have to search for every single address to ...
0
votes
0answers
19 views

GDAL/OGR Python [on hold]

Does anybody know any sourses explaining methods, atributes of Python wraped GDAL? http://gdal.org/python/ - does not do it. It shows lists without explanation. ...
0
votes
0answers
19 views

Meaning of AttributeError: 'module' object has no attribute 'da'? [duplicate]

error is : AttributeError: 'module' object has no attribute 'da' Code is below: import arcpy import os from arcpy import env # Set local variables inWorkspace = "Q:\\NHD project\\Connection ...
0
votes
0answers
12 views

Make qgsmapcanvas.extent().size equal to qwidget.size()

I am using Qt and QGIS to write a touch device application. Right now, I have a QWidget which is the child of qgsmapcanvas, and both of them are full screen. However, the qwidget size is (1920,1080), ...
2
votes
2answers
35 views

How to encode a point geometry in Geojson?

I have point geometry in posgresql which I query as follows: select ST_AsText(geom) as pointgeom from pointable. I'm using python as server side script. I want to pass the result as Geojson response ...
1
vote
1answer
22 views

MakeFeatureLayer_management wrong output

I have a huge database with Sightings from whales and dolphins from 1995 till today. So I want to sort the database with python. Till now I can make FeatureLayers for each year for ...
0
votes
0answers
27 views

Rename open MXD using ArcPy

Is there a method in ArcPy that will rename the MXD you currently have open? I don't what to use mxd.saveACopy("newFileName") as it will just save a COPY with a new name, not rename the current MXD. ...
2
votes
2answers
26 views

Add both string and automated numbers in series to attribute table using field calculator

I would like to fill a column in my attribute table with an string that ends in a numeric value. Example: Object001 Object002 Object003 I would like to automate the process of filling in the ...
1
vote
1answer
40 views

how multiply a ranges of values for other value on python

I need multiply ranges>1.5 and <=4.5 * 9, but I am new in this type of language. please help me. def CalcD(Level_water) if Level>1.5 and <=4,5 * 9
0
votes
0answers
29 views

QT GUI make for QGIS plugin

I was used to develop qgis2leaf on a Ubuntu machine and after each change on the PyQT dialog I've used "make" in the terminal to "compile" the GUI. How does this work on a Windows machine?
2
votes
3answers
178 views

Executing Python code takes a lot of time (more than 2 hours)? (Arcgis10.1)

I am executing this Python code, in which I am trying to determinate the position of neighbor parcel (north, south, east, west). It works fine but it took 2 hours for just 50 parcels! I think that ...
0
votes
0answers
15 views

How to draw perpendicular/Parallel line using pyQGIS?

While digitizing a line with multiple segment, how to create a particular segment parallel to (or) Perpendicular to another feature using pyQgis?
3
votes
2answers
40 views

ArcGIS Removing values from a shapefile with Python

I've got a monster shapefile with lots of duplicate records, however each duplicate record has an accuracy rating. I want to remove all duplicate records with a lower accuracy rating. This would be ...
0
votes
1answer
22 views

How to set the spatial reference to a OGR layer using the Python API?

I create new a Ogr Layer with the Datasource.GetLayer() method: driver = ogr.Open(input_file).GetDriver() datasource = driver.Open(input_file, 0) input_layer = datasource.GetLayer() If the input ...
1
vote
2answers
55 views

Using Python For a Field Calc

In AcrMap 10.2 I'm trying to add a field and run this script in Field Calc: !shape.isMultipart! to see if I have any multipart lines. I keep getting geoprocessing failures. I am clicking the ...
3
votes
1answer
23 views

ArcMap Using Python to Rename a Feature Class based on Print Results

I would like to rename a feature class based on the EDITOR and DATE fields. I wrote this code: import arcpy fc = "C:\Users\PythonTesting.gdb\MyFile" f1, f2, f3 = "EDITOR", "DATE", "OBJECTID" ...
2
votes
1answer
39 views

Install QGIS on Ubuntu with GDAL built from source?

I am trying to install QGIS on Ubuntu 14.04. While I can easily install it via the package manager or apt-get, I find that QGIS, when installed, does not have Python support as expected. The symptoms ...
0
votes
0answers
42 views

name 'row' is not defined error appears overnight

I'm using arcpy with arcgis 10.0. I strived days to write my first python script, and I finally get what I want until...a new error occured during the night. The script you can see below was tested ...
0
votes
0answers
22 views

How do I auto-populate more than one other attribute field with values based on the value of another field within the same record?

Based on value selection from one attribute field, would it be possible to auto-populate many fields within the same record with predefined values either from a range of values within another field or ...
0
votes
1answer
50 views

Error 000728 field does not exist within table - field already exists

I am running arcpy.AddField_management to add a field called "cnid" and update it with x centroid values. For add.field I get the error "cnid" already exists. I tried print.field name and I cannot ...
1
vote
0answers
32 views

mark points on shapefile using python

I want to mark specific lat long coordinates on a shapefile using python. I am trying to use the plot function from matplotlib to do it. In the examples that have been provided, a basemap object needs ...
0
votes
1answer
45 views

Syntax error using ArcPy Spatial Analyst module in Python

I'm very new to using python and figure I'm missing something obvious in the following script. I keep getting a "syntax error" message no matter how much I fiddle around with the first few lines. I ...
3
votes
1answer
36 views

Determine if shapefile and raster overlap in python

I am building a script in python using osgeo/gdal. I have a set of shapefiles and a set of GeoTiff raster files. I would like to have my script ignore shapefiles if they do not intersect with the ...
1
vote
2answers
45 views

Using Python to Rename Feature Class by Field ArcMap

Alright so I made a pretty little model and at the end I want to rename the feature class file to something based on the fields in that feature class. I want to rename that feature class by the date ...
2
votes
1answer
73 views

How to get information about layers using Arcpy

I have this layer structure in ArcMap: "Localities, Gazeteers, Bases, Regions, and Territorial Claims are all Group Layers. All others under these are layers. I have a script that uses the Arcpy ...
1
vote
1answer
52 views

Update a field for similar values in the second field based on third field value

So I have the table like this: City Distance NearFeature Comments A 90.5 131025 A 0 781446 B 15.5 131057 B 42.2 140521 C 21.7 784116 C 0 ...
2
votes
0answers
26 views

Programmatically Harvest and Disapprove Metadata - GeoPortal Server

Is it possible to synchronize an existing metadata catalog in esri's GeoPortal Server? I have access to the server, and have a script to add an XML file to our web accessible folder. After this script ...
-1
votes
2answers
41 views

Intro to Geoprocessing Scripting with Python for ArcGIS? [duplicate]

Can you point me to any recommended online resources where i can learn the fundamental basics of geoprocessing scripting and the different modules/python has available for an ArcGIS environment. I ...
1
vote
0answers
44 views

library for minimum bounding box “by width” in javascript or python

I'm looking for a library (or at least a code snippet) to calculate the minimum bounding box "by width" in javascript or python. Below is an illustration from the ArcGIS documentation of that ...
1
vote
1answer
56 views
+50

How to update projection of layers in Geoserver using gsconfig

Im using following code to find projection of layer from geoserver.catalog import Catalog cat=Catalog("http:// localhost:8080/geoserver/rest") myResource = cat.get_resources(store='storeName', ...
1
vote
1answer
31 views

How to copy a geometry with Python OGR?

I want to copy a geometry with Python OGR within a loop: I tried the following, but I get ERROR 1: Empty geometries cannot be constructed import ogr import copy d = ogr.Open('sampleData.geojson') l ...
1
vote
4answers
99 views

Calculate Field with Python Issues (If statements)

I don't know a whole lot about python and scripting, so I was hoping somebody could give me a couple pointers on fixing some code. I am trying to calculate a "final results" attribute field. The ...
4
votes
1answer
48 views

GDAL (or other open-source) equivalent of Arc's Point To Raster Tool

I'm trying to convert a python script that relies on arcpy into one that only relies on open source modules, but I'm having some trouble. The bulk of my processing lies in one Arc tool "Point to ...
0
votes
1answer
30 views

Ignoring group layers when iterating through layers

I have this nice code that goes through each dataframe in the current MXD, and through each layer in the dataframe, and generates a list containing the name of the dataframe, the name of the layer, ...
0
votes
0answers
22 views

How to check if there is an intersect between two coordinates? [duplicate]

I have two pairs of lat/lon (expressed in decimal degrees) along with their radius (expressed in meters). How can I see if there is an intersect between these two points? How should I deal with the ...
1
vote
1answer
25 views

How to use gdal's “forceToLineString()” with Python

I'm working with Python and GDAL and I'm quite new to this ^^ For my script I'm looking for a method to convert a MultiLineString into a simple LineString. Example: MULTILINESTRING ((0 0,0 1),(0 1,0 ...
2
votes
1answer
38 views

Qgis how to combine a geotif with a country border shape file?

I have 2 files. A geotif with different values and 1 shape file with country borders of this area. Can I generate with this 2 files an image with the country borders and the data from the geotif? ...
3
votes
0answers
46 views

Geometric Network for Electric Utilities

I'm not expert in the use of geometric networks nor in Python scripting and I need help with the following problem. I'm using ArcGIS 10.0. I have defined a geometric network for an electric ...
1
vote
1answer
51 views

Run a custom model via ArcPy fails

I'm trying to geocode a few address using a custom model created. When running the model via model builder all runs perfectly. Also when running it via the embedded interactive python console in ...
0
votes
0answers
93 views

convert lat/lon into meters

I have a database of latitude, longitude and radius in the following form: 48180759,11518950,19.0 Both latitude and longitude are expressed in degrees but then multiplied by 1e6 (or 1000000). ...
1
vote
1answer
27 views

ERROR 000358: Invalid expression “Parcelles_class.OBJECTID” = 1 OR “output_table1.src_OBJECTID” = 1 Failed to execute (Select)

I'm executing this code. I don't know if i'm missing something, I'm using Arcpy, Python, Arcgis 10.1 whereclause1 = '"Parcelles_class.OBJECTID" = 1' whereclause2 = '"output_table1.src_OBJECTID" = ...
-1
votes
2answers
56 views

SelectLayerByLocation - arcpy

I have 2 layers: "atikot" and "ways" that located in C:\Project\layers\New File Geodatabase.gdb , and i try to use this code based on "ArcGIS Help 10.2" to select features from "ways" layer: import ...
3
votes
2answers
35 views

Gdal: clipping a raster with another raster

I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ...
2
votes
2answers
52 views

Query for numeric field against text field that contains a numeric value

In my database, I have one field, Service_Day, formatted as numeric, which contains a single digit number 1 through 7 (for days of week). I want to compare it against another field, called Region, ...
3
votes
1answer
46 views

Confused about ST_DWithin function postgis

First Time here. Anyway, I have a database that I want to use to store user locations. I want to be able to get all the users with in say 15 miles. How do I do this. I'm using PostGIS 2.1. My SQL ...
2
votes
1answer
42 views

Nested SearchCursor functionality

I am trying to ultimately compare the gate height to the corresponding fence height located nearby. So far I have come up with the following: gates = "gate_line" fence = "fence_line" ...
1
vote
0answers
37 views

Unable to call GDAL functionalities from Python

I am trying to call GDAL functionalities from the following script I made in the past. import os, fnmatch from subprocess import call call("dir", shell=True) # define the variables inFolder= ...
0
votes
1answer
32 views

How to round up/down an pixel value of a raster to a pixel value with 2 decimal places?

I have a raster (DTM) with floating points as pixel value. Now i want to round up/down the pixel values (to its next nearest value) to 2 decimal places. I use ArcGIS (with extensions) and tried the ...
2
votes
1answer
49 views

How to format an excel table using python

I am trying to come up with a way to export an attribute table as a formatted excel table in ArcMap 10.2. I am aware that there is a "table to excel tool" in the conversion toolbox, but I am not sure ...
0
votes
0answers
37 views

Replace a feature class in a feature class list

I'm using arcpy with arcgis 10.0. I try a script that erase successively all the feature class of a list depending on a reliability field value. Each time a feature class is erased by an other one, I ...