Vishful thinking…

TileCutter update – With support for OSM and WMS map services

Posted in .NET, ArcGIS, C#, ESRI, GIS, OpenSource, Utilities by viswaug on June 28, 2011

I just added support for creating MBTiles caches for WMS map services and also to download OSM tiles into the MBTiles format. MBTiles cache for WMS map services would improve map rendering performance, but why did i add support for OSM tile sets? Well, they will come in handy for disconnected/offline use cases. So, here are some usage examples

ArcGIS Dynamic Map Service:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\ags.s3db” -t=agsd -m=”http://server.arcgisonline.com/ArcGIS/rest/services/I3_Imagery_Prime_World_2D/MapServer”

WMS Map Service 1.1.1:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\wms111.s3db” -t=wms1.1.1 -m=”http://sampleserver1-350487546.us-east-1.elb.amazonaws.com/ArcGIS/services/Specialty/ESRI_StateCityHighway_USA/MapServer/WMSServer”

WMS Map Service 1.3.0:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\wms130.s3db” -t=wms1.3.0 -m=”http://sampleserver1-350487546.us-east-1.elb.amazonaws.com/ArcGIS/services/Specialty/ESRI_StateCityHighway_USA/MapServer/WMSServer”

OSM:

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\osm.s3db” -t=osm -m=”http://tile.openstreetmap.org”

And always just type “TileCutter -h” for usage information.

Want to customize the parameters with which the maps are being generated? Just use the “-s” command line option ans specify the setting in a query string format.

TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\ags.s3db” -t=agsd -m=”http://server.arcgisonline.com/ArcGIS/rest/services/I3_Imagery_Prime_World_2D/MapServer” -s=”transparent=true&format=jpeg”

Also, if some of the tile requests result in errors, the level, column, row and error message information would be logged into a text file in the same directory as the MBTiles cache.

And now, for the best new feature of TileCutter, the program does not store duplicate tiles. That is, if the area you are caching has a lot of empty tiles in the ocean etc, the MBTiles cache created by TileCutter will only store one tile for all those duplicated tile images. Should help save disk space :)

TileCutter can be downloaded here

About these ads

12 Responses

Subscribe to comments with RSS.

  1. [...] MBTiles cache files at the same time if needed. And also, you can create MBTile caches with the TileCutter. The viewer was created using the ESRI WPF map control. If you would like to see this viewer do [...]

  2. Ian Thomas said, on September 7, 2011 at 2:17 pm

    Greetings Vish,
    Many thanks for the awesome tool.
    One request: could you please add an option to enable the possibility of tilecutting a local image file as well?
    I have a lot of raster map files sitting on my hard-drive waiting to be batch converted into MBTiles format.
    A scriptable executable like tilecutter.exe would work great….maybe it’s already out there somewhere already…still looking.

    Thanks again,

    Free World Maps

  3. Josh Marsden said, on October 4, 2011 at 7:00 pm

    Vish, this is an awesome tool. As a new feature though, would it be possible to regions at different zooms. Say the entire globe at zooms 1 – 5, but a smaller portion at 6 – 10? I tried to take to mbtiles databases and merge them with the dump command as found on github, but it throws error saying the primary key isn’t unique. So any ideas or tips would be appreciated.

  4. Cesar said, on November 12, 2011 at 7:35 pm

    Hi Vish, thanks a lot for this tool . It is great.
    I am always getting a 404 error when trying to get tiles from opentreetmaps , even with the sample script:

    Error while downloading tile Level:7, Row:51, Column:-34078062 – The remote server returned an error: (404) Not Found..

    Thanks again and regards

    • viswaug said, on November 12, 2011 at 11:19 pm

      Can u post the command u are using?

      Thank You,
      Vish

      • Cesar said, on November 12, 2011 at 11:45 pm

        Thanks for your answer. I have tried too with your usage sample and getting the same error:

        TileCutter.exe -z=7 -Z=9 -x=-95.844727 -y=35.978006 -X=-88.989258 -Y=40.563895 -o=”C:\LocalCache\osm.s3db” -t=osm -m=”http://tile.openstreetmap.org”

        It works perfectly with arcgis.

        Thanks again .

  5. Mike said, on May 28, 2012 at 5:42 pm

    I get the following error using the examples: ‘The tilecache path provided is not valid’
    The local path does exist. Any thoughts?

    Thanks

  6. Matt said, on December 8, 2012 at 5:20 am

    Getting the same error as Mike. Any suggestions? Thanks!

  7. Bruno Gendron said, on January 26, 2013 at 4:30 pm

    One great addition would be to be able to extract existing tiles from an arcgis tiled service…
    Thanks!

  8. Jon Clayton said, on February 1, 2013 at 9:57 pm

    Looks like we need to create a SQLite database file first? I get the tilecache path provided is not valid. It has a file name it it “ags.s3db” and I assume that needs to be the database? Looks like a great utility once I get it running. Thanks!

  9. angelo arboleda (@ghelobytes) said, on May 2, 2014 at 8:39 am

    Hi vish! Is the source open?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: