TileMill - Cartographic Design Studio

    image

    TileMill is a tool for cartographers that allows you to quickly and easily create and draw maps for the web using different data sources. It is based on Mapnik, a powerful open source library. TileMill is not a general-purpose mapping tool, it is designed to solve a narrow set of tasks.

    The principle of operation of TileMill is very simple. You import your vector data into the studio. TileMill supports ESRI shapefiles, KML, GeoJSON, GeoTIFF and, more recently, PostGIS support has been announced. Make it all out with CSS like Carto language and export it to one of the formats (PNG, PDF or MBTiles).

    Opportunities

    • Access data from local sources or through Amazon S3
    • Manage map layers (shape, rasters)
    • Editing a style sheet directly in a browser or in an external editor (for example, in vim)
    • Map preview when editing a stylesheet
    • View geospatial data attribute table
    • Export data to PNG, PDF and MBTiles.


    For details, I invite you to Cat.

    System requirements

    • Customer
      • Verified: Chrome 6+, Firefox 3+, IE8 +
      • Can work in Opera 11

    • Server
      • Verified: Mac OS X 10.6, Ubuntu 10.10, Gentoo
      • At least 2 GB of RAM
      • Can work with other POSIX-compatible systems




    Mapnik

    Mapnik is an open library for rendering raster maps from vector data. It was developed for the OpenStreetMap project by our compatriot Artem Pavlenko, and today it is used by many resources, among which it is worth noting the Russian Cosmos . The OpenStreetMap and MapQuest projects also use this library for some of their maps. Mapnik is written in C ++ and Python. It uses the AGG library and makes it possible to smooth objects on the map with subpixel accuracy. Supports ESRI shapefiles, PostGIS, TIFF rasters, .osm files, as well as any GDAL and OGR formats. Packages are available for most Linux distributions, binaries are available for Mac OS X and Windows.

    Install Mapnik

    svn checkout -r 2898 svn.mapnik.org/trunk mapnik2
    cd mapnik2
    python scons/scons.py configure
    python scons/scons.py
    sudo python scons/scons.py install



    A bit about cartography

    For those who are familiar with GIS or mapping, I’ll immediately say that maps in TileMill are always projected into Web Mercator (EPSG: 900913). Microsoft Bing Maps, Google Maps, and ESRI ArcGIS Online also use this projection.

    The format of the spatial referencing system proj4 SRS (spatial referencing system) is widespread. This system provides the ability to describe the projection and coordinate system of the data source with one record - the SRS string (SRS string). For example, the SRS line describing WGS84 looks something like this:

    +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

    In most cases, TileMill can determine the SRS of loaded shapefiles and other data sources. But sometimes it may be necessary to specify SRS yourself, in case TileMill cannot determine it yourself.

    What are tiles?

    image
    A tile is a 256x256 pixel bitmap in PNG / JPEG format.

    TileMill supports different levels of presentation. The presentation level is the predefined map display scale. OpenStreetMap, Google Maps and other cartographic web services provide tiles of 256x256 pixels in size at the zero level of representation and double the sizes at each subsequent level. For example: at the zero level of representation, the whole world is visible, at the sixth level - a medium-sized country, at the eleventh - a metropolis. At sixteenth level, you can see individual houses.

    In addition, TileMill supports exporting maps to the MBTiles format. This format was developed specifically for storing cards and the ability to access them both online and offline.

    MBTiles

    MBtiles is a specification for storing cards cut into tiles in SQLite DBMSs with the possibility of instant return. This data format allows you to transfer thousands, hundreds of thousands and even millions of tiles in one file.
    The upload speed of MBTiles is higher than the upload speed of millions of individual tiles when downloading to USB, mobile devices, or when transferring over a network. The difference in speed between access to a database or file system when using MBTiles is insignificant.
    Since MBTiles use the embedded SQLite DBMS, they can be used without an Internet connection.
    Tiles are stored as BLOB (Binary Large OBjects - a format for storing large volumes of binary data), therefore, they can be used in most SQLite clients.

    Install TileMill

    TileMill source code is available on Github. We start . Now we launch the browser, by default TileMill should be accessible at the address .

    git://github.com/mapbox/tilemill.git
    cd tilemill
    ./ndistro


    ./tilemill.jslocalhost:8889

    Interface Overview


    By clicking on the link localhost:8889you will be available a set of predefined projects. Selecting one of them will take you to the editing page.

    image
    1. Toolbar
    2. Map
    3. Layer list
    4. Font selection and color picker
    5. Code editor



    image
    Toolbar
    1. Settings
    2. Project name
    3. Save project
    4. Export
    5. Project settings
    6. Close project



    image
    Map interface
    1. Map
    2. Scale
    3. Expand full screen



    image
    Layer list
    1. Add layer
    2. Reorder layers
    3. Layer geometry icon
    4. Identifiers and Classes
    5. View attribute table of a layer
    6. Edit layer
    7. Delete layer



    image
    View attribute table Style

    image
    Editor
    1. Active tab
    2. Delete style
    3. Inactive tabs
    4. Create new style
    5. MSS Syntax Help
    6. Line numbers
    7. Text area



    Carto Case Study


    Carto is a CSS-like map layout language used by TileMill. The following code sets the color and size for the lines of the layer with the layer identifier and adds the glow property to it. This is what we get in the end.
    #layer {
    line-color: #C00;
    line-width: 1;
    }

    #layer::glow {
    line-color: #0AF;
    line-opacity: 0.5;
    line-width: 4;
    }


    image


    Total


    The topic came out voluminous, but I still have something to tell. If you are interested in this article, then I can continue and consider TileMill in more detail. In addition, there is another product that is used in conjunction with TileMill - this is TileStream. It makes sense to consider it too. Thanks for attention.

    useful links

    1. Official site
    2. Source
    3. Mapbox
    4. Development team
    5. GIS Lab - Russian GIS Community
    6. Cosmos
    7. Mapnik
    8. Feature Overview (video)
    9. MBTiles
    10. Carto


    PS: You can find support on the IRC channel #mapbox on the Freenode network.

    PPS: Unfortunately, I did not find a related blog, so I posted it in open source. As far as I remember, a couple of times on Habré the topic of creating a blog dedicated to GIS was raised. Judging by the survey , this is interesting to readers. Maybe, after this topic, UFOs will be interested in GIS?

    UPDATE : continued here .

    Also popular now: