[OSM-dev] Osmosis Output Error

Karl Newman siliconfiend at gmail.com
Wed Dec 10 04:46:16 GMT 2008


On Tue, Dec 9, 2008 at 4:56 PM, Brett Henderson <brett at bretth.com> wrote:

> Karl Newman wrote:
>
>> The SRTM data has no timestamps, which is causing the problem. So you only
>> need to set enableDateParsing=false for that file. It might be good to show
>> a warning if an entity has no timestamp attribute in the XML. I propose
>> adding the following lines in BaseElementProcessor.java:
>>
>> +    private static final Logger log =
>> Logger.getLogger(BaseElementProcessor.class.getName());
>>
>> ...
>>
>>    protected TimestampContainer createTimestampContainer(String data) {
>>        if (enableDateParsing) {
>> +            if (data == null || data == "") {
>> +                log.warning("Element missing timestamp attribute.");
>> +            }
>>            return new UnparsedTimestampContainer(timestampFormat, data);
>>        } else {
>>            return dummyTimestampContainer;
>>        }
>>    }
>>
> Cool, I agree that this is the place to do it.  It avoids subsequently fail
> 3 tasks down the pipeline because input data was dodgy.
>
> I'd rather not just log a warning though because nobody reads them and it's
> going to fail anyway.  I'd prefer to just make it abort at that point.


The reason I went with a warning instead of an exception is that I thought
there were some possible downstream tasks that didn't need the timestamps.
But that's an oddball file that doesn't have timestamps, anyway, so maybe an
exception is the right way to go.

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20081209/0de560c0/attachment.html>


More information about the dev mailing list