Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

0
votes
1answer
14 views

Arcpy If Then Else statement against selected records

I am working on a Python script that will count how many selected features there are and if there are it will make a feature layer from them. If the script runs and finds there are 0 selected records ...
0
votes
0answers
8 views

QGIS 3 and Python import qgis.core error

I am trying to set up QGIS3 and python so I can write a script that uses GDAL- I want to do this from the OSGEO4W shell. I have read a lot of questions and followed some tutorials which led me to do ...
0
votes
0answers
15 views

How to create a .tiff from ndarray in Gdal [on hold]

I am stuck with a code. I am trying to store as .tif some ndarray. From some other forums I have recovered the following function. Still I do not understand why is on hold... is related to GIS. ...
1
vote
1answer
11 views

Enable tile caching for a layer

I published around 1000 layers in geoserver without enabling tile caching for layer.How to check a cache is enabled for a layer or not and How to enable tile caching (check box) for a layer under ...
0
votes
0answers
15 views

PyQGIS - Automatically download local map

I am trying to develop a program which will completely automatically generate a QGIS project to display data I have collected. In order to do this I need some way of automatically downloading some ...
0
votes
3answers
31 views

Element Tree and Regex [on hold]

I want to findall tags that match root.findall("{http://trimble.com/schema/fxl}FeatureDefinitions/{http//trimble.com/schema/fxl}PointFeatureDefinition") or "{http://trimble.com/schema/fxl}...
0
votes
1answer
11 views

LecoS batch processing - Is there an easier way?

I'm using the LecoS software: https://github.com/Martin-Jung/LecoS I've clipped my raster to reduce processing time to focus in on the areas I'm interested in. The entire raster has 11 classes, but ...
1
vote
0answers
26 views

Can't get gdal_calc.py to work

I am new to python and QGIS (have some experience with arcpy). I am trying to multiply two .tif files together using gdal_calc.py but I can't get it to work. It just returns the error invalid syntax. ...
1
vote
1answer
21 views

How to remove part of a string value in the attribute table of a shapefile in PyQGIS

I have a number of shapefiles with a field in the attribute table containing many different string values similar to this one: 'Waypoints_17-JUL-18Timothy waypoints.shp Waypoints_17-JUL-18Timothy ...
0
votes
0answers
14 views

Process ndarray with gdal [on hold]

I have an ndarray (results of a netcfd process) with shape (720, 100, 100). The first dimension refers to months from 1958 to 2017, this means 12 months over 60 years. The ndarray is organized jan1958,...
0
votes
1answer
28 views

Importing Survey123 SQLite Database from Device

I need to import an SQLite database generated by ESRI Survey123 to a csv or some other useful format. I modified this script so that I can use arcToolbox to acquire input and output parameters. I am ...
0
votes
0answers
11 views

Keep getting an attribute error in kivy python [on hold]

I have followed the kivy tutorial on for the ping pong gajme on there website. I have copied and paste all there code as min wasnt working and it still wont work. It brings up a plain white window and ...
2
votes
1answer
41 views

Efficiently read large tif raster to a numpy array with GDAL?

I have been using the Python GDAL API to read tif raster files as NumPy arrays. Previously, I simply read the raster into an array directly with GDAL: ds = gdal.Open('example.tif') fullarray = np....
2
votes
1answer
38 views

From SWEREF99 to EPSG:3857

I have a huge dataset of coordinates referenced with the SWEREF99 coordinate system. Now I would like to convert all these coordinates (and other data as well) to a coordinate system that can be ...
1
vote
0answers
27 views

How export geodatabase version differences in ArcPy?

With ArcObjects I have this code in C# to export the differences to a XML file: ESRI.ArcGIS.GeoDatabaseDistributed.IVersionDataChangesInit pVDataChgs; var pvTemp = new ESRI.ArcGIS....
0
votes
0answers
18 views

Channel Easements for County: Need help with Query or Python

I have a layer for easements for a whole county and need to find each easement either MISSING or having a PART of what the county calls "STW_ARCS." These ARCS are what the county have data on for how ...
0
votes
0answers
14 views

Change the TypeName of a field in PyQGIS [duplicate]

I am developing a plugin for QGIS. I would want to change the TypeName of a field from 'textEdit' to 'Value Map'. I found the documentation on QGIS.org qgis.core.QgsField.setTypeName. But I can't ...
0
votes
0answers
11 views

