Questions tagged [syntax]

the structure of statements in a computer language.

Filter by
Sorted by
Tagged with
4 votes
2 answers
309 views

Why do single-part WKT polygon vertices require double parentheses?

Regarding the WKT standard: Wikipedia: Well-known text representation of geometry Why do single-part polygon vertices require double parentheses? That seems inconsistent with single-part points and ...
user avatar
  • 828
0 votes
0 answers
28 views

Advanced version of zoom and property functions in MapBox-GL JS

I am using the "zoom and property" functions very well. Basically, it returns values based on zoom level and attributes' value For my special project, I needed a function that reads specific ...
user avatar
  • 942
1 vote
3 answers
49 views

How to prevent '+' operator from concatenating rather than summing [closed]

I am trying to sum two fields and am using the expression below. "Q1 answer" + "Q2 answer" This expression is concatenating the answer to '32' when the answer should be '5' (3 ...
user avatar
1 vote
0 answers
45 views

Dealing with white spaces in attribute names in ogr2ogr

I am trying to convert a sub-set of my geodatabase into a shapefile using ogr2ogr. The problem is that both the attribute name and the value have spaces, so when I use sql to subset it gives me syntax ...
user avatar
  • 405
0 votes
1 answer
38 views

Creating circle polygons for 'Protection Zones' that are specific to individual points measured by radius in metres using QGIS

I have found similar questions to this but nothing that will work for my particular circumstance. I have points as a vector layer, I want to display their measured protection zones that are individual ...
user avatar
5 votes
1 answer
263 views

VS Code Intellisense with modern arcpy syntax

Does anyone know to get VS Code's intellisense to work with modern arcpy syntax? This post addresses VS Code not recognizing the correct interpreter at all: VS Code autocomplete for ArcPy But that isn'...
user avatar
5 votes
2 answers
437 views

Syntax for using other fields in Advanced Python field calculator in QGIS

What is the syntax for the "Advanced Python field calculator" when using other fields as input in QGIS 3.2.20? (The example below is not the actual function. I have a complex if-else, ...
user avatar
  • 52.5k
1 vote
1 answer
25 views

Space Syntax Toolkit - What do the abbreviations (i.e. INThh) stand for?

I cannot seem to find any information on the used abbreviations in the Space Syntax Toolkit, such as these: Is there any documentation available on the used abbreviations?
user avatar
  • 361
1 vote
1 answer
24 views

How to treat unlinks for computation in the Space Syntax toolkit?

Since I cannot find documentation about unlinks for Space Syntax analysis, can unlinks (bridges/ tunnels) be treated just like regular portions of the urban grid? Meaning I can join them to be ...
user avatar
  • 361
6 votes
1 answer
366 views

Refering to the input-layer of a QGIS model in field calculator expression

The setting In a QGIS model, I have an input layer polygon from which a grid is created. On this grid-layer, a new attribute field should be created based on an expression that refers to the input ...
user avatar
  • 41.1k
2 votes
2 answers
225 views

log naturalis syntax in GEE?

I am using Google Earth Engine (JavaScript) to calculate brightness temperature by converting at-satellite radiance of Landsat 8. In literature the formula T = K2 / (ln((K1/L)+1) -273.15 (T: ...
user avatar
10 votes
3 answers
885 views

QGIS expression with overlay-fuction: filter-condition based on comparison of attributes from two layers

In QGIS 3.18, I have two point layers: layer_1 with attribute id_1 and layer_2 with id_2. I want to use the overlay_nearest function: overlay_nearest(layer[,expression][,filter][,limit=1][,...
user avatar
  • 41.1k
2 votes
1 answer
180 views

QGIS Field Calculator Syntax Error Problem

I never before worked with the field calculator and this problem is driving me nuts ... Interpretationserror: syntax error, unexpected NAME syntax error, unexpected ')', expecting $end My expression ...
user avatar
0 votes
1 answer
94 views

JoinFeature attribute_relationship syntax (arcpy)

I am building a Python Toolbox for ArcGIS using Python 3 with ArcPy. I have two tables that I need to relate based upon an attribute. The information on the documentation for the JoinFeatures() ...
user avatar
2 votes
0 answers
166 views

How to write syntax to sum values for unique IDs in Survey123 Summary Report?

How do I get a sum of values for a question for each uniquely named pump station in a Survey123 summary report? I've developed a workflow for my client to do Pump Station inspections using Survey123.  ...
user avatar
  • 787
2 votes
0 answers
73 views

QGIS Advanced Python Field Calculator Syntax

I am attempting to calculate the difference between two azimuths using the following code in the QGIS Advanced Python Field Calculator : def azimuthDifference(): Model_Azimuth = <Model_Azimuth&...
user avatar
  • 91
3 votes
1 answer
61 views

Performing "Joinattributebylocation" in PyGQIS

I'm new to QGIS and PyQGIS. My task is to draw points on a map and find which points are in a specific area. To accomplish this I have three shapefiles of which two contains similar data which are ...
user avatar
1 vote
1 answer
553 views

How to filter for distinct values and apply multiple filters in QGIS attribute table?

I am very new to QGIS. I am doing an assignment for class where we have to answer several questions about data obtained from Global Fishing Watch. One of the questions is how many vessels have a ...
user avatar
1 vote
1 answer
55 views

ArcPy syntax for nested Con statement

I am trying to convert a process usually used in ArcGIS Tools to arcpy in a Jupyter notebook. I have a very long Con statement that basically takes all the values of 10 rasters and adds them together....
user avatar
0 votes
0 answers
25 views

How to search OpenStreetMap for tags? [duplicate]

How can I have e.g. all highway speed cameras displayed on the map, i.e. what is the URL syntax to search OpenStreetMap for certain tags? And where is this information (tagged locations, POIs etc.) ...
user avatar
  • 1
0 votes
2 answers
75 views

Syntax for converting tuple into string with Merge in ArcPy

I have a tuple of unknown elements, which I want to convert into a string for using in the arpy command arcpy.Merge_management([Input1, Input2, ..., Inputx], "D:\\test.shp") In my example I ...
user avatar
0 votes
1 answer
334 views

GDAL raster calculator

I have a series of raster data (GeoTIFF) with 5 bands (B / G / R / rededge / NIR). I would like to calculate different indices by using the gdal raster calculator. I would like to use the batch ...
user avatar
  • 81
0 votes
1 answer
502 views

New GeoServer WFS error NoSuchAuthorityCodeException

What is causing this error? org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:4326," from authority "European Petroleum Survey Group" found for object of type "IdentifiedObject". ...
user avatar
3 votes
1 answer
1k views

ArcGIS Pro Calculate Field giving WARNING 002858: Certain rows set to NULL due to error while evaluating Python expression

I'm working with some county level data for the 2016 US Election. I'm trying to calculate a blank Text field "Winner" based on two numeric fields "votes_dem" and "votes_gop" where it will take the ...
user avatar
  • 33
3 votes
1 answer
116 views

Insert Cursor Having an Issue With Reading the Syntax of a List

In my code below, how do I get the Desired Output? # Get a list of all 'SITE_NFID' in the dashboard_site_summary table that don't have a match in the nfid_fqn_associations table ...
user avatar
  • 369
1 vote
1 answer
26 views

Cleaning SQL queries [closed]

I have a bit of SQL code that look similar to this: SELECT sum(case when latitude = '0' then 1 else 0 end) as count_zero, sum(case when latitude is NULL then 1 else 0 end) as count_null, sum((case ...
user avatar
3 votes
1 answer
491 views

Creating a table view using SQL? [closed]

I'm trying to create a table view using SQL to join a table and a feature class together. When I try to create the view, I get an error saying there is an incorrect syntax near the keyword 'CREATE'. I'...
user avatar
0 votes
1 answer
514 views

PostGIS-syntax: export query-result to QGIS / Shapefile

Using PostGIS: syntax-basics for function, I was able to solve a long-standing problem by creating a geometry, using a SQL-query with PostGIS. However, I want to use the created geometry in QGIS and ...
user avatar
  • 41.1k
3 votes
1 answer
127 views

Syntax-basics for using ST_ApproximateMedialAxis() function in PostGIS

I tried to solve a problem I had in QGIS (see Simplifying multiple lines to create central axis?). I just need to know how the correct syntax works to use the function ST_ApproximateMedialAxis(...
user avatar
  • 41.1k
1 vote
1 answer
143 views

Raster calculator - problems with syntax

I have a raster layer with values ranging from 0.00597303 to 0.102894 and I want to assign specific number representing a group to specific range of values: Group 4: x >= 0.1 Group 3: 0.01 <= x ...
user avatar
  • 165
4 votes
2 answers
155 views

Adjusting condition in field calculator in QGIS [duplicate]

I need to calculate a score based on an area field using these ranges: if >= 30000 (square meters) then 4 (score) if < 30000 AND >= 10000 then 3 if < 10000 AND >= 5000 then 1 if &...
user avatar
  • 73
1 vote
1 answer
527 views

Raster calculator issue in QGIS 3.8 and 3.8.1

I am trying to perform a simple raster calculation on an elevation layer to occlude certain values. I have used the following expression: ( ( "clipped_elev@1">500) AND ("clipped_elev@1"<1000))*"...
user avatar
  • 2,090
2 votes
1 answer
68 views

Query land use (Raster calculator)

I have a land use raster file and am trying to use the raster calculator to query the file for surface water. The saga formula (11 = surface water band): (a, 11) This does not work. Can anyone ...
user avatar
12 votes
3 answers
2k views

Difference between quotation marks ('single' vs "double") in QGIS

I am confused concerning the quotation marks syntax ('single' vs "double") in QGIS. I know something about the quotation marks and the way they are applied in Python scripting (i.e. comments,...
user avatar
  • 1
1 vote
1 answer
53 views

Syntax for if clause with an inline variable in modelbuilder

In the "Calculate Value" tool I am trying to slice the inline variable (%Name%) with another variable (A) that will be a result of the length of the %Name% variable. For example if %Name% = 11 then I ...
user avatar
  • 63
0 votes
1 answer
34 views

Calculate conditional in line feature using an expression

I'm trying to calculate a conditional in a line feature but I can't see were my sintax is wrong. Could you guys help me? def Reclass(TIPO_PAV): if TIPO_PAV=='TERRA': return !shape.length@...
user avatar
5 votes
2 answers
290 views

How do I convert a string into a column number in QGIS Expression Builder?

I want to highlight parts of a map based on the page number in an atlas. Ideally I'd use the expression builder in the layer style menu to set the Column to equal the atlas page number. My expression ...
user avatar
3 votes
1 answer
200 views

Select By attribute - top 100 values for each district

I am trying to determine the highest 100 values for each district in a shapefile. I have 27 unique districts and 62834 records, but not sure how to proceed. I could "split by attribute" based on the ...
user avatar
0 votes
1 answer
140 views

ArcGIS Pro Script Tool Syntax Error

I'm trying to learn how to create Script Tools in ArcGIS Pro, so I thought I would start small with a tutorial on https://www.e-education.psu.edu/geog485/node/120 The tutorial has you make a simple ...
user avatar
4 votes
2 answers
1k views

QGIS stopEditing function in python

I am trying to stop the edits using the python console of the QGIS and the code QgsTrackedVectorLayerTools.stopEditing(layer,False) where layer is the layer in the edit mode. I am receiving the ...
user avatar
  • 135
1 vote
1 answer
58 views

If Statement Satisfied but not Entering?

I have some code that seems to behave as expected and occasionally satisfies an if loop I've created but the code never seems to enter the loop. Even where the if statement is satisfied. The 'Warning'...
user avatar
0 votes
0 answers
123 views

Python script from Python Toolbox do not work and show no error

I have a Python ToolBox with two Custom Python Scripts. The first one works well, but when I try to run the second, there is no errors, but the operation do not run. import arcpy class Toolbox(...
user avatar
4 votes
3 answers
411 views

QGIS query/syntax for overlapping features

I have a dataset (buildings, polygons) that has some overlapping features. Some buildings are old and already demolished but are still in the dataset. I want to hide all these. These have properties ...
user avatar
1 vote
0 answers
140 views

Merge Symmetrical Difference and Intersection Line

I tried to merge these two types of lines I have from using the geometric tools "Intersection & Symmetrical difference". They end up being part of the same line and I want to join them together ...
user avatar
  • 892
2 votes
0 answers
140 views

Zoom to Postcode QGIS Plugin error: ""

When trying to use the ZoomToPostcode plugin in QGIS 2.16.2 Nødebo, after inputting a postcode to jump to I am prompted to download updated postcode files. Clicking Yes generates a "Unable to download ...
user avatar
2 votes
2 answers
9k views

PostGIS: Update table with st_geometryfromtext [duplicate]

I'm trying to update a column wkb_geometry in a table locations by creating a point from the eastings and northings cols from the same table. The database is PostGreSQL with PostGIS extension: UPDATE ...
user avatar
  • 459
3 votes
2 answers
313 views

ogr2ogr sql - how to call file from a variable set in a loop in windows batch

I have a command ogr2ogr -f sqlite -dsco SPATIALITE=YES " !outfile!.sqlite !infile1! -nln !outfile! -dialect sqlite -sql "SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.name, B.name ...
user avatar
  • 123
1 vote
0 answers
157 views

Calculation appropriate angular step depth in depthmapX

I am a new depthmapX user in which trying to calculate segment step depth from specific segment to store cumulative angles for each segment. Is there anyone who can provide advice to implement it? ...
user avatar
  • 305
2 votes
2 answers
2k views

Copying some entries from one column to another with QGIS field calculator? [closed]

I have some rows in the AttributeTable where I want to copy some entries from one column to another. I thought that the best way to do this was in the field calculator and use a CASE WHEN expression ...
user avatar
3 votes
2 answers
3k views

Checking if optional parameter/field has been used or not in ArcPy?

I have 6 arcpy.GetParameterAsText The first one is a feature class and the remaining 5 are fields (some being optional). I plan to use an if statement to check if any fields have been selected for ...
user avatar
  • 2,397