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
2 votes
1 answer
39 views

What replaces refFunctions plugin's intersecting_geom_count function?

I have been away for quite a while and it is probably a couple of years since I used the atlas features. I upgraded to 3.24 and I have just tried to generate an atlas from a saved layout. That ...
0 votes
1 answer
46 views

How to extract point data (latitude, longitude) of different soil variables from SoilGrids without actually downloading the TIFF files

Objective I have a dataset of ~200 observations, from scientific papers describing agroforestry, with associated coordinates (lat., lon.) dispersed all over the temperate world (US, Europe, China, etc....
1 vote
0 answers
26 views

To create a Function for graph of selected area from dropdown in Google Earth Engine UI

I want to develop a UI for my study purpose of JRC datasets available on the Google earth engine. Connecting it with the dropdown list of my state and district function. Already a zoom of the ...
0 votes
0 answers
14 views

Where is the SDE.SDEXMLTOTEXT() function located?

Oracle 18c 10.7.1 EGDB: In SDE.GDB_ITEMS_VW, there is a function being used called SDE.SDEXMLTOTEXT(): sde.sdexmltotext(d1.xml_doc) AS definition, sde.sdexmltotext(d2.xml_doc) AS documentation, sde....
  • 918
0 votes
0 answers
34 views

Handling internal reprojections for geoprocessing using R

Suppose I want to create a tool/function that has to, e.g., create buffers or measure distances internally to produce an output with a geographic projection. How do I ensure that the distance ...
  • 99
1 vote
1 answer
141 views

How to use "KERNEL_SIZE" in a Google Earth Engine code?

I found online the code below (Source of the code). I would like to implement it but I don't understand what "KERNEL_SIZE" means. When I run the script as it is now, I get the error "...
  • 139
0 votes
1 answer
85 views

Maintaining image id after mapping image collection in Google Earth Engine

I want to map a function over an image collection of Sentinel 1 images. After the calculation, the id and the properties are removed. I tried to maintain the id with .copyProperties in the return line ...
  • 139
-1 votes
2 answers
95 views

Calculating water mask over a large data set

I'm calculating a water mask with OTSU over an Image Collection with a large time frame, so the dataset is very large. When I shorten the time frame, it works. For the larger time frame, I get this ...
  • 139
1 vote
1 answer
63 views

Using intersect analysis within if loop as part of function

I'm currently trying to create a function for calculating an intersect of one of two shapefiles with another shapefile. I am later looping through the list of files and, depending on which one the ...
  • 13
2 votes
1 answer
286 views

median function of GEE

I want to do some reprocessing with ee.ImageCollection("NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG"). For example,I want to caculate median value of each pixel in 12 images. var imageCollection = ee....
0 votes
0 answers
25 views

Multiple functions linked to parameter in ArcPy Python Toolbox

I would like to link some parameters directly to its function, so when i call a .map() function it could apply for several images in the collection. def __init__(self): """...
0 votes
2 answers
79 views

Calculating number of days where a condition is met over multiple regions in Google Earth Engine

I have been trying to calculate the number of days where the wind speed average per day exceeded 25 m/s for all municipalities in Colombia during the year 2015. My goal is to know how many days ...
1 vote
1 answer
320 views

Filtering and adding GeoJSON features using function in Leaflet

I have a Leaflet map where I am adding the features from a GeoJSON file. I am able to filter the features depending on the properties in the GeoJSON. I am writing out the same giant block of code each ...
2 votes
0 answers
128 views

Calculating Annual Standard Deviation of Daily TRMM Precipitation

I am trying to calculate the annual standard deviation of daily data from 3hr TRMM observations at the catchment scale. First, I take a temporal sum of 3hr measurements to get daily P sums. Then I ...
0 votes
0 answers
36 views

Custom function (R equivalent) for quantiles in GEE

We are working on a problem in GEE where we want to extract the 90% quantile of NDVI values from a time series of MODIS images. The quantile function in GEE extracts the empirical value (i.e., the ...
1 vote
0 answers
104 views

Passing table name as an argument in PostGIS function [closed]

How can I pass my table name as an argument of a function? CREATE OR REPLACE FUNCTION public.countries_name1( z integer, x integer , y integer, name_prefix text default 'B' ) ...
  • 41
0 votes
1 answer
139 views

GoogleEarthEngine: Calculate histogram for every image in ImageCollection using map function and reduceRegion

I want to calculate histograms for every image in an ImageCollection with reduce.histogram. It works with a single image but I have problems mapping the function over the ImageCollection. I think the ...
  • 139
1 vote
1 answer
296 views

Set a property as a band value in Earth Engine

I have an image collection of MODIS monthly burn (MODIS/006/MCD64A1), in which BurnDate band is selected. I then have a function that calculates total burned area for each image (monthly). However, ...
  • 13
2 votes
1 answer
150 views

Scale Factors application not working on GEE PyQGIS

I'm trying to load some Lansadt 7 Collection 2 images on a QGIS project trought the following script: import ee from ee_plugin import Map ecorregiones = ee.FeatureCollection('users/paullcfias/...
2 votes
1 answer
145 views

Create Function to a RasterStack

This is the function that I want to create: Erosivity_Factor = 1.74 * log[sum(montly²/annual)]+1.29 I have solved it using a loop: # Reproducible RasterStack with 12 layers Monlty<- stack(lapply(1:...
0 votes
1 answer
176 views

Create a function that will return geodataframe

I have created the following function to take Origin = str, Destination = str, line = shapely.geometry.linestring.LineString, node = GeoDataFrame def create_lines_df(Origin, Destination, line_, nodes_)...
0 votes
1 answer
122 views

GeoServer SLD env function does not work

I have a database: and I made with it a GeoServer getMap request which works great for one year (one column). But I want to change the year programmatically with JavaScript (I am open for better ...
0 votes
1 answer
505 views

Python skipping functions

I have created the below code to grid an XYZ file to GeoTIFF using Python. However, when I run the code it seems to be skipping my functions within the class. I tried print statements within them and ...
3 votes
2 answers
177 views

Calling specific row using ArcPy search/update cursors

When working with search and update cursors, how do I call upon a specific row? In this example: import arcpy, os # I want to find a row where the FID is 10 # print value field in the row where FID ...
  • 69
0 votes
1 answer
59 views

Raster calculator - negative exponential transformation gives single-value output

I'm trying to apply a negative exponential transformation to a raster with values ranging from 0 to 1. In the literature, the function to do so is R = 100 - 99 * ((1 - exp(- c * H)) / (1 - exp(-c))) ...
  • 107
1 vote
0 answers
314 views

What is function of .horizon files in file geodatabase?

What is the function of the .horizon files that are present whenever a file geodatabase is created in ArcMap, I understand it is all proprietary formats for Esri, but is there any explanation? I have ...
  • 11
2 votes
1 answer
127 views

lidR classify by shapefile (merge_spatial) issues with user defined function

I have successfully classified buildings via a buildings shapefile input for a single las file but I am having trouble with making a function to use this feature in the catalog format. Here is the ...
0 votes
1 answer
115 views

How can I merge the bands for each ID to create two multi-band TIFFs in R?

I have 16 separate raster files, named by ID and band, for 8 bands and 2 IDs. How can I merge the bands for each ID to create two multi-band TIFFs? Here are my data: dput(rastlist) c("...
  • 367
0 votes
1 answer
44 views

Calling a function with an image output to add in map layer

I am trying to estimate the LST using the thermal band (Band 10) of Landsat 8. I have written the final calculation of LST from the brightness temperature under a function. But I am getting trouble ...
2 votes
1 answer
161 views

PostGIS trigger : table and materialized view

I have a PostGIS polygons table for my "cities". I have a point table for my "boreholl". I created a "mv" materialized view defined by a spatial join as follows: SELECT ...
  • 731
0 votes
1 answer
281 views

Accessing elements from a list in Google Earth Engine

I am accessing the properties of an image collection in GEE. I have created an image collection and assigned it to the variable "collection". When accessing the date range I used the ...
1 vote
2 answers
66 views

Undesirable behavior of PostGIS function st_isvalid

I deal with forest inventory geodatabase that contains a lot of polygons. Those polygons come from some software that allows topologically incorrect data. So I should check the polygons. Performing ...
  • 791
1 vote
1 answer
413 views

Google Earth Engine-function (image) condition

Is there a way to set a condition inside function(image) in GEE? In my case, I am trying to return images with NDVI<0.2 only and use them in qualityMosaic function to generate a composite (with ...
  • 11
2 votes
1 answer
46 views

Vector line layer classification with two functions in QGIS

I have a linear geometry layer with the attribute: "uuid_przys". I would like to classify my layer with the uuid-attribute, but only for the objects in the current map view or for the ...
  • 65
3 votes
2 answers
1k views

Statistics of each image in an ImageCollection in Google Earth Engine

I have an ImageCollection that I made calculation with so that it now contains images that show a ratio of one band within a given Polygon. I would like to get the mean and standard deviation for each ...
  • 111
2 votes
1 answer
128 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 ...
  • 111
0 votes
1 answer
412 views

Resolving "Dictionary does not contain key" error applying function to feature collection in Google Earth Engine

I am adding two properties to each feature in a feature collection based on two images within each feature, currently represented as properties themselves. I got this feature collection through ...
1 vote
2 answers
259 views

QGIS function layer_name in fieldcalculator batch-mode

Working with QGIS 3.10, I want to use the @layer_name function in batch mode for all layers in a project. In individual cases, I do this via the field calculator. I also found the script for the field ...
1 vote
1 answer
212 views

Mapping a function to an image collection, then displaying specific images from new collection Google Earth Engine

I'm trying to extract fires from a collection of Landsat images. I have this function that can process a single image, but when I try to use the Map function to map it onto a collection it doesn't ...
2 votes
1 answer
915 views

Using PyQt in PyQGIS inside QGIS 3.16

This code Using PyQt5 extracted from http://www.tutorialspoint.com does not work when I add it in a script in the console of QGIS 3.16. Can you enlighten me on this subject? import sys from PyQt5 ...
1 vote
1 answer
1k views

Error "Element.get: Parameter 'object' is required" mapping to a list in Google Earth Engine

I'm running my code where I create weekly averages of a variables which are mapped to a list of days of year (DOY). var SSTA_7d = ee.ImageCollection.fromImages( years.map(function (y) { ...
1 vote
2 answers
150 views

Add unique id to merged attributes tables QGIS

I need to find a way to stack up numeric id fields from two tables without duplications. To put it simply here is what I want to do schematically : Table 1 Id 1 2 Table 2 Id 1 2 3 Expected ...
0 votes
1 answer
263 views

Error using.getInfo function within a function Google Earth Engine

I'm applying a function to map a calculation over a list of dates. In the old calculation I just manually entered each date and ran the code. As part of if that code I would use .get('year).getInfo() ...
0 votes
0 answers
98 views

Using a feature in a function in OpenLayers

I want to use in the get_pdf_data function the data loaded in the "imobile" vector so that I can perform operations with the "imobile" vector. The code I'm trying to do this with ...
2 votes
1 answer
477 views

ST_Line_Substring doesn't work

I want to split some line strings using ST_Line_Substring. My basic query works: SELECT ST_LineLocatePoint(b.geom_way,ST_ClosestPoint(a.geom,b.geom_way)) as Loc_Point FROM splitpoints a CROSS ...
  • 23
6 votes
4 answers
265 views

Reclassify raster values continuously instead of assigning them to specific groups

I want to create a Habitat Suitability Index (HSI). I have several variables (raster layers containing information about e.g. precipitation, slope, food resources, etc.). I have to create an "...
11 votes
1 answer
533 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 ...
  • 1
4 votes
1 answer
355 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 # ...
  • 87
0 votes
0 answers
48 views

GeoServer filter function reference

This Program/Project is working. Using the centroid function, I am able to filter the layer but I am confused about how to add another function where I can get the integer value from the column "...
  • 1
2 votes
1 answer
153 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, ...
  • 918