Write xml file OGC WMS Service compliant with MAtlab
2 views (last 30 days)
Show older comments
Hi all. I'm working with the OGC WMS Service and need to write an xml readable by some gdal function like gdal info and gdal_translate. I have some xml example like the following:
GDAL_WMS> name="TMS" ServerUrl>http://tile.openstreetmap.org/${z}/${x}/${y}.png</ServerUrl /Service DataWindow UpperLeftX-20037508.34</UpperLeftX> UpperLeftY>20037508.34</UpperLeftY LowerRightX>20037508.34</LowerRightX LowerRightY-20037508.34</LowerRightY> TileLevel>18</TileLevel TileCountX>1</TileCountX TileCountY>1</TileCountY YOrigin>top</YOrigin /DataWindow Projection>EPSG:3857</Projection BlockSizeX>256</BlockSizeX BlockSizeY>256</BlockSizeY BandsCount>3</BandsCount Cache/ /GDAL_WMS
I write a simple matlab program that write the following xml file: version="1.0" encoding="utf-8"? GDAL_WMS name="TMS" ServerURL>http://tile.openstreetmap.org/${z}/${x}/${y}.png</ServerURL /Service DataWindow UpperLeftX-20037508.34</UpperLeftX> UpperLeftY>20037508.34</UpperLeftY LowerRightX>20037508.34</LowerRightX LowerRightX-20037508.34</LowerRightX> TileLevel>18</TileLevel TileCountX>1</TileCountX TileCountY>1</TileCountY YOrigin>top</YOrigin /DataWindow Projection>EPSG:3857</Projection BlockSizeX>256</BlockSizeX BlockSizeY>256</BlockSizeY BandsCount>3</BandsCount /GDAL_WMS
Trying to open the two xml files with gdalinfo, the second give the error: "Your xml file not recognised as a supported file format."
Without the first line: "<?version="1.0" encoding="utf-8"?>" the xml became readable.
Can someone explain how write an xml such the first?
Thanks a lot for your help
Lorenzo
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!