Skip to content

Instantly share code, notes, and snippets.

@bradbrowne
Last active July 26, 2018 06:00
Show Gist options
  • Save bradbrowne/51b1a9e182da361c66748e3ba51749f7 to your computer and use it in GitHub Desktop.
Save bradbrowne/51b1a9e182da361c66748e3ba51749f7 to your computer and use it in GitHub Desktop.
flux-convert-mga-zone-55-to-wgs-84.ps1
ogr2ogr -f "MSSQL" -overwrite "MSSQL:server=.;database=Flux;trusted_connection=yes;" "MSSQL:server=.;database=Flux;trusted_connection=yes;tables=vmadmin.parish_polygon" -s_srs EPSG:28355 -t_srs EPSG:4326 -nlt POLYGON -nln mapdojo.parish_polygon -lco "FID=pfi" -sql "SELECT [ogr_geometry],CAST([pfi] AS INTEGER) AS pfi,[parishc],[parish],[pfi_cr],[ufi],[ufi_cr],[ufi_old] FROM [vmadmin].[parish_polygon]"
@bradbrowne
Copy link
Author

bradbrowne commented Jul 26, 2018

-nlt POLYGON to make the destination geometry a POLYGON type.

@bradbrowne
Copy link
Author

bradbrowne commented Jul 26, 2018

-lco "FID=pfi" to make the PFI column the unique identifier -- keep in mind that will also mean that you need to CAST(PFI AS INT) otherwise you will get weird OGR errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment