Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Allow double values for count fields #47

Open
johnjohndoe opened this issue Jul 28, 2015 · 0 comments
Open

Allow double values for count fields #47

johnjohndoe opened this issue Jul 28, 2015 · 0 comments

Comments

@johnjohndoe
Copy link

The importer allows to import Measured values of type Count as shown in the screenshot.

count

The values for this column are processed here:

// COUNT
else if (m.getValue().equals("COUNT")) {
    return Integer.parseInt(value);
}

Integer values are expected here.

Error case

If the values is provided as a double value such as 23.0 the following error occurs:

[org.n52.sos.importer.feeder.task.OneTimeFeeder] ERROR SensorObservationService - 
    Could not retrieve all information required for insert observation because of 
    parsing error: java.lang.NumberFormatException: For input string: "23.0". 
    Skipped this one.
[org.n52.sos.importer.feeder.task.OneTimeFeeder] DEBUG SensorObservationService - Exception stack trace:
java.lang.NumberFormatException: For input string: "23.0"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.7.0_79]
    at java.lang.Integer.parseInt(Integer.java:492) ~[na:1.7.0_79]
    at java.lang.Integer.parseInt(Integer.java:527) ~[na:1.7.0_79]
    at org.n52.sos.importer.feeder.DataFile.getValue(DataFile.java:372) ~[52n-sos-importer-feeder-bin.jar:0.5.0-SNAPSHOT]
    at org.n52.sos.importer.feeder.SensorObservationService.getInsertObservationForColumnIdFromValues(SensorObservationService.java:590) [52n-sos-importer-feeder-bin.jar:0.5.0-SNAPSHOT]
    at org.n52.sos.importer.feeder.SensorObservationService.getInsertObservations(SensorObservationService.java:566) [52n-sos-importer-feeder-bin.jar:0.5.0-SNAPSHOT]
    at org.n52.sos.importer.feeder.SensorObservationService.importData(SensorObservationService.java:343) [52n-sos-importer-feeder-bin.jar:0.5.0-SNAPSHOT]
    at org.n52.sos.importer.feeder.task.OneTimeFeeder.run(OneTimeFeeder.java:203) [52n-sos-importer-feeder-bin.jar:0.5.0-SNAPSHOT]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]

Feature request

Please consider processing double values such as 23.0 as 23 or 0.0 as 0 instead of skipping the value.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant