Convert osm file to mat file.

7 visualizaciones (últimos 30 días)
Shubham
Shubham el 28 de Sept. de 2023
Respondida: Jaynik el 3 de Oct. de 2023
Can we convert .osm file into .mat file in matlab??Is there any functionality for this??
  1 comentario
Dyuman Joshi
Dyuman Joshi el 28 de Sept. de 2023
Why do you need to convert the data and what do you want to do with the converted data?

Iniciar sesión para comentar.

Respuestas (1)

Jaynik
Jaynik el 3 de Oct. de 2023
Hi Shubham,
I understand that you want to convert “.osm file to a “.mat file in MATLAB. Currently, MATLAB does not provide a direct functionality to convert the “.osm file to “.mat file. You can either directly read the osm file using "readgeotable" function or you can externally convert the osmfile into geoJSON format using Python. The geoJSON file can be directly converted into a "mat" file as follows:
geojsonStr = fileread('filename.geojson');
geojsonData = jsondecode(geojsonStr);
save('your_mat_file_name.mat', 'geojsonData');
You can read more about readgeotable here:
For understanding how to open ".osm" files on MATLAB directly, you can refer the following example:
Hope this helps!

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by