Skip to content

Commit

Permalink
setUniqueField from aggregation to features in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Mar 1, 2024
1 parent 2f2a0a1 commit fe8ace4
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,10 @@ public void persistAggregation(NGSIArcgisAggregator aggregator) throws CygnusRun
+ " is new: " + isNewFeatureTable);
ArcgisFeatureTable featureTable = getPersistenceBackend(featureTableUrl);

// If it's a new one, sets uniqueField value
if (isNewFeatureTable) {
LOGGER.debug("[" + this.getName() + "] Created new backend for " + featureTableUrl
+ " with uniqueField: " + aggregation.getUniqueField());
featureTable.setUniqueField(aggregation.getUniqueField());
}
// Sets always uniqueField value
LOGGER.debug("[" + this.getName() + "] Backend for " + featureTableUrl
+ " with uniqueField: " + aggregation.getUniqueField());
featureTable.setUniqueField(aggregation.getUniqueField());

featureTable.addToBatch(aggregation.getFeature());
if (featureTable.hasError()){
Expand Down Expand Up @@ -514,6 +512,7 @@ public void aggregate(NGSIEvent event) throws CygnusRuntimeError {
String entityType = contextElement.getType();

// Set unique filed and it's value.
LOGGER.debug("[NGSIArcgisAggregator] aggregate - uniqueField ->" + entityType);
aggregation.setUniqueField(entityType);
feature.addAttribute(entityType, entityId);

Expand Down

0 comments on commit fe8ace4

Please sign in to comment.