projcrs function is not working

Hello, I cannot use projcrs somehow, I need it to extract some json georef data and make a latitude/longitude map so I can extract specific pixels over my .tiff file. I am reading my json file and I was trying to do
utmZone = '32634';
utmProjection = projcrs(utmZone);
[lat, lon] = projfwd(utmProjection, xCoords, yCoords);
But projcrs fails. I tried with many format and other numbers.
Is there something I may be missing?
>> p = projcrs(28992);
Error: File: validateLengthUnit.m Line: 1 Column: 1
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Error in referenceEllipsoid/epsgEllipsoid (line 481)
self.pLengthUnit = validateLengthUnit(uom_name);
Error in referenceEllipsoid (line 288)
self = self.epsgEllipsoid(code);
Error in geocrs/setPropertiesFromCRSInput (line 212)
obj.Spheroid = referenceEllipsoid(ellipsoidcode);
Error in geocrs (line 71)
obj = setPropertiesFromCRSInput(obj, crs);
Error in projcrs/setPropertiesFromCRSInput (line 498)
obj.GeographicCRS = geocrs(gcrscode,"Authority",crsinfo.GCRSAuthority);
Error in projcrs (line 89)
obj = setPropertiesFromCRSInput(obj, crs);

4 comentarios

It works here:
p = projcrs(28992)
p =
projcrs with properties: Name: "Amersfoort / RD New" GeographicCRS: [1x1 geocrs] ProjectionMethod: "Oblique Stereographic" LengthUnit: "meter" ProjectionParameters: [1x1 map.crs.ProjectionParameters]
Did you copy-and-paste that number from somewhere? It might have non-printing characters in it.
Madmad
Madmad el 11 de Sept. de 2024
No I wrote it myself, copying your does return the exact same error from my side. I wonder what is broken, never had this issue
Walter Roberson
Walter Roberson el 12 de Sept. de 2024
You have somehow corrupted validateLengthUnit.m ?
Madmad
Madmad el 12 de Sept. de 2024
Editada: Madmad el 12 de Sept. de 2024
Exactly, no idea why (another toolbox I downloaded that used the same name maybe?)
Thanks problem solved!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Historical Contests en Centro de ayuda y File Exchange.

Productos

Versión

R2023b

Etiquetas

Preguntada:

el 10 de Sept. de 2024

Editada:

el 12 de Sept. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by