Skip to main content

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
0 votes
0 answers
10 views

How can I apply <ogc:And> inside <ogc:Function name="if_then_else">

The example: <CssParameter name="fill"> <ogc:Function name="if_then_else"> <ogc:And> <ogc:Function name="greaterEqualThan"> &...
Beettle Juice's user avatar
1 vote
2 answers
42 views

error: Too many arguments to function

I want get 4 objects from histogram of a dataset in 136 line of code. getting one object is ok but for getting 4 objects (NDVI_before_histogram', 'NBR_before_histogram', 'gNDVI_before_histogram','...
Elahe Zafarian's user avatar
0 votes
1 answer
37 views

Combine dissolve aggfunc and lambda function

I am looking to aggregate different polygons and applies analytical functions at the same time. I have tried: df.dissolve(by=['ville','arrondissement','quartier'], aggfunc={'transaction':'count','...
bravopapa's user avatar
  • 485
0 votes
1 answer
18 views

Changing property name within function in Google Earth Engine

I'm working with Dynamic World and am building functions that calculate zonal statistics of different land cover properties over time. In the code below, I have a binary image called for_2017 which is ...
user157564's user avatar
1 vote
1 answer
19 views

GEE function to apply annual reducer for multiple years in image collection

I'm working with a GEE image collection that includes multiple images for each year var studyRegion = ee.FeatureCollection("FAO/GAUL/2015/level0") .filter(ee.Filter.eq("ADM0_NAME", ...
user157564's user avatar
0 votes
0 answers
14 views

A function to change a GPS' exported code into viable lines / polygons

One of my older GPS systems records and exports the point type that it measures though a code. For instance: 1111 means it's a line that's part of a polygon belonging to a floor. -1111 would be the ...
Raf's user avatar
  • 1
1 vote
0 answers
48 views

Why does the QGIS "age" function return different results as the arcade "datediff" function in ArcGIS Pro?

In my current project, I am required to convert QGIS-Layers into an ESRI Environment. The QGIS Layers are using a rule base symbology which calculates the age in months using the current date and the &...
Robert Buckley's user avatar
0 votes
0 answers
18 views

QGIS: Saving a custom Python function from the Function Editor to OPKG/QML

As the title states, I'm trying to save a style to OPKG or QML. The problem is that I have used a custom Python function within the 'Function Editor' in the symbol section, which is currently not ...
Julian W.'s user avatar
1 vote
0 answers
34 views

PostGIS Window Functions (accoring to https://postgis.net/docs chapter 13.2) errors

i have just tried to run some of the examples on posgits.net/docs 13.2 - windows functions and took the code from the examples provided by the corresponding pages. the following functions returned an ...
robert tuw's user avatar
0 votes
1 answer
55 views

Mapping, Iteration and conditional selection on featureCollection in GEE

I want to make a function (possibly using Currying method) in GEE to do a modification of my featureCollection. In the code bellow I wrote a function_infunction to add a new property "label" ...
Sina NAKHOSTIN's user avatar
1 vote
1 answer
76 views

How to filter by a list of values in a WFS request?

I'm using the following GetFeature POST request (to http://localhost:8080/geoserver/wfs) trying to query the sample "bugsites" layer that ships with GeoServer. The request is supposed to ...
goofy4224's user avatar
7 votes
1 answer
250 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
64 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
74 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
47 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
92 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
281 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
84 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
147 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
122 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
169 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
90 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
26 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
313 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
245 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
48 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
89 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
264 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
  • 186
0 votes
1 answer
562 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
  • 1,093
0 votes
0 answers
385 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
380 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
1k 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
938 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
146 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
80 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,172
0 votes
0 answers
39 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
597 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
  • 179
0 votes
1 answer
385 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
  • 179
-1 votes
2 answers
271 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
  • 179
1 vote
1 answer
287 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
2k 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
206 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
464 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
261 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
1 vote
1 answer
470 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
  • 179
1 vote
1 answer
765 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
483 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
400 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

1
2 3 4 5