wktstring
R2026bWell-known text string
Description
str = wktstring( returns the well-known
text (WKT) string representation of the specified projected, geographic, or vertical
coordinate reference system (CRS). By default, crs)wktstring uses the WKT 2
standard and does not apply formatting.
str = wktstring(
specifies version and formatting options using one or more name-value arguments. For
example, crs,Name=Value)Format="formatted" includes line breaks and indentations in the
WKT string.
Examples
Return information about projected data as a RasterInfo object. Find the projected CRS for the data by accessing its CoordinateReferenceSystem property.
info = georasterinfo("MtWashington-ft.grd");
p = info.CoordinateReferenceSystem;Return the WKT as a string.
str = wktstring(p)
str = "PROJCRS["UTM Zone 19, Northern Hemisphere",BASEGEOGCRS["NAD27",DATUM["North American Datum 1927",ELLIPSOID["Clarke_1866",6378206.4,294.978698213898,LENGTHUNIT["metre",1]],ID["EPSG",6267]],PRIMEM["Greenwich",0,ANGLEUNIT["Degree",0.0174532925199433]]],CONVERSION["UTM zone 19N",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["Degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",-69,ANGLEUNIT["Degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Scale factor at natural origin",0.9996,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",500000,LENGTHUNIT["Meter",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["Meter",1],ID["EPSG",8807]],ID["EPSG",16019]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["Meter",1]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["Meter",1]]]"
Return information about geographic data as a RasterInfo object. Find the geographic CRS for the data by accessing its CoordinateReferenceSystem property.
[Z,R] = readgeoraster("n39_w106_3arc_v2.dt1");
g = R.GeographicCRS;Return the WKT as a string.
wkt = wktstring(g)
wkt = "COMPOUNDCRS["WGS 84 + EGM96 geoid height",GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],VERTCRS["EGM96 geoid height",VDATUM["EGM96 geoid"],CS[vertical,1],AXIS["up",up,LENGTHUNIT["metre",1]],ID["EPSG",5773]]]"
Return information about a data set as a RasterInfo object. Find the projected CRS for the data by accessing the CoordinateReferenceSystem property.
info = georasterinfo("MtWashington-ft.grd");
p = info.CoordinateReferenceSystem;Return the WKT as a formatted string by using the Format name-value argument.
str = wktstring(p,Format="formatted")str =
"PROJCRS["UTM Zone 19, Northern Hemisphere",
BASEGEOGCRS["NAD27",
DATUM["North American Datum 1927",
ELLIPSOID["Clarke_1866",6378206.4,294.978698213898,
LENGTHUNIT["metre",1]],
ID["EPSG",6267]],
PRIMEM["Greenwich",0,
ANGLEUNIT["Degree",0.0174532925199433]]],
CONVERSION["UTM zone 19N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["Degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",-69,
ANGLEUNIT["Degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["Meter",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["Meter",1],
ID["EPSG",8807]],
ID["EPSG",16019]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["Meter",1]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["Meter",1]]]"
Return information about a data set as a RasterInfo object. Find the projected CRS for the data by accessing the CoordinateReferenceSystem property. Return the WKT as a string using the WKT 1 standard.
info = georasterinfo("MtWashington-ft.grd"); p = info.CoordinateReferenceSystem; str = wktstring(p,Version="wkt1");
Export the WKT to a projection file called mtwash.prj.
writematrix(str,"mtwash.prj",FileType="text",QuoteStrings=false)
Input Arguments
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: wktstring(crs,Version="wkt1") specifies the WKT 1 standard
for the output well-known text string.
Format of the WKT string, specified as one of these values:
"compact"— Do not include formatting."formatted"— Include line breaks and indentations.
WKT version, specified as one of these values:
"wkt2"— Use the WKT 2 standard. For more information about this standard, see Geographic Information – Well-known text representation of coordinate reference systems."wkt1"— Use the WKT 1 standard. For more information about this standard, see Coordinate Transformation Service. Note that some 3-D geographic CRSs do not support the WKT 1 standard.
Tips
The WKT strings for two equivalent CRS objects might not be equivalent. Compare CRS
objects by using the isequal function
instead of by comparing WKT strings.
Version History
Introduced in R2020bGet the WKT string representation of a vertical CRS by specifying a
vertcrs object as input to the wktstring
function.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)