Hi,
in the source code I stumbled on direct OGR access and realized that I don’t know what it is. I haven’t found any documentation (now I think there might be something on the wiki) but at the end I remembered I’ve seen it (probably lately for the GSoC idea) and figured out that you can do the following:
prepare data
v.random output=direct_ogr_test -z npoints=10
v.out.ogr input=direct_ogr_test output=direct_ogr_test.shp
magic
v.info direct_ogr_test.shp@OGR layer=direct_ogr_test
This is pretty cool. There are just some issue and my question is weather I should create tickets for them.
-
You need to specify layer, in my case it was the same as filename without suffix. This took my some time to find out. Perhaps natural for GDAL/OGR, not so much for common users.
-
It gives strange errors when you use it for output.
note @OGR in output
v.clean input=direct_ogr_test.shp@OGR output=direct_ogr_test_clean@OGR tool=rmdac layer=direct_ogr_test
gives (which is not true):
ERROR: option : <direct_ogr_test_clean> exists. To overwrite, use the --overwrite flag
note @OGR in output and --o
v.clean input=direct_ogr_test.shp@OGR output=direct_ogr_test_clean@OGR tool=rmdac layer=direct_ogr_test --o
gives:
ERROR: Output vector map name direct_ogr_test_clean@OGR is not in the
current mapset (manual)
Which is at least right but perhaps not 100% fitting the OGR case.
-
Is the above read-only limitation necessary? I suppose it is not implemented but now the code is shared for reading with the external/link driver for reading. The issue is of course writing to different Mapset. I don’t like to potential mess in code and increased complexity in documentation and in writing checks (e.g. in GUI). However, it would be nice to find a way our it.
-
I haven’t tried GUI much but v.clean went through. Unfortunately, you cannot browse the file as a user. I guess this is a feature worth putting there. Some ideas on that would be good. Or is there a reason for not having it there?
-
I guess some documentation is needed. Perhaps even a separate page. Maybe we can try to replace text in manual “direct OGR access” in modules’ pages by a link to that page when building the pages.
-
The name OGR might not be really the right thing anymore since OGR merged more under GDAL if I’m following the website properly. We should consider this before writing the documentation or putting it to GUI.
Thanks,
Vaclav