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

learn more… | top users | synonyms

5
votes
1answer
475 views

Select and copy attributes features in ArcMap using Python add-in tool?

I'm trying to add a tool to an add-in toolbar to select features from an existing feature class and copy attributes to another feature class,from point to point. TopoHeight_Field_Name='Comment' def ...
3
votes
1answer
32 views

How to get connection info from an .ags connection file?

I am working on a Python script to manage ArcGIS Server services (publish new services, update existing services, delete old services, etc.) in batch across multiple environments (e.g. dev, test and ...
3
votes
2answers
522 views

Area in KM from Polygon of coordinates

I have polygons from coordinates in (python shapely) that looks like this POLYGON ((24.8085317 46.8512821, 24.7986952 46.8574619, 24.8088238 46.8664741, 24.8155239 46.8576335, 24.8085317 46.8512821)) ...
1
vote
1answer
37 views

Geoserver ReST update ImageMosaic

I am currently experimenting with the GeoServer ReST-API andy trying to update the configuration parameters of an ImageMosaic Coveragestore. I've been using Python 2.7 with the requests package as ...
3
votes
0answers
51 views

How to generate static heat maps server side?

I've been searching a way to generate server side static maps using Python (or any other languages, doesn't matter) I can create the maps I want with Qgis (And they look really great) but I don't ...
1
vote
2answers
38 views

Latitude/Longitude to city and zip, batch convertion

I have ~10 mln lat/lon points, and I need to extract city and zip code from them. I can do this with OpenStreetMap using the Nominatim API (using something like ...
1
vote
0answers
43 views

QGIS python support disabled

I'm having a problem with the python support of my QGIS version. When I start QGIS, I get the error message: Traceback (most recent call last): File "", line 1, in ImportError: Module use of ...
1
vote
2answers
69 views

Is it possible to round all coordinates in shapely?

Following on from How can I add points to a LineString in shapely?, I'm hitting a problem where floating point representations mean objects aren't precisely where I expect them be after they are moved ...
1
vote
1answer
288 views

How to add mdb geodatabase layer (feature class) to QGIS project using python?

I want to add a feature class of a personal geodatabase mdb to my qgs project by code (a plugin I am working on). I am using a command similar to that used for adding shapefiles, but this is not ...
2
votes
1answer
877 views

Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error

I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2). I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to ...
0
votes
1answer
47 views

Check if point is within radius of another point with Shapely

I've successfully used Shapely with python to check if a point is within one of a set of polygons in a .shp file but now would like to check if a point is within a circle of radius x miles from ...
2
votes
2answers
289 views

Convert DateTime field to Just Date in Label Expression

I have a DateTime field (ex: CreatedDate) and would like to only show the date with the label. How would I setup the label expression to do this using python?
1
vote
1answer
944 views

Import shapefiles into PostGIS using Python with psycopg2

I want to import shapefiles to PostGIS using Python with arcpy & psycopg2 to connect to PostGIS. I don't want to use the existing shapefile loader nor ogr, just write my own import tool. My steps ...
3
votes
0answers
53 views

Render Vector & Save as Raster

I am working with ENC files from noaa, specifically S57 format or ".000" to be as specific as possible. I am trying to render a layer or even the entire thing in a window but have had no luck. ...
4
votes
2answers
408 views

Is there a public API that can be accessed with Python and will geocode Points of Interests?

I recently downloaded tagged hospital data from OpenStreetMaps.org using the API. Some of the data have a 'node' tag which are attributed with a lat/long while other data are tagged as 'way' format ...
2
votes
1answer
49 views

How do I use geometry object in processing.runalg()

I am trying to clip a polygon (large road network) with every row in another polygon (district polygon) using PYQGIS. layer_adm_level = QgsVectorLayer(base_path + adm_level + ...
4
votes
1answer
54 views

Errror using the Simplipy QGIS plugin: 'QgsRasterLayer' object has no attribute 'selectedFeatureCount'

I am adding a raster in QGIS 2.14.1 and get this new error: AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatureCount' I am not programming, just using a QGIS menu. I am using ...
3
votes
1answer
1k views

Calculating angle of polyline at midpoint using Python/ArcPy?

Trying to calculate the angle of a line at its mid point using python; this will be used to display flow direction on a water network. I've developed this script, which works in terms of generating ...
1
vote
1answer
259 views

gdal_proximity distance to meters

I followed the answer given in this topic for searching the distance to the nearest coastline given a lat/lon coordinate. The distance output obtained is in degree (I think) but I need the distance ...
1
vote
1answer
33 views

Python module pyGTiff aligning data

I have been working with pyGTiff for a while and it works great. However my gis data does not have the same projection and extent. I saw that in the repository a a jupyter notebook with a test ...
2
votes
1answer
257 views

Generalization algorithms [closed]

Does anyone have the proper codes for line simplification and smoothing algorithms which is good to implement instead of ArcGIS algorithms? For example any of these: Visvalingam–Whyatt ...
0
votes
0answers
29 views

PyQGIS + Django Web Server — Not Working the Second Time Code Is Run

We are trying to create a standalone application on our local Django web server that uses PyQGIS to generate a series of maps based on a user's input. The user enters parameters on a web form and and ...
1
vote
0answers
31 views

Using Python-Flask-MongoDB with Geolocation field running on App Engine?

I'm trying to write an app which would act as a address caching API, so basically it needs to store addresses (geolocations) and later on I could query on a random address and radius and get all the ...
2
votes
2answers
149 views

QGIS - Edit UI - Python Init function localization with QTranslator

I have interaction with layer defined by custom designed UIs. In layer properties the following settings: Edit UI - customline.ui and Python Init function: customline_set.py. #coding: utf8 from ...
1
vote
2answers
115 views

Scripting (Python) Feature Class content into Shapefiles following an UTM data structure

Consider a Feature Class and two of its fields are "UTM_grid" and the "OID". Scripting with python 2.7 for ArcGIS 10.3. "UTM_grid" field contains the geographic info (e.g. B1SD40B) and was broken ...
1
vote
0answers
36 views

How to incorporate QGIS custom widgets into plugin? [duplicate]

Developing a plugin with Qt Designer for QGIS 2.14.1-Essen on Windows 7 and having trouble inserting the QgsCollapsibleGroupBox widget. I receive the following error: ImportError: No module named ...
6
votes
2answers
2k views

Is there a way to use ArcPy module in the python shell that is not with ArcGIS?

I have ArcGIS 10.2 installed on my machine. When ArcGIS was installed, python 2.7.3(32 bits) was also installed. I need python 2.7.5 64bits for some gdal functions. So I installed python 2.7.5 64bits ...
3
votes
1answer
57 views

Installing third party python libraries in ArcGIS location

I'm running ArcMap 10.2.2 for desktop and have Python 2.7 installed as part of the software package. I'm trying to get the pyexcel and xlutils libraries installed. I ran a script to find the path of ...
1
vote
0answers
37 views

Creating an ArcGIS toolbox with an R script

I posted this over on another website but since I think it might be an issue with ArcGIS, I decided to post it here also. So I have the following script in R. in_params[[1]] represents the input CSV ...
1
vote
0answers
27 views

Help with Python shapefile Union Program

First I am a Python noob... I have searched the database for this answer, found a few that might be the answer, just way over my head (I am signed up for a intro python class this month, to help ...
3
votes
1answer
39 views

How to create dataset in python with creation options like in ogr2ogr with -dsco options

In ogr2ogr there is dsco option (data source creation option). e.g. ogr2ogr -f DXF -dsco trailer=trailer_buildings.dxf -dsco header=header_buildings.dxf out.dxf test_buldings_shp.shp. It works well, ...
1
vote
2answers
216 views

QGIS Deployment in Citrix XenApp - How to Remove Pyramids from the image “properties”

I'm working on deploying QGIS 2.4 into a XenApp 6.5 desktop environment. We've tested QGIS to see if it will run in our environment on a test server and have found that building Pyramids with ...
1
vote
0answers
24 views

How do I change the pixel values of raster data from QGIS python plugin

I have been trying my hand at a QGIS plugin. The plug in reads raster layer data into an array, pipes the data to a C++ program, does processing over there, and pipes my results back. After a couple ...
2
votes
1answer
54 views

Python Geocoder w3w

I am trying to use w3w API with this python geocoder correctly. http://geocoder.readthedocs.io/index.html It works fine when I use it with google and bing maps import geocoder ...
2
votes
1answer
33 views

PostGIS query to get a list of points

I have a PostGIS road network layer (all features are linestrings) which I am accessing in Python and would like to get the geometry for each feature as a list of points. Something like ...
1
vote
3answers
87 views

32-days composite using LST 8-days Data

I want to make a 32-days composite from 8-days LST data by taking its average value, but I am facing a problem in checking QC-day, the other thing is, due to data gaps (missing DN values) we cannot ...
1
vote
1answer
9 views

How do I correct the GeoTransform of a GRIB dataset if I scale/crop the data?

I have modified the GRIB2 data to be cropped and a different size. I'd like to create a new GRIB2 file which contains this modified dataset. How do I calculate the new GeoTransform and create it using ...
3
votes
3answers
3k views

using Python to calculate NDVI, output as a Geotiff

I need a script that can calculate NDVI from two separate input Geotiff files, then output the results as a Geotiff. I wrote following script, most of which is borrowed from various on-line sources ...
0
votes
0answers
24 views

Python module for counting ratios from SHP attributes

Using OGR, I am supposed to create a Python module that finds out which specific administrative region of a country has the highest density of roads. I have two input shapefiles: roads connected ...
4
votes
1answer
474 views

How do I link OGR with spatialite?

Problem & Evidence: I'm trying to create a spatialite file with the code snippet below. However the outDataSource object gets assigned NoneType and all subsequent (unshown) code fails. I'm ...
0
votes
2answers
1k views

Unable to delete .lock files within geodatabase using Python

I am having problems with lock files while deleting and copying geodatabases for backup purposes. print "Now backing up your Geodatabase" distutils.dir_util.remove_tree ...
7
votes
3answers
7k views

How to create lines from points pair coordinates with arcpy?

I've got some points pair coordinates (start and end points) which I have to transform into lines. Until now, I used an append of both the coordinates in a pippo.Point(), a pippo.CalculateGeometry() ...
1
vote
3answers
49 views

Fiona error adding property to shapefile

I'm getting the following error when trying to add a property to a .shp file using fiona in python: Traceback (most recent call last): File "<ipython-input-38-5f04c3b56601>", line 17, in ...
1
vote
0answers
22 views

Export multiple Layer Definition Files (qlr)

I have a postgresql database with approximately 400 tables. I need to generate Layer definition files (qlr) in QGIS for each individual table. Making this manually would take huge amount of time, so I ...
16
votes
3answers
8k views

How can I iterate over map layers in QGIS python

I'm having trouble figuring out how to iterate over map layers. I can access the currently highlighted layer in the table of contents via iface.activeLayer() but I want my code to operate on all ...
1
vote
1answer
45 views

Merge points from multiple features that share common attribute

I have several point feature classes that all share similar attribute structure. How might I extract the points from all 9 feature classes that share a specific attribute? Background: There are 9 ...
1
vote
1answer
54 views

Why does joining all layers in a group not work?

I am attempting to re-join all layers within a group to another layer ("Main.shp") outside of this group. The idea is for users to change values in one of the group's layers. As these layers are ...
7
votes
1answer
204 views

gdalwarp producing empty rasters when called from python script, but not via command line

I'm trying to aggregate some raster data (all .tif) up to a coarser resolution (from .05 degree to .25 degree) using gdalwarp in python, but the command is not working. Instead of getting an output ...
0
votes
0answers
17 views

OGR WFS - GetNextFeature() - cannot parse - element arg attribute name had invalid value TYPENAMES

I am new to Python and OGR, and i try to follow advices given by Gene in ouvrir un WFS - debutant, but it fails... from osgeo import ogr driver = ogr.GetDriverByName('WFS') wfs_ds = ...
2
votes
0answers
51 views

Deployment of optical fiber QGIS Python

The subject that I’m working on is the deployment of optical fiber . I have a shapefile which represents a country containing homes. And I have another shapefile representing an infrastructure plan of ...