ThomasHaarlem
ThomasHaarlem

Reputation: 15

spatial-join date-attribute from points to polygon

I have a polygon map with inside each polygon multiple points. I would like to spatial-join the date-attribute from the point-layer (join-features) with the date closest to today, to the polygon (Target Features). Join operation: Join one to one. i.e. join one datum from points (the one closest to today) to one polygon.

In the merge-rule I can only choose from: First, Last, Minimum, Maximum, Mean, Median en Mode.

None of these fits my need. Do I miss someting obvious?

First and Last seems to take a date from one of the points inside that polygon. But not always the date I need. Minimum and Maximum seems to take the miminum/maximum date from the whole Points-population. Not only from the points intersecting the particular polygon.

In the properties-field I see clearly that the attribute-type is Date.

I have both Arcgis and Qgis.

Upvotes: 0

Views: 341

Answers (1)

Anna Forrest
Anna Forrest

Reputation: 1741

In ArcGIS... This probably needs to be done in a couple steps. I would try:

  1. Do a 1-M spatial join.
  2. Calculate a new field (days from today) on all the records from 1
  3. Where you have multiple matches, determine the minimum days (using the summary statistics tool)
  4. Join the result of 3 with the result of 1
  5. Delete records from 4 where the days from today is greater than the minimum days

You might need to grab an arbitrary OID for the minimum days record if you have multiple points that are the same number of days from today.

Upvotes: 0

Related Questions