ArchGDAL.jl
ArchGDAL.jl copied to clipboard
createfeature on feature definition doesn't write out any data?
I was following the test/test_gdal_tutorials.jl script, the tutorial lead to shapefiles without any data.
AG.create("$pointshapefile.shp", "ESRI Shapefile") do dataset
...
featuredefn = AG.getlayerdefn(layer)
@test AG.getname(featuredefn) == "point_out"
AG.createfeature(featuredefn) do feature # This doesn't write any data out
#AG.createfeature(layer) do feature # I ended with this, which works
AG.setfield!(feature, AG.getfieldindex(feature, "Name"), "myname")
...
end
It doesn't error out because it is defined in context.jl line 52. So I am not sure if this is a bug or user error.
References: https://github.com/yeesian/ArchGDAL.jl/blob/0dbf3f71dfe347069d2bfeb969f4953ce71008b2/src/context.jl#L52-L61
https://github.com/yeesian/ArchGDAL.jl/blob/0dbf3f71dfe347069d2bfeb969f4953ce71008b2/test/test_gdal_tutorials.jl#L110-L116
Yeah I believe it should be called on layers. See also https://github.com/JuliaGeo/GDAL.jl/pull/59. We should probably add the feature count test here as well.
- yeah it should have been called on the layer in that test. Hence the
buglabel - More generally, I can see how it will be confusing to users, and we should add documentation to distinguish between creating "floating" features, versus features that are "owned" by layers.
Test bug has been fixed in #67