Skip to content

Instantly share code, notes, and snippets.

@yunusyurtturk
Last active October 17, 2024 20:02
Show Gist options
  • Save yunusyurtturk/4303450d2d49db90c733d079b80babb5 to your computer and use it in GitHub Desktop.
Save yunusyurtturk/4303450d2d49db90c733d079b80babb5 to your computer and use it in GitHub Desktop.
GDAL/OGR Commands
Command to convert S-57 file to PostGIS data:
ogr2ogr -f "PostgreSQL" PG:"dbname=<dbname> user=<user> password=<password>" "<path_to_s57>"
Convert a shp file to GeoJSON
ogr2ogr -f "GeoJSON" usa.geojson "<path_to_file.shp>"
Command to serve http-server as https:
openssl req -nodes -new -x509 -keyout server.key -out server.cert
http-server -S -C server.cert -K server.key
In order to display layers of an S57 file (with .000 extension)
ogrinfo E:\Hypernova\OpenCPNCharts\US_REGION04\US5BALBE\US5BALBE.000 ( -t_srs EPSG:4326) // To target/reproject to WGS84)
DO NOT FORGET TO PLACE s57objectclasses.csv and s57attributes.csv files!
S57 to GeoJSON command:
ogr2ogr -f "GeoJSON" OUTPUT_LAYERNAME.geojson <full_path_.000> LAYERNAME
Serving MBTiles:
- npm install -g tileserver-gl
- tileserver-gl
- Go to localhost:8080, read instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment