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

Way.Nodes only contains node IDs with no additional information #59

Open
bitBeater opened this issue Apr 25, 2024 · 0 comments
Open

Way.Nodes only contains node IDs with no additional information #59

bitBeater opened this issue Apr 25, 2024 · 0 comments

Comments

@bitBeater
Copy link

Description

When retrieving data for ways using the osmpbf package, the Way.Nodes array only contains node IDs, with all other fields such as Version, ChangesetID, Lat, and Lon being zero. This occurs despite expecting these fields to be populated with respective node data.

Steps to Reproduce

  1. Use the following code snippet to extract way and node information from w128897900.osh.pbf.gz:
package main

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/paulmach/osm"
	"github.com/paulmach/osm/osmpbf"
)

func main() {
	oshFile, _ := os.Open("path/to/w128897900.osh.pbf")
	pbfScanner := osmpbf.New(context.Background(), oshFile, 16)

	for pbfScanner.Scan() {
		osmItem := pbfScanner.Object()

		if osmItem.ObjectID().Ref() != 128897900 {
			continue
		}

		var way *osm.Way = osmItem.(*osm.Way)
		var timeStamp, _ = time.Parse(time.RFC3339, "2011-12-20T10:59:34Z")

		if way.Timestamp.Before(timeStamp) {
			continue
		}

		for _, node := range way.Nodes {
			fmt.Println(node.ID, node.Version, node.ChangesetID, node.Lat, node.Lon)
		}

		return
	}
}

Expected Behavior

Each node retrieved in the Way.Nodes slice should have complete information, including ID, Version, ChangesetID, Latitude, and Longitude.

Actual Behavior

The output only includes node IDs, with other fields showing zero values:

1423178779 0 0 0 0
1476261275 0 0 0 0
1466158512 0 0 0 0
1476261292 0 0 0 0
1423178791 0 0 0 0
1481172885 0 0 0 0
...

Environment

  • Library Version: v0.8.0
  • Go Version: 1.22.2
  • Operating System: Debian GNU/Linux 12 (bookworm) Kernel: 6.1.0-20-amd64, Architecture: x86-64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant