[GRASS-user] v.out.ogr - layer name
Moritz Lennert
mlennert at club.worldonline.be
Fri Jan 4 07:04:21 PST 2019
On 3/01/19 15:13, Daniel McInerney wrote:
> Hi List,
>
> When I export a vector using v.out.ogr, I'm unable to assign an output
> layer name when the output format is 'ESRI_Shapefile'. For example:
>
> v.out.ogr input=grid_clip output=grid_clip.shp output_layer=sub_grid
> format='ESRI_Shapefile'
>
> Exporting 4 areas (may take some time)...
> 100%
> v.out.ogr complete. 4 features (Polygon type) written to <sub_grid>
>
> the message indicates that it has been written to sub_grid, but the
> output from ogrinfo indicates that is hasn't been updated:
>
> ogrinfo -so grid_clip.shp
>
> INFO: Open of `grid_clip.shp'
> using driver `ESRI Shapefile' successful.
> 1: grid_clip (Polygon)
>
> However, the above process works, and the correct layer name is written,
> when the output format is GeoPackage or SQLite. I can update the layer
> name subsequently with ogr2ogr, but it would be preferable if this could
> be avoided. I'm using GRASS 7.4.0 (2018) on Ubuntu 18.04 (bionic).
>
> Any advice appreciated.
I don't think shapefile supports the notion of layer names as each layer
is in a separate file, so file = layer, and filename = layername.
v.out.ogr could possibly be enhanced by including a warning about this
when the user tries to assigne a layer name to a shapefile.
Moritz
More information about the grass-user
mailing list