In this example we use ogr2ogr to change SRID of a GIS Shape File from SRS Projection EPSG:28356 GDA94 to EPSG:4326 WGS84 using ogr2ogr and proj4js. first, you need to find out the epsg projection 28356 – gda94 / mga zone 56 from below and copy into -s_srs in the ogr2ogr command. https://spatialreference.org/ref/epsg/gda94-mga-zone-56/proj4/ Then run […]
Category Archives: Geospatial
Latest tutorials and tips for Geospatial
For exporting GIS shapefile to a postgresql database we can use ogr2ogr command, example: ogr2ogr -t_srs EPSG:3857 -f PostgreSQL “PG:dbname=databasename user=databaseuser” test.shp In example above we export (test.shp) to database: “databasename“ with a dbuser: “databaseuser” with SRID= EPSG:3857 For exporting a geojson file into Postgis ogr2ogr -f “PostgreSQL” PG:”PG:dbname=databasename user=databaseuser” “test.geojson” […]
For importing or ingesting GIS shapefile to a postgresql database we can use shp2pgsql command, example: shp2pgsql -s 4326 -c -D -I myshapefile dbtable | \ psql -d dbname -h localhost -p 5432 -U dbuser In example above we convert or import the shapefile (myshapefile) to dbtable in dbname database with a dbuser. […]