Community header

Forum

convertCoordinates Matlab

Tors Kouwenhoven, modified 3 Years ago.

convertCoordinates Matlab

Keen Forecaster Posts: 3 Join Date: 3/29/22 Recent Posts
I need to convert my gps coordinates from RD New to WGS84. For this I tried to use the convertCoordinates function, because I got my coordinates in a txt file from my gps and already defined them in variables in Matlab.
My input for this was: [lon,lat]=convertCoordinates(y,x,'CS1.code',28992,'CS2.code',4326);
When I did this I received the error code:
Victor Chavarrias, modified 3 Years ago.

RE: convertCoordinates Matlab

Famous Fortune teller Posts: 97 Join Date: 4/24/20 Recent Posts
For transforming the coordinates of a file (kml, pli, pol, spl, ldb…), use the EHY tool. See here how to access the OET:
  • https://oss.deltares.nl/web/riverlab-models/accessing-models
And then use function <EHY_convert>. E.g.:

1
EHY_convert('D:\coastline.ldb','ldb','fromEPSG',4326','toEPSG',28992)


EPSG 4326 is the one of Google Earth.
EPSG 28992 is RD new.

If you already have the coordinates loaded, then use <convertCoordinates>. E.g. for converting from WGS84 to RD-New:

1
np=10;
2
lat=linspace(51.986777,51.998311,np);
3
lon=linspace(4.382442,4.376618,np);
4
[x_RD,y_RD]=convertCoordinates(lon,lat,'CS1.code',4326,'CS2.code',28992);
Victor Chavarrias, modified 3 Years ago.

RE: convertCoordinates Matlab

Famous Fortune teller Posts: 97 Join Date: 4/24/20 Recent Posts
The function <convertCoordinates> is searching for function <odd> which is not in your paths. Have you added the paths to the OET? To do this, run function <oetsettings> at the top level of the checkout. 
Tors Kouwenhoven, modified 3 Years ago.

RE: convertCoordinates Matlab

Keen Forecaster Posts: 3 Join Date: 3/29/22 Recent Posts
I did add the paths in my own matlab file, but i don't understand if this is enough. Where do i run the oetsettings function, because i dont know what the checkout means.
​​​​​​​
Victor Chavarrias, modified 3 Years ago.

RE: convertCoordinates Matlab

Famous Fortune teller Posts: 97 Join Date: 4/24/20 Recent Posts
Hi, 

See the last paragraph of this page: https://oss.deltares.nl/web/riverlab-models/accessing-models

Does this help?
Tors Kouwenhoven, modified 3 Years ago.

RE: convertCoordinates Matlab

Keen Forecaster Posts: 3 Join Date: 3/29/22 Recent Posts
That did help thank you!