Change raster values in relation to values of another raster in Python

I used 'gdal_rasterize' to create two rasters from shapes (raster 1 and raster 2) os.system('gdal_rasterize -burn 1 -at -a_srs EPSG:4326 -ts 25000 25000 ' + r'C:\shape.shp' + r' C:\raster.tif') ...
1
vote
1answer
34 views

Numpy array to raster with ArcPy [on hold]

I have a Python script to download data in netCFD format. I have managed to extract the information I need in a masked array. This looks like: print(my_array.shape()) >> (700, 299, 217) As a ...
0
votes
0answers
18 views

Convert total area calculation from ogrinfo (cli) to python ogr

How can I do this command (source): ogrinfo -q -sql "SELECT SUM(OGR_GEOM_AREA) AS TOTAL_AREA FROM way" way.geojson with Python ogr? from osgeo import ogr
1
vote
1answer
48 views

Select feature by id in QGIS using Python

I have a ComboBox shows feature ids of selected features in a layer. I am trying to select one feature using ids in ComboBox currentIndex. I used setSelectedFeature(), but it didn't worked.I can't ...
-1
votes
0answers
30 views

xarray assign time, latitude & longitude to `Dimensions` of netcdf file [on hold]

I have downloaded vegetation health data from the NOAA FTP service here. The help documentation is here. There are 2030 weekly files so I seek help doing this in parallel. In [0]: ls | wc -l ...
0
votes
0answers
27 views

Adding a Tiles/wms? (openStreetMap) layer with python in QGIS

