Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Compile with sqlite driver #5

Closed
yeesian opened this issue Sep 18, 2018 · 6 comments
Closed

Compile with sqlite driver #5

yeesian opened this issue Sep 18, 2018 · 6 comments

Comments

@yeesian
Copy link
Member

yeesian commented Sep 18, 2018

Discourse discussion.

@visr
Copy link
Member

visr commented Sep 18, 2018

Yeah another good one to add. Shouldn't be too much work since this already exists:

https://github.com/JuliaDatabases/SQLiteBuilder

@niclasmattsson
Copy link

Bump. My use case is that I need to perform a SQL UPDATE command in ogrinfo to create an integer field (so that I can use this field for rasterization later). Apparently UPDATE is not supported in OGR SQL and requires SQlite instead.

julia> run(`$gdalpath/ogrinfo globtest.shp -dialect SQLite -sql "UPDATE globtest SET FID=CAST(substr(GID_1,5) AS INTEGER)"`)                                                                                                                
INFO: Open of `globtest.shp'                                                                                              
      using driver `ESRI Shapefile' successful.                                                                           
ERROR 6: The SQLite driver needs to be compiled to support the SQLite SQL dialect                                         
Process(`'C:\Users\niclas\.julia\packages\GDAL\vec6Y\deps\usr\bin/ogrinfo' globtest.shp -dialect SQLite -sql 'UPDATE globtest SET FID=CAST(substr(GID_1,5) AS INTEGER)'`, ProcessExited(0))                                                                                                                                                                      

@yeesian yeesian added the good first issue Good for newcomers label Oct 7, 2018
@yeesian
Copy link
Member Author

yeesian commented Oct 7, 2018

@niclasmattsson might you be interested in giving it a shot?

@robot144
Copy link

robot144 commented Dec 5, 2018

i would like to use the gpkg format, which uses sqlite for storage. would this also help for my issue?

@visr
Copy link
Member

visr commented Dec 5, 2018

Yes, I assume that GeoPackage support is also added with this.

So in 4aa05a9 I added libsqlite3. But it is not yet live due to several issues with the builds:

JuliaGeo/LibGEOS.jl#56
https://travis-ci.org/JuliaGeo/PROJBuilder/builds/442663332

JuliaGeo/GDAL.jl#60

@yeesian yeesian removed the good first issue Good for newcomers label Dec 22, 2018
visr added a commit that referenced this issue May 27, 2019
To avoid what seems like cxx string ABI issues:
```
#0  0x00007ff98ba7475b in ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#1  0x00007ff98ba7c266 in ntdll!RtlpNtSetValueKey () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#2  0x00007ff98ba7c531 in ntdll!RtlpNtSetValueKey () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#3  0x00007ff98ba1a505 in ntdll!RtlRaiseStatus () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#4  0x00007ff98ba2990d in ntdll!memset () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#5  0x00007ff98ada98bc in msvcrt!free () from /cygdrive/c/WINDOWS/System32/msvcrt.dll
#6  0x000000006fcb40ea in libstdc++-6!_ZNSs9_M_mutateEyyy () from /cygdrive/c/bin/julia/bin/libstdc++-6.dll
#7  0x000000006fcb2d5e in libstdc++-6!_ZNSs15_M_replace_safeEyyPKcy () from /cygdrive/c/bin/julia/bin/libstdc++-6.dll
#8  0x000000006fcb3586 in libstdc++-6!_ZNSs6assignEPKcy () from /cygdrive/c/bin/julia/bin/libstdc++-6.dll
#9  0x000000002b510170 in libgdal-26!GTIFSetFromOGISDefnEx () from /cygdrive/c/Users/visser_mn/.julia/dev/GDAL/deps/usr/bin/libgdal-26.dll
#10 0x000000002b4e7aa7 in libgdal-26!_ZN12GTiffDataset10CreateCopyEPKcP11GDALDatasetiPPcPFidS1_PvES6_ () from /cygdrive/c/Users/visser_mn/.julia/dev/GDAL/deps/usr/bin/libgdal-26.dll
#11 0x000000002b7e854e in libgdal-26!_ZN10GDALDriver10CreateCopyEPKcP11GDALDatasetiPPcPFidS1_PvES6_ () from /cygdrive/c/Users/visser_mn/.julia/dev/GDAL/deps/usr/bin/libgdal-26.dll
#12 0x000000002aed4180 in ?? ()
```

Also strip shared libraries on other platforms.
visr added a commit that referenced this issue May 27, 2019
* Build Windows on GCC 7

To avoid what seems like cxx string ABI issues:
```
#0  0x00007ff98ba7475b in ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#1  0x00007ff98ba7c266 in ntdll!RtlpNtSetValueKey () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#2  0x00007ff98ba7c531 in ntdll!RtlpNtSetValueKey () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#3  0x00007ff98ba1a505 in ntdll!RtlRaiseStatus () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#4  0x00007ff98ba2990d in ntdll!memset () from /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
#5  0x00007ff98ada98bc in msvcrt!free () from /cygdrive/c/WINDOWS/System32/msvcrt.dll
#6  0x000000006fcb40ea in libstdc++-6!_ZNSs9_M_mutateEyyy () from /cygdrive/c/bin/julia/bin/libstdc++-6.dll
#7  0x000000006fcb2d5e in libstdc++-6!_ZNSs15_M_replace_safeEyyPKcy () from /cygdrive/c/bin/julia/bin/libstdc++-6.dll
#8  0x000000006fcb3586 in libstdc++-6!_ZNSs6assignEPKcy () from /cygdrive/c/bin/julia/bin/libstdc++-6.dll
#9  0x000000002b510170 in libgdal-26!GTIFSetFromOGISDefnEx () from /cygdrive/c/Users/visser_mn/.julia/dev/GDAL/deps/usr/bin/libgdal-26.dll
#10 0x000000002b4e7aa7 in libgdal-26!_ZN12GTiffDataset10CreateCopyEPKcP11GDALDatasetiPPcPFidS1_PvES6_ () from /cygdrive/c/Users/visser_mn/.julia/dev/GDAL/deps/usr/bin/libgdal-26.dll
#11 0x000000002b7e854e in libgdal-26!_ZN10GDALDriver10CreateCopyEPKcP11GDALDatasetiPPcPFidS1_PvES6_ () from /cygdrive/c/Users/visser_mn/.julia/dev/GDAL/deps/usr/bin/libgdal-26.dll
#12 0x000000002aed4180 in ?? ()
```

Also strip shared libraries on other platforms.

* fix library locations

* don't strip on osx
@visr
Copy link
Member

visr commented May 31, 2019

Closing this as the v3.0.0-3 build used in JuliaGeo/GDAL.jl#66 is compiled with this driver (still adding this as a test in the PR).

Some relevant lines from the build.log:

checking for sqlite3_open in -lsqlite3... yes
checking for SQLite3 library >= 3.0.0... yes
checking for sqlite3_column_table_name in -lsqlite3... no
configure: rasterlite2 support disabled

  SQLite support:            yes

So yes it is supported. But there are also more SQLite extensions that can be used that are currently not built in the SQLiteBuilder, like sqlite3_column_table_name for rasterlite2. Or GPKG can use the SQLite rtree extension:

https://gdal.org/drivers/vector/gpkg.html
http://www.geopackage.org/guidance/extensions/rtree_spatial_indexes.html

Probably best to open seperate issues about those when we need them.

@visr visr closed this as completed May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants