Language: RU EN
Main page...

Mapsoft2 source code library

Mapsoft2 code is organized as a set of separate "modules". Each module can contain its own documentation, tests, programs, etc.. Some of these modules are stable and used in my other projects, others may be experimental, unstable, or even useless. Modules may depend on each other. Makefile-based building system allows to build programs and libraries which depend only on certain modules and to transfer modules between different projects.

Modules are located in https://github.com/slazav/mapsoft2-libs. They can be used as git submodule or copied into a project.

Use of git submodules is not supported by Altlinux building system (gear program). It wants to have all source code accessible from a certain git commit. This problem is solved by packing all modules in a separate tarball (see update_modules script) and keeping it in mapsoft2 repository. If you do not use gear for building the package, you can ignore this file.

Building system

The building system is based on GNU make. All modules are located in a single directory (usually modules). Programs, libraries and modules which are not intended to be used by other modules can be located anywhere. Each module has a Makefile there a few variables are set to declare module components and Makefile.inc from the modules directory is included. For building dependency tree a separate script is used: modules/get_deps. For correct dependency search including a header file file.h from a module name should be always written as #include "name/file.h". Including local header file should be written as #include "file.h".

In Makefile of a module following variables can be defined:

Projects which use mapsoft2-libs

as git submodule:

copy of some modules:

Modules

stable cache Cache of arbitrary objects with automatic cleaning (based on object number or their size).
unstable cairo Wrapper for libcairo.
stable conv Coordinate conversions for geometric objects.
unstable downloader A multy-thread download manager.
stable err Simple class for throwing errors with human-readable descriptions. Used in many of my projects.
stable fig Reading and writing of FIG files. Fig is an old vector graphics format which I also use for drawing maps.
stable fig_geo Extension for FIG format for keeping georeference and geodata.
stable fig_opt Extension for FIG format for keeping data in object comments.
stable filename Functions for working with filenames.
stable geo_data Classes for geodata handling. Functions for reading and writing geodata (GPX, KML, KMZ, GeoJson, OziExplorer formats). Great-circle distance (Haversine formula). Geo-conversions (libproj wrapper).
https://github.com/slazav/mapsoft2-libs/blob/master/geo_data/Formats.md.
stable geo_mkref Making map references.
stable geo_nom Functions for working with Soviet nomenclature map names.
unstable geo_render Rendering geodata, map grids, raster maps...
stable geo_tiles Functions for working with TMS/Google tiles.
stable geohash Geohash library and simple data storage with spatial indexing
stable geom Geometrical forms: Point, Line, Multiline, and Rect classes. Many useful functions for working with them.
stable getopt getopt wrapper for building complicated command-line interfaces.
stable iconv Character encoding converter, a wrapper for libiconv.
unstable image 2d array of data for raster images. Reading and writing raster images (PNG, TIFF, JPEG, GIF), color quantization and other operations.
https://github.com/slazav/mapsoft2-libs/blob/master/image/Readme.md
stable iofilter Filtering std::stream through external program.
stable jsonxx Simple C++ wrapper for libjansson library.
stable log A simple way of writing log messages to stdin or file.
unstable mapview Viewer for maps and geodata. For use in ms2view program.
stable mp Reading and writing of MP files. MP is a vector map format used for compiling Garmin GPS maps.
stable opt A map<string,string> container with functions for getting/putting values of arbitrary types. Used widely in mapsoft.
stable osmxml Reading OSM XML files.
stable rainbow Convert double values into RGB color gradients. Useful code which I use in many places.
stable read_words Read one line from the std::istream and extract words, separated by spaces. Comments, quoting, escape symbols are supported. Similar to reading shell argument list.
stable shape Reading and writing of Shape-files, wrapper for shapelib.
stable srtm Working with digital elevation models (hgt anf tiff formats).
stable time_fmt Functions for reading and writing time in different forms.
stable tmpdir Class for working with temporary directories and zip files. Create a temporary directory, fill it with files, zip everything, unzip files to directory etc. Directory and all files will be deleted in the destructor. Uses libzip library.
stable viewer GTK-based viewer for objects which can draw on a raster image. "Rubber lines" and "actions" for making interactive interfaces (for example, drawing and editing geometric forms). Examples can be found in viewer/examples folder.
stable vmap Reading and writing of VMAP, old mapsoft format for vector maps.
stable vmap2 VMAP2 vector maps, new format (text/database), all operations with this format.