EXPORT OUTPUT TO READABLE .PRJ FILE

7 visualizaciones (últimos 30 días)
Aiman Syahmi
Aiman Syahmi el 23 de Ag. de 2022
Respondida: Abhaya el 4 de Oct. de 2024
Hi, good day to all.
im trying to write a script that is able to update the projections in mapinfo. The idea is that the user simply needs to update the parameters of the projection in an excel and then MATLAB is used to update the updated parameters inside the mapinfo (.PRJ) file.
Within MATLAB everything works fine. Its a 2273 x 1 cell. Attached below is how i want the output to look like.
However, when i export it looks like this:
The problem that i face are:
1) Too many semicolons "" written at beginning and ending of each line
2) I still havent found any method to export to .PRJ format. Currently only exporting in .TXT.
The line that i used to export the data is: writecell(ans, 'MyFile.txt')
Kindly assist in my problem. Thanks.

Respuestas (1)

Abhaya
Abhaya el 4 de Oct. de 2024
Hi Aiman,
The extra double quotes in your text are caused by the ‘QuoteStrings’ property of the writecell’ function. By default, this option is set to minimal, which means it encloses delimiters, line endings, or double-quote characters in double quotes.
To remove these extra quotes, set the QuoteStrings property of the writecell’ function to false.
writecell(ans, 'MyFile.txt','QuoteStrings',false)
For further details on the writecell function, you can check out the MATLAB documentation given below.
The ‘.prj files typically follow the Well-Known Text (WKT) format. In MATLAB, the wktstring function can be used to generate WKT string representation of the specified projected or geographic coordinate reference system. To generate a ‘.prj’ file from a coordinate reference system, please refer to the MATLAB documentation linked below.
Hope this solves your query.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by