TileMill is a mapping tool that allows you to quickly and easily create and design 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. Make it all up with CSS like
Carto and export it to one of the formats (PNG, PDF or MBTiles).
')
Opportunities
- Access data from local sources or through Amazon S3
- Management of map layers (shape, rasters)
- Editing the style sheet directly in the browser or in an external editor (for example in vim)
- Previewing a map while editing a style sheet
- View a geospatial attribute table
- Export data to PNG, PDF and MBTiles.
For details, I invite under the cat.
System requirements
- Customer
- Checked: Chrome 6+, Firefox 3+, IE8 +
- Can work in Opera 11
- Server
- Checked: 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 source library for rendering raster maps from vector data. It was developed for the OpenStreetMap project by our compatriot Artyom Pavlenko, and today is used by many resources, among which it is worth noting the Russian
Space Photos . This library is also used by the OpenStreetMap and MapQuest projects 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 sub-pixel precision. 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
Little about cartography
For those familiar with GIS or cartography, I’ll immediately say that maps in TileMill are always projected into Web Mercator (EPSG: 900913). This projection is also used by Microsoft Bing Maps, Google Maps and ESRI ArcGIS Online.
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 in one record - the SRS string (SRS string). For example, the SRS line describing WGS84 looks like this:
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
In most cases, TileMill can detect SRS loaded shapefiles and other data sources. But sometimes you may need to specify the SRS yourself, in the case when TileMill cannot determine it on its own.
What are tiles?

A tile is a 256x256 pixel PNG / JPEG bitmap image.
TileMill supports different levels of presentation. The presentation level is the predefined map display scale. OpenStreetMap, Google Maps and other web-mapping services provide tiles of 256x256 pixels at the zero presentation level and double the dimensions at each subsequent level. For example: at the zero level of representation, the whole world is seen, at the sixth level - a country of medium size, on the eleventh - a megacity. At the sixteenth level, you can see the individual houses.
In addition, TileMill supports exporting maps to the MBTiles format. This format was designed specifically for storing maps and accessing them both online and offline.
Mbtiles
MBtiles is a specification for storing sliced tiles in SQLite DBMS with the ability to instantly return. Such a data format allows you to transfer thousands, hundreds of thousands and even millions of tiles in one file.
The MBTiles upload speed is higher than the upload speed of millions of individual tiles, when booting to USB, mobile devices, or transferring over the network. The difference in speed between accessing the database or file system when using MBTiles is insignificant.
Since MBTiles use embedded SQLite DBMS, they can be used without an Internet connection.
Tiles are stored as BLOB (Binary Large OBjects - the storage format of large volumes of binary data), therefore, can be used in most SQLite clients.
Install TileMill
The source code for TileMill is available on Github.
git://github.com/mapbox/tilemill.git
cd tilemill
./ndistro
Run
./tilemill.js
. Now we start the browser, by default TileMill should be available at
localhost:8889
localhost:8889
.
Interface overview
Following the link
localhost:8889
localhost:8889
set of pre-installed projects will be available to you. Selecting one of them will take you to the edit page.

- Toolbar
- Map
- List of layers
- Font selection and color palette
- Code editor

Toolbar
- Settings
- Project name
- Save project
- Export
- Project Settings
- Close project

Card interface
- Map
- Scale
- Expand full screen

List of layers
- Add layer
- Reorder layers
- Layer geometry icon
- Identifiers and Classes
- View attribute table layer
- Edit layer
- Delete layer

View attribute table

Style editor
- Active tab
- Delete style
- Inactive tabs
- Create New Style
- MSS syntax help
- Line numbers
- Text area
Carto example
Carto is a CSS-like map design language used in TileMill. The following code sets the color and dimensions for the lines of the layer with the layer identifier and adds the glow property to it.
#layer {
line-color: #C00;
line-width: 1;
}
#layer::glow {
line-color: #0AF;
line-opacity: 0.5;
line-width: 4;
}

That's what we get in the end.
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 review 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 him too. Thanks for attention.
useful links
- Official site
- Source
- Mapbox
- Development team
- GIS Lab - Russian GIS Community
- Space images
- Mapnik
- Feature Overview (video)
- Mbtiles
- Carto
PS: You can find support on the IRC channel #mapbox on the Freenode network.
PPS: Unfortunately, I did not find a blog close in subject, so I posted it in open source. As I recall, a couple of times on Habré was raised the topic of creating a blog dedicated to GIS. Judging by the
survey , it is interesting to readers. Maybe after this topic, the UFO will be interested in GIS?
UPDATE : continued
here .