Questions tagged [syntax]
the structure of statements in a computer language.
103
questions
0
votes
1
answer
250
views
Formating a WKT CRS string in a way that R can read it
I have selected a custom CRS using the website https://projectionwizard.org/. I chose this custom CRS because I needed a map of the Neotropics (+ or - from the south of the US to the north of ...
0
votes
0
answers
50
views
Space Syntax QGIS graph analysis not reading layers
I am trying to use the plugin for QGIS but unfortunately, the plug-in does not read the layers I am uploading (line layers). The drop-down menu "layer" does not open any. What is the problem?...
1
vote
0
answers
181
views
PDAL +init use deprecated but what is the alternative
With PDAL I was trying to using a proj4 string like +init=epsg:32615 +geoidgrids=C:\vdatum_GEOID12A\vdatum\core\geoid12a\g2012au7.gtx based on an example given on the PDAL website https://pdal.io/en/...
0
votes
0
answers
100
views
Multiple methods syntax
I am new in Python and learning to use it for spatial processing. I bought the book "Learning Spatial Analysis with Python". In the book, I often see syntaxes with multiple methods (a=module....
3
votes
1
answer
116
views
hstore_to_map command syntax
I am struggling with the correct hstore_to_map syntax. I extracted power plants from OSM. In the "other tags" field are coal, hydro, solar stated as sources. How do I get/display just the ...
1
vote
1
answer
49
views
Why is help(activeLayer()) not working?
Why are neither of the commands below returning details on the active layer method?
It works when I use the class iface.
help(activeLayer)
help(activeLayer())
This is the error I get
Traceback (...
5
votes
2
answers
753
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 ...
1
vote
3
answers
61
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 ...
1
vote
0
answers
171
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 ...
0
votes
1
answer
45
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 ...
6
votes
1
answer
487
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'...
5
votes
2
answers
957
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, ...
1
vote
1
answer
60
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?
1
vote
1
answer
41
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 ...
7
votes
1
answer
1k
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 ...
3
votes
2
answers
719
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: ...
12
votes
3
answers
2k
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][,...
2
votes
1
answer
524
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 ...
1
vote
2
answers
186
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() ...
2
votes
0
answers
307
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. ...
2
votes
0
answers
110
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&...
3
votes
1
answer
99
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 ...
1
vote
1
answer
1k
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 ...
1
vote
1
answer
100
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....
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.) ...
0
votes
2
answers
116
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 ...
1
vote
1
answer
872
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 ...
0
votes
1
answer
903
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".
...
3
votes
1
answer
2k
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 ...
3
votes
1
answer
144
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
...
1
vote
1
answer
32
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 ...
3
votes
1
answer
662
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'...
0
votes
1
answer
808
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 ...
3
votes
1
answer
197
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(...
1
vote
1
answer
190
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 ...
4
votes
2
answers
224
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 &...
1
vote
1
answer
624
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))*"...
2
votes
1
answer
82
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 ...
13
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,...
1
vote
1
answer
62
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 ...
0
votes
1
answer
36
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@...
5
votes
2
answers
363
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 ...
3
votes
1
answer
339
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 ...
0
votes
1
answer
180
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 ...
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 ...
1
vote
1
answer
60
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'...
0
votes
0
answers
148
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(...
4
votes
3
answers
503
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 ...
1
vote
0
answers
150
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 ...
2
votes
0
answers
157
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 ...