Skip to content

PBF StreamSource to FeatureSource - 'Attribute id already exists!' when creating Feature list #146

@digi-chris

Description

@digi-chris

Hi all, hoping someone can help with this. I have some basic code that loads a PBF file as a PBFOsmStreamSource, uses a FilterBox to reduce the size of the search area and then converts this to a FeatureSource:

FileStream fs = File.OpenRead(filename);
var source = new PBFOsmStreamSource(fs);
var s = source.FilterBox(x1, y2, x2, y1);
filtered = from osmGeo in s
                where osmGeo.Type == OsmSharp.OsmGeoType.Node ||
                osmGeo.Type == OsmSharp.OsmGeoType.Way
                select osmGeo;

features = filtered.ToFeatureSource();
var featureList = features.ToList();

On small areas (say, about 1km), this code works fine.. but as soon as I make the FilterBox area fairly large, the last line of this code causes an exception, stating:

'Attribute id already exists!'

Any idea why this is happening? Is there some way I can filter out duplicate attribute ids?

Thanks!

Chris.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions