Last active
September 30, 2020 06:23
-
-
Save bradbrowne/c732e06c38ee9fb61af0 to your computer and use it in GitHub Desktop.
Export Shapefile from SQL Server using ogr2ogr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ogr2ogr -f "ESRI Shapefile" "PROPERTY_VIEW.shp" "MSSQL:server=.;database=Flux;tables=vmprop.PROPERTY_VIEW;trusted_connection=yes" -t_srs EPSG:28355 -sql "SELECT [PFI],[SP_GEOMETRY] FROM [vmprop].[PROPERTY_VIEW]" -overwrite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create an Esri Shapefile from the SQL Server table, which is easy to do using ogr2ogr, and ensuring that the output projection is specified using
-t_srs
so that the .prj file is written as well.