SUMMARY
Today Robert M. and I created a Special Autoupdater that is designed to migrate the attributes of a "spatially related" feature class to the feature being created or updated. This was in support of the upcoming SW Gas benchmark. For example, lets say that I created a Drip Feature that intersects a Parcel feature and I want to migrate the value of the parcels "StreetName" field to the Drip's "StreetName" field. This configurable autoupdater does just that. It works on points,lines, and polygon feature classes and should be able to handle migration between string and numeric data types.
The configuration file (Telvent.SE.SpatialRelationshipAU.XML) looks like this:
<Config>
<MAP targetFeatureClass="Drip" spatialRel="Intersect" sourceFeatureClass="Parcel" sourceField="StreetName" targetField="StreetName" />
<MAP targetFeatureClass="Drip" spatialRel="Within" sourceFeatureClass="StreetEdge" sourceField="Roads_ID" targetField="RoadID" />
<MAP targetFeatureClass="StreetEdge" spatialRel="Cross" sourceFeatureClass="Parcel" sourceField="streetname" targetField="roads_id" />
</Config>
If you look at the last MAP in the config file (in blue), what is being said is that when the Autoupdater fires for a StreetEdge (on-create or on-update probably) look for the first parcel that it crosses and take it's streetname field and migrate it to the roads_id attribute of the street edge feature class.
Valid spatialRel values are (case sensitive): Intersect, Touch, Within, Contain, Cross, and Overlap.
Note that some behaviors may not be exactly what you expect...for example, a point that is snapped to a line does NOT touch the line...it is, however, within the line.
CONFIGURATION
To get this AU running, you'll need to RegEx the Telvent.SE.SpatialRelationshipAU.dll, edit the sample configuration file, and appropriately assign the AU to the feature class(es) that you want it to work on. The name of the AU that you will see in ArcCatalog is: "Telvent.SE Inherit Spatial Relationship Attributes". It will appear only for Feature Classes - not object classes.
ASSUMPTIONS
- The target feature class name in the configuration file is the class to which the autoupdater is assigned. This is the actual database name (not a model name)
- The source feature class name is the feature class is to be searched. IT MUST EXIST IN YOUR MAP.
- The target fields and the source fields are numeric or string data types. The two do not have to match, however if you are mapping a string field to a numeric field, the AU would of course only work if you had a string like "31". A value like "Pine" can't be coerced into a number.
- The value from the first spatially related feature found are used. If no related feature is found, then nothing should occur (the feature is created, and the value for the target field will be null).
KNOWN ISSUES
- We did run across some errors during testing when .Store() was called, but it seems very likely that this was an error raised by some external component. The errors are caught by the AU and it seems to work. At this point, it is just something to keep an eye on.
No comments:
Post a Comment