spatial join with "IF" operator

2587
9
07-24-2019 04:21 AM
RadomirBalazy
New Contributor

Hi All,

I would like to spatially join my points with polygons which are representing weather conditions. Each of the point has his own date (each point represents only one day). Polygons has their own date too. Unfortunately polygons are multiparts and what is worse, each day covers whole area of interests. To spatially join each point with a proper weather layer I would need to have a condition: join (update) the point with an information from layer (polygon) if the layer represents weather conditions in the same day.

Thank you in advance for any comments !

0 Kudos
9 Replies
LanceCole
MVP Regular Contributor

Radomir‌,

Have you tried to use the Join Features tool in Pro.  This tool allows for spatial relationships as well as join conditions defined using an arcade expression or attribute relationships that defines the criteria used to spatially join features.

You can use an Arcade expression to create a Join Condition. Only features that meet the join condition will be used in the analysis. See Join Features expressions for more information.
0 Kudos
RadomirBalazy
New Contributor

Thank you ! I will try

0 Kudos
RadomirBalazy
New Contributor

Unfortunately this tool requires ArcGIS GeoAnalytics Server and I'm looking for solution available for Arc PRO

0 Kudos
LanceCole
MVP Regular Contributor

Radomir,

This should still run in Pro without a GeoAnalytics Server. I just ran a test on a sample set of data and it worked well.  I do not have a GeoAnalytics server and I am running on ArcGIS Pro 2.4.1 Advanced.  What level of license are you running for Pro?  The conditional statement is added in the Advanced Options such as $join["date"] == $target["date"].  $join is the Join Layer and $target is the Target Layer and is built using Arcade expression language.

RadomirBalazy
New Contributor

Thank you Lance !

Indeed, I have version 2.3. I will update PRO and I'll try to solve it once again.

0 Kudos
RadomirBalazy
New Contributor

Lance I've updated my ArcPro version to the newest one and it works... almost. I've tried to do it in a many different ways and error always appear that
ERROR 120136: Error in expression for 'joinCondition': Undefined reference to variable '$layertitle'.

Do you have any idea ?

0 Kudos
LanceCole
MVP Regular Contributor

Radomir,‌,

The variables used in the Join Condition should start with either $join for values from the join feature or $target for the target feature.  Try using $join["layertitle"] or $target["layertitle"] in the join condition adjusting as needed to match your schema.  The part in quotes needs to match a fieldname in your corresponding feature.

0 Kudos
RadomirBalazy
New Contributor

Thanks Lance once again ! It works now however another problem appeared. I'm not sure what does it mean but it's maybe because of amount of data although I'm working at the new graphical station 😕

Start Time: 22 August 2019 12:24:07
Running script Join Features...
Started Spark Job 1 with 2 tasks.
Spark Job 1 completed in 1915.3 seconds.
 ERROR 001409: Failed to write to the output location.
Completed script Join Features...
 Failed to execute (JoinFeatures).
Failed at 22 August 2019 12:56:16 (Elapsed Time: 32 minutes 8 seconds)

0 Kudos
LanceCole
MVP Regular Contributor

Radomir Balazy

Check how much free space you have on your system drive and the drive you are using for memory page files.  Also how much memory do you have in the system.  You can also try running this on a small selection of features rather than the entire feature classes.

0 Kudos