Skip to main content
Question

Compare attributes from two features

  • September 9, 2016
  • 3 replies
  • 131 views

keoe
Contributor
Forum|alt.badge.img+1

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

itay
Supporter
Forum|alt.badge.img+18
  • 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
Celebrity
  • 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.


keoe
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 9, 2016

Thank you @takashi! Your solution works fine.