Questions tagged [function]

A programming function is a type of procedure or routine. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not return a value.

Filter by
Sorted by
Tagged with
8
votes
2answers
20k views

Leaflet layers on different zoom levels. How?

I've added a polygon layer and a point layer to my leaflet map. I would like the points to appear after a certain zoom level or when a "click" event occurs e.g. (polygons.on("click", function....) ...
5
votes
1answer
1k views

referencing to features geometry in an expression

I have a layerA with roads and a layerB with one shortest path. If I put an aggregate function into a virtual field in layerB to calculate the sum of fieldAA where the shortest path contains features ...
2
votes
1answer
66 views

Function-based spatial index: Use sdo_geometry() constructor instead of custom function?

I have an Oracle 18c table that has XY columns, but not a SHAPE column. I've created a query on the table that dynamically generates an sdo_geometry SHAPE column. sdo_geometry(2001, 26917, ...
10
votes
1answer
271 views

Listing all functions available in QGIS's Virtual Layer

How can I get automatically a list of all functions available for usage in QGIS's Virtual Layer? From my own understanding/experience and the QGIS Documentation, QGIS's Virtual Layer employes a ...
11
votes
3answers
7k views

Extracting part of string from field in QGIS Field Calculator?

I want to create a new field in my attribute table. My goal: returning all digits between the / and _ characters of the field named "location" by applying the next expression: regexp_substr( ...
1
vote
1answer
576 views

Google earth engine - set null band values as zero

I have a function which assigns a score depend on the value of a band, which I then map to an image collection. However, in some cases, I have null values, where no value is given. In these cases I'd ...
5
votes
1answer
247 views

How to re-use an expression, stored as a string, in QGIS Field Calculator

As discussed in this question, QGIS automatically saves recently used expressions in the field calculator. But recently used expressions are deleted after a while. Sometimes I need to re-use an ...
4
votes
1answer
147 views

Subsetting multiple rasters with multiple shapefiles using Python

I want to subset multiple raster files with multiple shapefiles and the following code is working (it is not the whole code, only the part for the subsetting). I am using Python 3.6.8 i_shp = 0 # ...
3
votes
1answer
293 views

How to use a Processing Algorithm in a expression function used in a Geometry Generator (Points Along Lines "on the fly")

I want to use the Processing Algorithm, pointsalonglines, in the expression function used in Geometry Generator. This is because I want to create points "on the fly" along my line and in a ...
2
votes
1answer
57 views

Mapping ratio function over ImageCollection in Google Earth Engine

I am trying to map a function over an ImageCollection to receive the ratio in a polygon, how it compares to a certain point (pt) for each image. So all pixels within the polygon divided by the value ...
1
vote
2answers
287 views

QGIS 3.4 feature filter maximum() does not work

I would like to filter a layer with the maximum value of field_a, grouped by field_b. I tried this expression: "field_a"= maximum ( "field_a","field_b") But it doesn't work (there are no more features ...
1
vote
1answer
223 views

Use SDE.ST_GEOMETRY functions in a custom function

I have a dummy query where I generate an SDE.ST_GEOMETRY point: select shape as srid_test from ( select sde.st_geometry ('point (10.01 50.76)', 4326) as shape from ...
1
vote
1answer
230 views

Seeking Function to calculate red-edgeNDVI in Google Earth Engine?

I am trying to calculate the red-edgeNDVI ((NIR – red edge)/(NIR + red edge)) of an Image.Collection in Google Earth Engine. There is a built in function for NDVI but not for red-edge NDVI. The code I ...
1
vote
1answer
1k views

image.substract is not a function

Link to GEE function BAI(Im){ var pcr = 0.1 var pir = Im.select('B3') var pcnir = 0.06 var pinir = Im.select('B4') var one = 1 var bai = one.divide(pcr.subtract(pir).pow(2).add(pcnir.subtract(pinir)....
0
votes
0answers
388 views

Problem in running r.slope.aspect in GRASS

I am new to GRASS GIS, and have been trying to use the r.slope.aspect function to find out the slope, dx and dy rater map from an elevation map(512*512)[1]. But I am getting the following output: ||...
0
votes
0answers
277 views

Connect to local file or PostGIS layer in field calculator QGIS

I'm trying to make query from field calculator so that it would be possible to connect to PostGIS layer (or local file on computer) and select data according to condition so that use this selection ...