Geometry By Expression

0 views
Skip to first unread message

Olivie Inoue

unread,
Aug 5, 2024, 12:22:05 PM8/5/24
to corgamblinpi
HiIn ArcGIS Online using the web map Attribute Expressions builder, I'm trying to pull feature xy coordinates to show in a popup. In the builder, my code successfully tests with a value; but the value in the popup and layer table is empty. I'm using a map service if that matters.

I think the problem is with the map service I started with. I haven't figure out why, yet, but it appears that the "point" feature-type layer loaded via the map service is really a "multipoint" layer/feature class. For some reason the point-related arcade expression code works with the layer in the expression builder, but perhaps not outside of the builder. I'm looking more closely at our map service and the map viewer.


In case you need the coordinates in WGS 1984, I have a couple of posts that show an example of how you can convert Web Mercator coords to WGS 1984. This might be useful in case you need to create a hyperlink to Streetview or Waze or send the coordinates to prefill a Survey123 form.




Geometry Expressions is the world's first interactive symbolic geometry system that presents the algebraic and diagrammatic representations of a model by easy constraint-based sketching. Define geometric figures with either symbolic constraints or numeric locations. Measurements on the drawing are presented numerically or symbolically as mathematical expressions. The explicit mathematics generated by Geometry Expressions can be sent to Mathematica for analysis, then copied and inserted back into the Gx model. Models can be turned into JavaScript/HTML browser apps or dashboard widgets without needing to write the script. Where Mathematica can be used to automate the analysis of mathematical expressions, Geometry Expressions automates the creation of symbolic expressions in the geometry arena.


Saltire Software was founded in 1989 as a spin-off from TektronixComputer Research Lab. Its award-winning Analytix product linefeatures constraint-based mechanism design, synthesis, andanalysis. Saltire has since developed mathematical software forleading calculator companies, and a category-leading optimizationpackage for the floor-covering industry.


I want to use Geometry by expression in a model I'm working on but I couldn't figure out how to pass the layer name parameter. Basically I have two polygon layers (A and B) and I want to do a feature-by-feature difference using a shared attribute. The expression I have below works outside the modeller.


Intermediate output layers are usually called something like 'Toolname of layername'. Eg, the output of running the clip tool on a layer called 'vectorlayer', is probably called something like 'Clip of vectorlayer'. You can find the exact name of an intermediate output by adding any algorithm that would let you choose the intermediate output as input from a dropdown menu. Make a note of what the intermediate outputs are called, and use that name in your difference() expression.


I wonder if the issue could be as simple as that the it's expecting a string for 'LayerB', but the string 'Difference' from algorithm 'Building_frontbuffer' because has single quotes inside it. So if you used ''Difference' from algorithm 'Building_frontbuffer'' for 'LayerB', I believe it would be interpreted as three separate strings, with gibberish in between.


According to this Q&A, Is there an escape option for single quotes & apostrophes in QGIS?, you can just put single quotes around a string with single quotes in it. I wouldn't have thought that would work, but it's worth trying:


As a workaround, make the 'difference' output a permanent layer. Define the layer name and filepath with a string input. This way you know exactly what the layer is called, so you can use the correct layer name in the expression.


If none of the above suggestions works, and you can't find a solution, you just have to end the model at this point. Make the final output of your model a permanent layer from 'Difference' from algorithm 'Building_frontbuffer'. Put the rest of your steps from the original model into a new model.


The algorithm id is displayed when you hover over the algorithm inthe Processing Toolbox.The parameter dictionary provides the parameter NAMEs and values.See Using processing algorithms from the console for details on how to run processing algorithmsfrom the Python console.


Applies an affine transformation to the layer geometries.Affine transformations can include translation, scaling and rotation.The operations are performed in the following order: scale, rotation, and translation.


Buffer distance (from the boundary of each feature).You can use the Data Defined button on the right to choosea field from which the radius will be calculated.This way you can have different radius for each feature(see Variable distance buffer).


All output geometries will be converted to multi geometries, eventhose with just a single part.This algorithm does not dissolve overlapping geometries - they willbe collected together without modifying the shape of each geometrypart.


Segments are considered as suitable for replacing with an arcif the points are all regularly spaced on the candidate arc.This parameter specifies the maximum angular deviation (in degrees)allowed when testing for regular point spacing. Between 0 and 45.


Creates a new vector layer that contains a single feature withgeometry matching a point parameter.It can be used in models to convert a point into a point layer foralgorithms which require a layer based input.

3a8082e126
Reply all
Reply to author
Forward
0 new messages