Using the formula field: Custom Shape Layer

Using the Shape Layer and Formula Field

Step 1: Open the Shape Layer

  1. Launch JMARS and navigate to the "Layers" panel.
  2. Click the three dots icon under the "Layers" section.
  3. Select "Custom Shape Layer" from the dropdown menu.

Step 2: Add Shapes to the Layer

  1. To add shapes, either create new shapes or import an existing shape dataset.
  2. For this tutorial, we'll add the USGS Mars Dune Database:
    1. Double-click the Custom Shape Layer in the Layer Manager to open it.
    2. Go to the "File" menu and select "Load USGS Mars Dune Database."
    3. The shapes should now load and appear in the Custom Shape Layer Options.

Step 3: Edit Columns

  1. In the Custom Shape Layer window, find the "Feature" dropdown list.
  2. Select "Edit Columns" from the list to open the Edit Columns window.

Step 4: Create a New Column

  1. In the Edit Columns window, you'll create a new column that will hold the results of a formula calculation.
  2. Set a "Name" for the column, such as "Tutorial Test".
  3. Choose the column "Type". Since we will be using a formula that produces a real number, select "Real Number".
  4. Click "Add Column" to add the new column to your dataset.
Note: It's important to match the column type with the expected output of your formula. For instance, if the formula result is an integer and you're using an integer column for the calculation, your new column should also be an integer.

Step 5: Set the Formula Field

  1. With your new column added, set the "Value" by selecting "Formula Field".
  2. When prompted, choose the "Real Number" expression type to match the column type.

Step 6: Create the Formula

  1. Notice the icons next to various sections of the Formula Editor:
    1. The Insert Columns area allows quick access to your dataset's columns. Click the question mark icon for tips on using this feature.
    2. Start typing "Dune_Lat" in the search bar. When it appears, double-click or press Enter to add it to your formula field.
  2. In the formula area, you can use various features to help build your formula:
    1. Click the question mark next to "Available Features" for help with the formula editor.
    2. View keyboard shortcuts by clicking the "Keyboard Shortcuts" option.
    3. For overall help on the Formula Editor, click the question mark icon next to "Formula Help".

Step 7: Enter the Formula

  1. After adding "Dune_Lat" to your formula, you’ll see a result preview at the bottom showing an example value from the Dune_Lat column.
  2. To modify this, type + 8 next to Dune_Lat so the formula reads :Dune_Lat: + 8.
  3. Observe the result preview updating accordingly.

Step 8: Apply the Formula

  1. Check the "Update all Rows" checkbox in the bottom left corner to apply the formula to all rows.
  2. Click the "Update Feature" button in the bottom right corner.
  3. Your new column, "Tutorial Test," will now display the calculated values.
  4. You have successfully used the JMARS formula field to modify a column in the shape layer!