New answers tagged

4

For a File Geodatabases you could use - SUBSTRING(REGION FROM 1 FOR 3) = SUBSTRING(REG FROM 1 FOR 3) For a Shapefile use: SUBSTRING(REGION, 1, 3) = SUBSTRING(REG, 1, 3) I got the shapefile syntax from this Technical Article - HowTo: Compare a field with a substring in another field


4

You can use the regexp_match function to match the first number inside your CASE statements: CASE WHEN regexp_match("nombre", '^[0-3].*') THEN 'ROSETAS' WHEN regexp_match("nombre", '^[4-5].*') THEN 'CTO' ELSE 'OTRAS' END


0

Make sure you use the right type of single quotes: '' If you use `` the parser will freak out.


5

Just figured it out. In the layer properties, go to the "Labels" tab, and set the Method to "Define classes of features and label each class differently". I set two different classes ("Default" and "2"), each with a different style and scale range. the label now changes its style according to scale range.


0

You're looking for the symmetrical difference tool. In my experience it works very similarly to st_disjoint, only it does it in a "masking" style so the underlying shape can be cut out just so. I struggled with this tool for a while, getting empty outputs, before I discovered a workable solution. Both of my layers were in geographic (EPSG:4326) format ...


0

I don't know why this actually works now, maybe someone could explain it, but after many tries I succeded by using the following code: SELECT AddGeometryColumn ('vehicle_2015_02','projected_point',4326,'POINT',2, false); UPDATE vehicle_2015_02 v02 SET projected_point = ST_LineInterpolatePoint(romo2015_way.st_makeline, ...


0

You may need to rewrite your UPDATE statement, using an explicit join. UPDATE vehicle_2015_02 v02 SET projected_point = q.newpoint FROM ( SELECT vehicle_2015_02.objectid, ST_LineInterpolatePoint( romo2015_way.st_makeline, ST_LineLocatePoint( romo2015_way.st_makeline, ...


3

you can also use strpos( "myField", 'awesome') > 0 and for case insensitive searches strpos( lower("myField"), 'awesome') > 0 this is slightly more error-prone as you need to put double quotes around field names and single quotes around string values. I always fall into that trap. I noticed that a recent version of QGIS (2.12?) has quietly ...


4

You can easily achieve that with select by expression dialogue. "my_field" LIKE '%specific_words%' See this example


1

There are two views that you need to check geometry_columns and geography_columns that will provide you with a list like: "ian";"public";"coastline";"geom";2;27700;"MULTILINESTRING" "ian";"public";"motorway";"geom";2;27700;"MULTILINESTRING"


1

I am posting this just so you can mark this format as the answer. The IN syntax is the most compact way to write the expression you want: [OU] IN ('001', '002') AND [Formation] = 'Residuum'


1

Yes it's possible to do this in python. Check out the documentation on the Make Query Layer tool http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-query-layer.htm You can also use the make query table tool (http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-query-table.htm); if you specify a shape field the query table ...


2

Similar to what Zoltan has said, but you want to group by the color, which will then get you the sums for each color. SELECT sum(ST_Area(ST_Intersection(grid.geom, affected.geom))), grid.color FROM grid, affected WHERE ST_Intersects(grid.geom, affected.geom) GROUP BY grid.color; The final WHERE ST_Intersects(...) will not affect the answer, ...


2

SELECT sum(st_area(st_intersection(grid.geom, affected.geom))) FROM grid, affected WHERE grid.color = 'green' and st_instersects(grid.geom, affected.geom);


1

The only change you should need to make to your original Flex where clause is to escape the single quotes around the value using the slash character: expression: 'upper(ICAOcode) LIKE upper(\'%[value]%\')',


1

If you select "table_1" for the Update existing field option, try using this expression: if( "table_2" = 'test', 'y', "table_1") Basically, you're using an IF THEN ELSE statement.


2

Perhaps an expression like this would work better: [OU] = '001' AND [Formation] = 'Residuum' OR [OU] = '002' AND [Formation] = 'Residuum' It's a little tedious in its formatting, but should return the results that you're after. A little more elegant expression would be: ([OU] = '001' OR [OU] = '002') AND [Formation] = 'Residuum' Either one should ...



Top 50 recent answers are included