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

Working with expressions inside variables in QGIS

This is a follow-up based on the question asked and answered here: (Using attributes tables as variables on QGIS), I named all my layouts according to the "map_code" column + a short for the ...
silf's user avatar
  • 197
0 votes
0 answers
61 views

Filter long shaped polygons

I have a PostGIS database with a layer of 60k polygons, some of them erroneous. These erroneous polygons are extremely narrow, long shaped. Maybe I can best describe them as 'Needle' shaped polygons. ...
GIStrees's user avatar
  • 119
2 votes
2 answers
69 views

Check if polygon falls inside other polygon with 2 layers

I have two polygons layers with SRID 4326, indexed in a PostGIS database. Layer 1 is a country layer. I want to check whether the polygons (> 60k instances) from layer 2, fall inside the boundaries ...
GIStrees's user avatar
  • 119
0 votes
1 answer
39 views

Is my install really missing Spatial Functions in DB2 Spatial Extender?

I'm running a number of Spatial Functions in DB2 (11.5 LUW) and getting back errors such as: SQL Error [42884]: No authorized routine named "ST_ENDPOINT" of type "FUNCTION" having ...
Yndigo Dream's user avatar
-1 votes
1 answer
76 views

Using functions If and When

I am trying to find out which functions am I supposed to use, in order to get the values that I need. The Table should look like this. I have all the values available, now I am trying to get different ...
MeowLetNo's user avatar
0 votes
0 answers
12 views

Calculation surface area for every cells [duplicate]

Surface area= Plan area /cosine (in Radian) slope. I used cell plan area by multiplying cell size for example 12,5*12,5=156,25square meters Surface Area = 156,25/cosine slope result became surface ...
Mojtaba's user avatar
0 votes
1 answer
164 views

Make a CSV file or table into an ImageCollection in GEE

I have a CSV file that has 30 years of annual data that relates to my ROI. For the analysis I am doing, I want to turn this CSV file into an ImageCollection with each image being a single year having ...
rebeccalm's user avatar
1 vote
1 answer
61 views

GEE cycle if for skip the null value from Modis "'Day_view_time'" band

I trying to take the time value from Modis band and convert it from local solar time to UTC. After I need to concatenate it with date which I take from system;time_start and print all statistics. ...
Anastasiia's user avatar
3 votes
2 answers
132 views

Creating raster based on function of distance to points and assorted attributes in QGIS

In QGIS 3.30 I have a dataset of points associated with several values, call them integers A and B. I want to create a raster with maybe 5km x 5km pixels where the value associated with each pixel ...
Richard Laxton's user avatar
1 vote
1 answer
96 views

How to create a function or loop to import training data for several regions in GEE at once

For several supervised classifications I want to assign training data from one feature collection to several regions, for which I have a quality mosaic each. My dataset for the feature collection ...
pottsbill's user avatar
0 votes
0 answers
160 views

Python code location for QGIS functions

Is the Python Code accessible for QGIS function definitions? My knowledge of Python is limited but I have had success tweaking code in Ruby. So I am willing to give it a try but would like to see the ...
Mike's user avatar
  • 91
0 votes
1 answer
78 views

GEE, name automaticaly an image to export to drive

I would like to create a function so that my image description has the date im using to filter my image collection. var BURNED = ee.ImageCollection("MODIS/061/MCD64A1") ....
yasmin.gelli's user avatar
1 vote
1 answer
25 views

GEE, function, max Y values for each X

I would like to create a function to plot just the higher y values for each x. For example: var x = ee.List([01,01,01,03,04,05,05,09,10,10,10,11,12,13,14,15,16,17,17,20]) var y = ee.List([19,19,18,16,...
yasmin.gelli's user avatar
1 vote
0 answers
222 views

QGIS function line_locate_point

What are the arguments (Line', 'id', '1') of the function line_locate_point( geometry:=geometry(get_feature('Line', 'id', '1')), point:=$geometry) stand for? 'Line' is obviously the name of the ...
Jakob_DB_EC's user avatar
0 votes
2 answers
224 views

ArcGIS Pro: Calculate Field function to do multiple string calculations in one code block

I need to strip leading and trailing whitespace, split string into list to remove excess whitespace between words and uppercase all values within one Python code block and calculation in Pro field ...
Ms05's user avatar
  • 125
3 votes
1 answer
46 views

PostGIS: relational value for spatial intersection

I have two layers: nomen : point layer nomenclature : polygon layer In PostGIS, when adding a point, you must take the nomenclature value by intersection with the polygons layer and insert it in the ...
Manu's user avatar
  • 31
3 votes
1 answer
77 views

Custom ST_MultiSplit PostgreSQL function error, to split one layer with another

I have a lines layer which I would like to split with a points layer. I first created the a ST_MultiSplit function: CREATE OR REPLACE FUNCTION ST_MultiSplit(geom Geometry, blades Geometry) RETURNS ...
Ian23's user avatar
  • 75
3 votes
1 answer
208 views

Changing color of newly created line feature on mouseover in Leaflet?

How to highlight one feature on hover from a featureGroup layer? It's easy when the layer is predefinied and static - I could write a highlighFeature and onEachFeature functions and pass them as ...
Maryla's user avatar
  • 158
0 votes
1 answer
449 views

Aggregate raster using gaussian smoothing as a custom function/Units of the sigma

I am trying to aggregate a raster using a custom function and the terra package. For the custom function I am using a Gaussian smoothing. When I try to run the aggregate function I am getting this ...
Nikos's user avatar
  • 968
0 votes
0 answers
326 views

How to merge Map.addLayer on the Google Earth Engine

i'm working on vector data on the google earth engine. I want to make my script layer more simple. how to make my Map.addLayer script only 1 line script? I have tried to combine it with ".merge()&...
Martanti Aji's user avatar
0 votes
2 answers
340 views

Using variables within function to assign values into dictionary using Google Earth Engine JavaScript API

I'm building a function that updates a dictionary (in a feature of a FeatureCollection) with values calculated within the function. I use the variables 'HighDeg', 'MildDeg' and 'NoDeg' to store the ...
Camila's user avatar
  • 1
4 votes
1 answer
878 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 QGIS 3.24 and I have just tried to generate an atlas from a saved layout. That ...
Russell Fulton's user avatar
0 votes
2 answers
731 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....
Kamau Lindhardt's user avatar
1 vote
0 answers
134 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 ...
Aditya Singh's user avatar
0 votes
1 answer
61 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....
User1974's user avatar
  • 1,122
0 votes
0 answers
38 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 ...
jslth's user avatar
  • 101
1 vote
1 answer
528 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 "...
lena's user avatar
  • 159
0 votes
1 answer
350 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 ...
lena's user avatar
  • 159
-1 votes
2 answers
257 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 ...
lena's user avatar
  • 159
1 vote
1 answer
259 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 ...
Mkn's user avatar
  • 13
2 votes
1 answer
1k 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....
黄泽盛's user avatar
0 votes
2 answers
195 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 ...
Perla Rivadeneyra's user avatar
1 vote
1 answer
1k 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 ...
grantiago's user avatar
2 votes
0 answers
426 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 ...
sharsid94's user avatar
1 vote
0 answers
252 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' ) ...
DARK's user avatar
  • 41
0 votes
1 answer
422 views

Calculate histogram for every image in ImageCollection using map function and reduceRegion in Google Earth Engine JavaScript API

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 ...
lena's user avatar
  • 159
1 vote
1 answer
677 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, ...
hrbrnsn's user avatar
  • 13
3 votes
1 answer
429 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/...
Paul León's user avatar
2 votes
1 answer
380 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:...
francisco corvalan's user avatar
0 votes
1 answer
370 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_)...
Kareem Alaraby's user avatar
0 votes
1 answer
356 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 ...
KerryKilian's user avatar
0 votes
1 answer
2k 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 ...
GIS_User2's user avatar
3 votes
2 answers
390 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 ...
Ellie 's user avatar
  • 69
0 votes
1 answer
199 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))) ...
Beardedant's user avatar
3 votes
0 answers
1k 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 ...
Deepitk's user avatar
  • 31
3 votes
1 answer
286 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 ...
nerdsconsider's user avatar
0 votes
1 answer
345 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("...
Nikos's user avatar
  • 968
0 votes
1 answer
130 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 ...
Swadhina Koley's user avatar
2 votes
1 answer
399 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 ...
user35117's user avatar
  • 929
0 votes
1 answer
742 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 ...
pauldanc's user avatar

1
2 3 4 5