Skip to main content
Question

Compare attributes from two features

  • September 9, 2016
  • 3 replies
  • 105 views

Forum|alt.badge.img

I want to compare the attributes from two features in same shape-file. If the timestamp attribute does not differ more than one minute from the timestamp attribute from the previous Point, I want to create a line between the points with PointConnector. Does anyone have any idea how to make this comparision?

3 replies

itay
Supporter
Forum|alt.badge.img+16
  • Supporter
  • September 9, 2016

you can test the dates and see if the fall within a minute range.

You could also calculate the dates difference date calculator is the store transformer to use I believe and test the difference

Tip if you are using the dates for the test format them first using the dareformatter with the 's' setting


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 9, 2016

Hi @keoe, expanding Itay's idea regarding %s format, I would add line ID attribute that can be used to group the points by the AttributeCreator with combination of the Advanced options and Conditional Value setting.

  1. DateFormatter: Format the timestamp value with %s format (count of seconds elapsed from the epoch).
  2. AttributeExposer: Expose the line ID attribute name (e.g. "_line_id"). It has no value yet.
  3. AttributeCreator: Assign actual value to "_line_id" as the screenshot illustrates.
  4. PointConnector: Set "_line_id" to the "Connection Break Attributes" parameter.

[Addition] The intention of this setting is: If the number of seconds elapsed from the timestamp of the previous point is greater than 60, assign "ID of previous point + 1". Otherwise assign the same ID as previous point.


Forum|alt.badge.img
  • Author
  • September 9, 2016

Thank you @takashi! Your solution works fine.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings