Solved

Spatial Join help


I have a parcel file I would like to spatial join to a zoning layer. The idea is to inherit the attribute of the zoning layer to all parcels that fall within a specific zone. I have been testing the SpatialRelator transformer buy I don't get any values in the newly created attributes. Any suggestions? Please be specific.

icon

Best answer by takashi 20 April 2017, 07:22

View original

10 replies

Userlevel 2
Badge +17

Hi @michaelmessing, if you send the parcels to the Requestor port and the zoning areas to the Supplier port of the SpatialRelator, the attributes from spatially related zoning areas would be stored in a list attribute added to the output parcel features by default. You can also check Merge Attributes option, so that the attributes from zoning areas would also be added to the output parcels.

See the Attribute Accumulation parameters group in the SpatialRelator parameters dialog.

Alternatively, the SpatialFilter could also be used, if the zoning areas weren't overlapping each other

Hi @michaelmessing, if you send the parcels to the Requestor port and the zoning areas to the Supplier port of the SpatialRelator, the attributes from spatially related zoning areas would be stored in a list attribute added to the output parcel features by default. You can also check Merge Attributes option, so that the attributes from zoning areas would also be added to the output parcels.

See the Attribute Accumulation parameters group in the SpatialRelator parameters dialog.

Alternatively, the SpatialFilter could also be used, if the zoning areas weren't overlapping each other

thanks for the suggestion @takashi

Please see the attached screen shots. The workspace shows my connections and the SpatialRelator parameters. The Inspector show the unexpected results. As you can see the attribute list is appended but there are no values. The selected parcel is clearly within the a zone (1 _related_canidates).

Userlevel 1
Badge +21

thanks for the suggestion @takashi

Please see the attached screen shots. The workspace shows my connections and the SpatialRelator parameters. The Inspector show the unexpected results. As you can see the attribute list is appended but there are no values. The selected parcel is clearly within the a zone (1 _related_canidates).

 

List attributes will not show in the table view. You will need to use a list exploder to see the attributes here.

 

 

You can see the list attributes on the right hand side

 

 

Note that if a parcel is in more zoning layer you will get two features after using the list exploder
@egomm

Any suggestions on how to identify and handle the multiple features after the list exploder?

thanks for the suggestion @takashi

Please see the attached screen shots. The workspace shows my connections and the SpatialRelator parameters. The Inspector show the unexpected results. As you can see the attribute list is appended but there are no values. The selected parcel is clearly within the a zone (1 _related_canidates).

@egomm

Any suggestions on how to identify and handle the multiple features after the list exploder?

Userlevel 1
Badge +21
@egomm

Any suggestions on how to identify and handle the multiple features after the list exploder?

If a parcel is within multiple zones which zone attributes do you want it to inherit?

 

 

If a parcel is within multiple zones which zone attributes do you want it to inherit?

 

 

@egomm

 

I see your point. I will have to do a bit of digging to figure that out. Thank you

 

Hi @michaelmessing, if you send the parcels to the Requestor port and the zoning areas to the Supplier port of the SpatialRelator, the attributes from spatially related zoning areas would be stored in a list attribute added to the output parcel features by default. You can also check Merge Attributes option, so that the attributes from zoning areas would also be added to the output parcels.

See the Attribute Accumulation parameters group in the SpatialRelator parameters dialog.

Alternatively, the SpatialFilter could also be used, if the zoning areas weren't overlapping each other

@takashi @egomm

 

I have been playing around with different test to perform parameters. To your point how does the SpatialRelator handle a parcel that intersects two different zones for example? Does it take the first or the one with the most overlap. I have been testing and Intersects seems to be too inclusive and within is too exclusive. I suppose ideally I would need to find which zone overlaps the majority of the parcel or a given percent of it. How would I go about doing this?

 

 

Userlevel 2
Badge +17
@takashi @egomm

 

I have been playing around with different test to perform parameters. To your point how does the SpatialRelator handle a parcel that intersects two different zones for example? Does it take the first or the one with the most overlap. I have been testing and Intersects seems to be too inclusive and within is too exclusive. I suppose ideally I would need to find which zone overlaps the majority of the parcel or a given percent of it. How would I go about doing this?

 

 

If a parcel intersects two different zones, the SpatialRelator (Tests to Perform: Intersects) saves the attributes from the two zones into the list attribute. The order in the list is arbitrary and you cannot determine which zone occupies the larger part in the parcel.

 

If the parcels aren't overlap each other and the zones also aren't overlap each other, I think the AreaOnAreaOverlayer in the following procedure would be a better solution.

 

  1. If the parcels don't have unique ID attribute, use the Counter to add sequential number as parcel ID.
  2. AreaCalculator (1): Calculate the area [1] for each parcel.
  3. AreaOnAreaOverlayer: Input the parcels and the zones together.
  4. Tester: Select overlapped area features (Test 1 < overlap count).
  5. AreaCalculator (2): Calculate the area [2] for each overlapped area.
  6. ExpressionEvaluator: Calculate the ratio of the area [2] in the area [1].
  7. Sorter: Sort the features in the ratio descending order.
  8. DuplicateFilter: Select first feature for each parcel ID (set parcel ID to the Key Attributes).
If a parcel intersects two different zones, the SpatialRelator (Tests to Perform: Intersects) saves the attributes from the two zones into the list attribute. The order in the list is arbitrary and you cannot determine which zone occupies the larger part in the parcel.

 

If the parcels aren't overlap each other and the zones also aren't overlap each other, I think the AreaOnAreaOverlayer in the following procedure would be a better solution.

 

  1. If the parcels don't have unique ID attribute, use the Counter to add sequential number as parcel ID.
  2. AreaCalculator (1): Calculate the area [1] for each parcel.
  3. AreaOnAreaOverlayer: Input the parcels and the zones together.
  4. Tester: Select overlapped area features (Test 1 < overlap count).
  5. AreaCalculator (2): Calculate the area [2] for each overlapped area.
  6. ExpressionEvaluator: Calculate the ratio of the area [2] in the area [1].
  7. Sorter: Sort the features in the ratio descending order.
  8. DuplicateFilter: Select first feature for each parcel ID (set parcel ID to the Key Attributes).
Great. Thank you @takashi

 

Reply