Skip to content

Instantly share code, notes, and snippets.

@grav
Created July 1, 2016 08:46
Show Gist options
  • Save grav/859756dae0f5b6bed6d41051c6fe2b2f to your computer and use it in GitHub Desktop.
Save grav/859756dae0f5b6bed6d41051c6fe2b2f to your computer and use it in GitHub Desktop.
echo -e "\n\n------------ select from ms sql"
sqlcmd -S geotesterapache.cloudapp.net -U sa -P xxx -d skm_test_db -Q "select top 1 * from matrikel"
echo -e "\n\n------------ try parsing the spatial data"
export C_STR='MSSQL:driver=ODBC Driver 13 for SQL Server;server=geotesterapache.cloudapp.net;database=skm_test_db;UID=sa;PWD=xxx;tables=matrikel'
ogrinfo --debug on "$C_STR" -sql "select top 1 * from matrikel"
echo -e "\n\n------------ try querying through postgresql"
service postgresql start
psql -c "create database geotest encoding=UTF8 template=template0;"
psql -d geotest -c "create extension postgis; create extension ogr_fdw;"
pgsql-ogr-fdw/ogr_fdw_info -s "$C_STR" -l matrikel | psql -d geotest -f -
psql -d geotest -c "select * from matrikel limit 10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment