Questions tagged [syntax]

the structure of statements in a computer language.

Filter by
Sorted by
Tagged with
0
votes
1answer
15 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
0answers
22 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.  ...
1
vote
0answers
23 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
1answer
37 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
1answer
76 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 ...
2
votes
1answer
26 views

Using quotation marks in ModelBuilder of ArcMap

The syntax in the ModelBuilder of ArcMap varies when trying to use the 'Name' output. When do I use double quotes, single quotes, or no quotes?
1
vote
1answer
33 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
0answers
23 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
0answers
33 views

ArcGIS Online - Display TMS with inverted Y

In ArcGIS Online, I'm trying to display a Tile Layer (Add > Add Layer from Web > A Tile Layer) that has the Y (row) axis inverted. I tried placing a minus (-) but it didn't worked, the layer ...
0
votes
2answers
40 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 ...
0
votes
1answer
59 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
1answer
146 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". ...
2
votes
1answer
242 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
1answer
78 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
1answer
24 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 ...
2
votes
1answer
131 views

Creating a table view using SQL?

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
1answer
238 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 ...
1
vote
1answer
122 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
2answers
112 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
1answer
360 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
1answer
58 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 ...
9
votes
3answers
2k views

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

I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double"). I know something about the quotation marks and the way they are applied in Python ...
1
vote
1answer
42 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
1answer
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@...
4
votes
2answers
223 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
1answer
115 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
1answer
105 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
2answers
737 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
1answer
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'...
0
votes
0answers
102 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
3answers
306 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
0answers
126 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
0answers
127 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 ...
2
votes
2answers
7k 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 ...
3
votes
2answers
257 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 ...
1
vote
0answers
131 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? ...
2
votes
2answers
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 ...
3
votes
2answers
2k 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 ...
2
votes
1answer
2k views

Arcpy.Intersect_analysis problem

I am very new to Python, after using ArcGIS for a few years (Toolbox only). I thought I'd get stuck in and try and pick it up as I went along, but I've come to a stumbling block with ...
1
vote
2answers
384 views

SelectLayerByAttribute() got an unexpected keyword argument

I am trying to update a field with a new value as I updated a Domain for a web purpose. I am new to this. I want be able to choose the layer and then the field to update M=Municipal S=State C=...
0
votes
1answer
150 views

Error in Raster Calculator when copying syntax typed in text editor

I have a very long operation string using conditionals and simple operations. However, I get an error when copying the syntax to Raster Calculator, apparently the commands are not recognized when ...
-1
votes
1answer
58 views

python script sytax error [closed]

I keep getting this syntax error and don't know why. Brand new to python. # Opens a feature class from a geodatabase and prints the spatial reference   import arcpy   featureClass = "C:/Users/Travis ...
2
votes
1answer
120 views

QGIS Marker Expressions

I am working on writing basic expressions to control the Marker Properties. My previous question on the syntax for color was graciously answered , but I soon realized that I need to know the syntax ...
0
votes
1answer
784 views

Writing expression for field calculator in Python?

I have a script where I calculate a couple of variables, add a new field then need to do a field calculation that field. Once I get everything set up, it's the expression that I have a hard time ...
2
votes
1answer
10k views

How can I make buffer with ST_Buffer in PostGIS

I am trying to make a buffer(0) as a fix-geometry process in PostGIS 2.2.2. It like this: SELECT ST_Buffer(ST_GeomFromText('POINT(100 90)'),0,4); I am using sources from this man-page. It ...
1
vote
1answer
116 views

Assign row object as field name in ArcGIS

Is there a specific way to assign the object that for example row[0] returns in a SearchCursor to a new field name? I mean how to write it in add field syntax, this doesn't work: arcpy....
3
votes
1answer
570 views

SyntaxError with custom function using QgsFeatureRequest.setFilterExpression

def get_subsel(layer,filter): layers = iface.mapCanvas().layers() for lyr in layers: if lyr.name() == layer: request = QgsFeatureRequest().setFilterExpression(filter) ...
1
vote
3answers
528 views

Using if else syntax in field calculator with Python?

I want to calculate a field in the field calculator that are dependent on the values in 4 other columns. My columns are "A", "B", "C" and "D" Now I want to fill the column "X" with: if "A" and "B" ...
3
votes
0answers
110 views

VBScript Syntax Error in ArcGIS labeling? [closed]

I have been using a script on older ArcGIS to convert depths in engineering format to the Hydrographic format seen on charts. On trying to use it I get a syntax error in Line 14. No matter how I ...
2
votes
1answer
92 views

ArcGIS Field Editor if/else syntax with python

I am just starting with Python and ArcGIs so here is my question: I have the column "DB_Low" (Type "Long") and want to fill a new column by changing values. The new column will be a Float-Type field. ...