6

First, you should be aware that an equidistant projection will not preserve the area of polygons (it preserves the distances along a set of straight lines). therefore you should use a projection of the "equal area" family (which does represent polygon with their undistorted area over their domain of application). Examples of such projections are sinusoidal (...


5

Use arcpy and check each row of the table using da.SearchCursor and list ObjectIDs of the rows matching your condition. Then select using the list. Adjust and execute in python window: import arcpy layer = 'somelayeraddedtothemap' #Change field_to_check = 'somefield' #Change oidfield = arcpy.Describe(layer).OIDFieldName #What is the oid fieldname #List ...


5

The parameter "Correction_Comments" from your function is not used at all within the function. Instead, there is a variable "MSAGSTREETNAME", a local variable that is not referenced elsewhere. In addition, the if statement is using an assignment (=) rather than a test (==). Modifications: def Reclass(streetnamefield): if streetnamefield == 'HEMLOCK': ...


3

You can achieve the result that you are striving for with GRASS toolset v.clean for cleaning topology of a vector element. Probably, you will need to deploy rmdangle option. rmdangle: remove dangles, threshold ignored if < 0 Check the following references for more details: Removing 'tails' from line features? Deleting lines in QGIS Automated removal ...


2

You need to create a custom function for this purpose. In the Field Calculator, go to Function Editor and create a new function name it TextCount, as you can see below, and copy and paste the following code: from qgis.core import * from qgis.gui import * @qgsfunction(args='auto', group='Custom') def textCount(text_field, feature, parent): split_text = ...


2

I agree with radouxju. Because the projection you have chosen is meant to preserve distance and not area, you're getting dramatic exaggeration of areas the further out you go from the center point. Choosing an equal area CRS and being sure it's defined before you calculate the area should fix it. If you prefer an azimuthal projection, you can use NAD 83 ...


1

Check the syntax for the arcpy.CalculateField() function: CalculateField_management(in_table, field, expression, {expression_type}, {code_block}) In the expression parameter you have to pass a string referencing a field. However, the way you reference another field will depend on the expression_type. In your code you are specifying VB. In the tool's ...


1

Assuming all the times are from the same day, you can calculate the delta between the start time and the end time using the following Python function: import datetime def delta(start, end): start_dt = datetime.datetime.strptime(start, '%H%M') end_dt = datetime.datetime.strptime(end, '%H%M') return (end_dt - start_dt).seconds / 60 This function ...


1

As @ThingumaBob suggested, virtual fields do not have to be relied upon for assessing a table context. For example in your case is no assurance that the order will remain the same after an update. As a possible workaround, however, you could resort to use the $id function in a virtual field:


1

Tested on QGIS 2.18 and QGIS 3.4 Additionally, I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... Let's assume we have the following layer "line" with its Attribute table, see image below. With the following query, it is possible to clean up the line out of "tails"/"dangles". SELECT l1.* FROM line AS l1, ...


1

To get accurate area calculations, use a local CRS. Since you're making these calculations for the entire world, you'll need to use many hundreds of different local CRS's. The most efficient way would be to add a "local_CRS" field, and enter the EPSG code of the best local CRS available for each area. Eg, for the USA, each state is covered by between one ...


1

Use split to split into list, default split character is whitespaces: a = "Can I somehow count strings? I would like to know how many words (strings) I have in every cell. So I know that somewere is too many words. Len function calculates individual string character (also spaces ). Tanks!" a.split() ['Can', 'I', 'somehow', 'count', 'strings?', 'I', 'would',...


Only top voted, non community-wiki answers of a minimum length are eligible