In my QGIS python plugin I want to add a background map (if the user haven't added one), hence I think I missing something in the url for the Tiles/wms service.. (the function returns invalid layer) ...
1
vote
0answers
36 views

Moving a feature to a new XY coordinate

I know how to move a point feature to a new location based on an updated XY coordinate. For example, joining an Excel or dbf table with the new XY cords to the production feature class attribute table ...
0
votes
0answers
9 views

How to use our polygon intersect on all rows on 2 dataframes

If I have to intersect all rows of one dataframe geom column with another dataframe geom column without using for loop, how can I do that? geom1 = ogr.CreateGeometryFromWkt(df['geom_value'][0]) ...
0
votes
1answer
35 views

Python: Open a (line) Shapefile and calculate distance to point given as a longitude-latitude tuple

I have a pandas dataframe in python with longitude and latitude values of certain locations (see sample below): Index Long Lat 0 -98.58 ...
2
votes
2answers
18 views

Replace several coordinates by its mean value grouped by multiindex Pandas

I have a table with some info that are getting by a GPS, in my table I have this structure: Date Time Latitude Longitude Accuracy Weather Visibility ViewPoint Species Bearing ...
0
votes
0answers
14 views

Python Google Maps 3d View

I followed this tutorial http://hci574.blogspot.com/2010/04/using-google-maps-static-images.html, and I can do this : http://maps.google.com/maps/api/staticmap?center=36.7820204,-2.811997&zoom=10&...
0
votes
2answers
36 views

Python library for KML to GeoJSON?

I am writing a Python script to reproject a KML file to WGS 84 and then to convert it to a GeoJSON. I am aware of and use the GDAL command line tool ogr2ogr (which was the answer to this question in ...
1
vote
1answer
38 views

Take pixel locations from rasterio raster and write out shapefile

I'm pulling a satellite image into python with rasterio, running some analysis to find a specific bounding box within that image, and then want to write those points out as a shapefile. I'm struggling ...
0
votes
2answers
26 views

osgeo available in QGIS, but not in mac command line interface

I am getting an error when I try to import osgeo from the python console on my mac (OS 10.13.6): >>> import osgeo ModuleNotFoundError: No module named 'osgeo' As far as I know, GDAL is ...
4
votes
0answers
65 views

GDAL grid Not recognizing csv as having geometry

NON-DUPLICATE EDIT: This question is not a duplicate because I have tried the solution presented as the answer to the "original" question and it did not work. See results below. I am attempting to ...
1
vote
0answers
35 views

Change attribute of a line according to overlapping polygon features

I'm pretty new to QGIS and python in general. For my work I'm faced with a bit of a problem. I got 100-m-segments of several streams and polygon-features of the surrounding substrate. The polygon ...
1
vote
1answer
21 views

EPSG conversion and image rotation in folium

I'm using Python's folium library (which uses Leaflet) to display images over a map. However, my original data uses EPSG:3035 and folium uses EPSG:4326 (WGS84). There is a rotation when converting ...
2
votes
1answer
28 views

Extracting GPS points inside the region boundary

I have large set of GPS coordinates of human mobility in different parts of China, but I am only interested in points in Beijing City. These points are in excel csv file that I read into pandas ...
1
vote
0answers
12 views

Indexing derivative tiles / pyramids?

I don't have any formal education in GIS so I'm thinking that I'm looking for something that exists, I just don't know what it's called. I basically have a large raster data set that will get re-...
0
votes
0answers
13 views

Multiple memory transfers Python Script using Gdal (gdalwarp) w/ GPU on JPEG2000 Datasources

I'm looking at writing a python script that will open a jpeg2000 datasource and decompress it on the GPU, then warp that data using gdalwarp with opencl (also on the GPU) My question is, will the ...
1
vote
0answers
21 views

Dividing Geographical region into equal sized grid and retrieving indexing position

I have GPS coordinates of human mobility in Beijing Area. I want to divide geographical space in to rectangular grid, for example 2 sq. km (delta), and access the indexing position of any point inside ...
0
votes
1answer
18 views

Concave hull error: not enough arguments

I am trying to run concave hull on a points layer, but I keep running into this error: TypeError: translate(str, str, disambiguation: str = None, n: int = -1): not enough arguments What am I doing ...
0
votes
1answer
31 views

Find the number of sides that intersect between two or more polygons

I am currently struggling to find the number of sides that intersect between two or more polygons in a layer, the layer contains around 2700 polygons. All polygons have a rectangular form, as it can ...
1
vote
1answer
28 views

Reprojecting XYZ coordinates in Python whilst keeping Z coordinate constant

When doing a reprojection from a projected coordinate system (e.g. EPSG:28992) to a geographic coordinate system (e.g. EPSG:4326), the Z coordinate gets an offset of 45 meters. The Z coordinates of ...
0
votes
0answers
19 views

Converting .pbf to PostrgreSQL table using osm2pgsql

Hello GIS StackExchange! I trying to import a .pbf file into a PostgreSQL table using osm2pgsql in python using the subprocess module. The command works perfectly in the command-line, but when I ...
0
votes
2answers
82 views

How to download Sentinel2 L1C using AWS Python SDK (boto3)

The permissions for Sentinel2 L1C changed today https://www.sentinel-hub.com/faq/how-will-access-permission-changes-aws-bucket-affect-users-accessing-data-directly-non-sentinel# How can I send a '...
1
vote
0answers
24 views

Why does my Fiona output look different from my image

I'm trying to export my houghlines as a shapefile, which works. But the output the lines in my shapefile are very different then the generated hough lines that are shown on the image. Example: The ...
0
votes
0answers
33 views

AttributeError: Myclass instance has no attribute 'x'

I am trying to select a feature from the layer using my plugin. When working with my plugin in main Python function using QGIS, I receive an AttributeError when I call a class method from within the ...
0
votes
0answers
17 views

Load shapefile in PostgreSQL with intersection rule

I have one segmentation shapefile vector that I would like to load in a PostgreSQL database. However I need to remove the polygons created in background values of landsat image. Since I have a big ...
3
votes
1answer
65 views

Cannot install a version of GDAL via Anaconda that permits reading BigTIFFs

I have some BigTiff files that I need to read into Python using gdal to do some analyses. According to GDAL's documentation: When built with internal libtiff or with libtiff >= 4.0, GDAL also ...
0
votes
1answer
26 views

gdal_translate with custom corner coordinates in python

I wish to convert this Python code using a gdal command line tool to using the gdal python library. I am using it to convert some PNG satellite images I am downloading to georeferenced TIFFs. I ...
0
votes
1answer
20 views

Dissolving polygons based on multiple attributes with Python (shapely and fiona)?

I would like to dissolve a polygon shapefile based on two different fields, using Python and open source libraries. I'm just able to dissolve the shapefile using one single field, with Gene's answer ...
0
votes
2answers
41 views

UI CHARTS ( for indices time series in python API of Google earth Engine)

If I use python api for google earth engine and want to make a UI chart for mean value of NDVI for a particular year , how does the UI.CHART function work in python api for google earth engine.