Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setUniqueField from aggregation to features in all cases #2350

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[cygnus-common] Upgrade postgresql from 42.4.3 to 42.7.2
[cygnus-common] [arcgis] Fix: check feature attributes containsKey before get it (#2347)
[cygnus-ngsi] [arcgis-sink] Set always uniqueField from aggregator for all features (#2349)
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
Loading