Closed liyinxiao closed 4 years ago
As mentioned in the issue it doesn't make sense to me to limit the allowed drivers. It is kind of obvious that it doesn't work with something like the OSM driver, but there might be others that work. So I'd be okay with this allowing all drivers and if it doesn't work, it doesn't work and there will be some kind of error. The documentation can say something like "only tested with sqlite and shapefile driver" or so. But that way we are not putting in any "artifical" limits.
Can you also please
-g
option?Updates:
Thanks. This looks nearly done now. But you forgot to remove the check for the two drivers. And could you at least check in the test script that the shapefile was created?
Updates:
This pull request is related to this issue.
Test plan:
./osmcoastline -o test.db -v ~/Downloads/hawaii-latest.osm.pbf
./osmcoastline -o test_shapefile -v -g "ESRI Shapefile" ~/Downloads/hawaii-latest.osm.pbf
./osmcoastline -o test.db -v ~/Downloads/rhode-island-latest.osm.pbf
./osmcoastline -o test_shapefile -v -g "ESRI Shapefile" ~/Downloads/rhode-island-latest.osm.pbf
All commands run as expected.My opinion on "supporting all GDAL drivers" I have tested a few GDAL drivers such as GEOJSON, OpenFileGDB, OSM, and all of them return errors for various reasons. For example, GeoJSON driver doesn't support creating more than one layer, while OSM driver does not support the GDALDriver::Create() operation. As a result, "supporting all GDAL drivers" requires a significant amount of code changes. By adding support only for "ESRI Shapefile", we are adding value to osmcoastline without too much additional work.