Skip to content

Instantly share code, notes, and snippets.

@Charmatzis
Created July 14, 2020 05:27
Show Gist options
  • Save Charmatzis/0b7482bdb4320f175bb0d2ddd273c8eb to your computer and use it in GitHub Desktop.
Save Charmatzis/0b7482bdb4320f175bb0d2ddd273c8eb to your computer and use it in GitHub Desktop.

Reading tiles using RIO

<GDAL_WMS>
    <Service name="TMS">
	<ServerUrl>https://api.mapbox.com/v4/mapbox.satellite/${z}/${x}/${y}.jpg?access_token=******</ServerUrl> <!-- Map -->
    </Service>
    <DataWindow>
        <UpperLeftX>-20037508.34</UpperLeftX>
        <UpperLeftY>20037508.34</UpperLeftY>
        <LowerRightX>20037508.34</LowerRightX>
        <LowerRightY>-20037508.34</LowerRightY>
        <TileLevel>3</TileLevel>
        <TileCountX>1</TileCountX>
        <TileCountY>1</TileCountY>
        <YOrigin>top</YOrigin>
    </DataWindow>
    <Projection>EPSG:3857</Projection>
    <BlockSizeX>256</BlockSizeX>
    <BlockSizeY>256</BlockSizeY>
    <BandsCount>3</BandsCount>
    <MaxConnections>5</MaxConnections>
    <Cache />
</GDAL_WMS>

then

rio convert -f PNG mapbox.satellite.xml mapbox.satellite.PNG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment