Tags: gogama/flatgeobuf
Tags
Embed testdata as physical Go code to try to get example_test working Since using go:embed didn't work on pkg.go.dev, this is another attempt to get the examples to run on the docs website...
Embed testdata/flatgeobuf/*.fgb in example tests The purpose of this change is to see if it will enable the example tests to run on https://pkg.go.dev/github.com/gogama/flatgeobuf. Before this change, at least, they are failing with errors like the one shown below. If this change isn't successful, I will most likely revert it and perhaps resort to some other form of embedding, like directly putting the FGB bytes in a []byte within `example_test.go`. ``` panic: open testdata/flatgeobuf/empty.fgb: no such file or directory goroutine 1 [running]: main.openFile({0x4a7312?, 0x40b33e?}) /tmp/sandbox2858312298/prog.go:13 +0x3c main.main() /tmp/sandbox2858312298/prog.go:24 +0x3d ```
Remove overly restrictive validation on header feature count in write For FileWriter, there's no good reason for Header() to enforce an artificially restrictive feature count. Although you cannot *index* more than math.MaxInt features, you can *write* more than that many using the streaming approach with multiple calls to Data(). There's an analogous restriction in FileReader.Header() which could be relaxed in the following way: no validation in Header, but if you try to call Index() or IndexSearch(), it blows up; and if you try to call DataRem() with more than math.MaxInt features remaining, it blows up.