# GDAL/ogr2ogr File Conversion

**URL:** https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835
**Category:** General Usage
**Tags:** question, gdal
**Created:** [June 15, 2022, 8:23pm UTC](https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835 "2022-06-15T20:23:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hexjulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexjulia/32/37204_2.png) [@hexjulia](https://discourse.julialang.org/u/hexjulia)
#### Post date: [June 15, 2022, 8:23pm UTC](https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835/1 "2022-06-15T20:23:37Z")

</div>

Hi all,

I’m trying to complete what I thought would be a relatively simple task (although I am new to Julia and coding in general) with GDAL, specifically converting a .shp to a GeoPackage using ogr2ogr.

I’ve followed the available documentation [here](https://github.com/JuliaGeo/GDAL.jl). Specifically the example:

```julia
# convert simple features data between file formats
GDAL.ogr2ogr_path() do ogr2ogr
    run(`$ogr2ogr -f FlatGeobuf output.fgb input.shp`)
end

```

My current script is:

```julia
using GDAL
using SQLite

GDAL.ogr2ogr_path() do ogr2ogr
    run('$ogr2ogr -f GPKG output.gpkg input.shp')
end

```

Which throws an error: `ERROR: syntax: character literal contains multiple characters`

I’ve tested the package installation with no issues. Been stumped for a little while. Any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![hexjulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexjulia/32/37204_2.png) [@hexjulia](https://discourse.julialang.org/u/hexjulia)
#### Post date: [June 15, 2022, 8:27pm UTC](https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835/2 "2022-06-15T20:27:21Z")

</div>

Well I’ve figured out it’s because

```julia
`

```

Is different than

```julia
'

```

Could someone please explain to me what exactly that character is? I feel immensely dumb.

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [June 15, 2022, 8:42pm UTC](https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835/3 "2022-06-15T20:42:42Z")

</div>

`'` is for `Char`

```julia
`

```

is for commands.

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [June 15, 2022, 9:33pm UTC](https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835/4 "2022-06-15T21:33:06Z")

</div>

> [@hexjulia](#):
>
> specifically converting a .shp to a GeoPackage using ogr2ogr.

If all you are doing with `ogr2ogr` is a disk file format conversion why using Julia and not doing it directly on a shell?

---

<div class="post-metadata">

### Author: ![hexjulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexjulia/32/37204_2.png) [@hexjulia](https://discourse.julialang.org/u/hexjulia)
#### Post date: [June 15, 2022, 10:29pm UTC](https://discourse.julialang.org/t/gdal-ogr2ogr-file-conversion/82835/5 "2022-06-15T22:29:10Z")

</div>

I’m going to have to expand the code quite a lot to parse several directories and convert hundreds of files. Just starting out with the small example here.
