Skip to content

Commit

Permalink
insert null attribute as is in feature table
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Jun 5, 2024
1 parent c85f1d5 commit c12076f
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,16 +631,15 @@ protected void jsonElementToFeatureAttr(String attrName, String attrType, JsonEl
// Try to insert as Double
feature.addAttribute(attrName, Double.parseDouble(attrValue.toString()));
} catch (NumberFormatException e3) {
// If all fails, insert as is
LOGGER.warn(
"[NGSIArcgisAggregator] Unquoted String attribute: " + attrName + ":" + attrValue);
try {
feature.addAttribute(attrName, attrValue);

} catch (Exception e) {
// If all fails, insert as String
// If all fails, insert as String
if (attrValue != null) {
String strValue = URLDecoder.decode(attrValue.toString());
feature.addAttribute(attrName, strValue);
} else {
// Insert null as is
feature.addAttribute(attrName, attrValue);
}

}
Expand Down

0 comments on commit c12076f

Please sign in to comment.