shapefilegdalutmwgs84

Converting coordinates from SVY21 to WGS84


I am trying to transform the SVY21 coordinates I have to the WGS84 coordinate system.

I tried using the GDAL software and pasted the following into command after installing: ogr2ogr -f GeoJSON –t_srs WGS84 <jsonFileName>.json <shapefile>.shp

It results in the failure:

Unable to open datasource 'WGS84' with the following drivers

And the drivers are listed.

Also I tried to use the python utm package to convert the N48 utm coordinate to WGS48, but I did not manage to convert the SVY21 coordinates to the N48 utm reference point.

I found the proposed solution in this old post confusing in terms of terminology and I would prefer using some existing solution.

Is there a "easy" solution that makes use of my previous approaches or is quickly applicable to my problem? I would also be happy if someone could provide me with a more precise explanation of the approach featured in the older post.

Thanks in advance.

Edit: I tried writing a python script that implements the vicenty direct calculation from the "old post" mentioned before. It would also help, if someone could confirm that substracting the False Coordinates of Projection Origin (28001.642mE,38744.572mN) from the raw svy21 (e,n) and using the Projection Origin (Unmarked point) (103° 50' 00", 1° 22' 00") is correct.


Solution

  • I was compiling gdal by hand and I could use the following command to do what you wanted:

    1. You have to copy the *.shp (and *.shx) files beside the ogr2ogr-command (Source: https://gis.stackexchange.com/questions/56652/how-to-move-and-open-shapefiles-with-ogr2ogr)

    2. gdal does not immediately know "EPSG:3414" - the EPSG name for SCY21, so give it a hint, this is in the [INSTALL LOCATION]/data (i dont know where it is on an installed version, especially not on windows. Search for a file called "gcs.csv", and point GDAL_LOCATION to the containing folder.

    3. define t_srs and s_srs eccordingly

    4. Define the output format ("GEOJson")

    Summa summarum:

    GDAL_DATA="../data" ./ogr2ogr -f "GEOJson" "LaneMarking_wgs84.json" "LaneMarking.shp" -t_srs WGS84 -s_srs "EPSG:3414"
    

    Have fun :)