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.
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:
as git submodule:
copy of some modules:
cache | Cache of arbitrary objects with automatic cleaning (based on object number or their size). |
cairo | Wrapper for libcairo. |
conv | Coordinate conversions for geometric objects. |
downloader | A multy-thread download manager. |
err | Simple class for throwing errors with human-readable descriptions. Used in many of my projects. |
fig | Reading and writing of FIG files. Fig is an old vector graphics format which I also use for drawing maps. |
fig_geo | Extension for FIG format for keeping georeference and geodata. |
fig_opt | Extension for FIG format for keeping data in object comments. |
filename | Functions for working with filenames. |
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. |
geo_mkref | Making map references. |
geo_nom | Functions for working with Soviet nomenclature map names. |
geo_render | Rendering geodata, map grids, raster maps... |
geo_tiles | Functions for working with TMS/Google tiles. |
geohash | Geohash library and simple data storage with spatial indexing |
geom | Geometrical forms: Point, Line, Multiline, and Rect classes. Many useful functions for working with them. |
getopt | getopt wrapper for building complicated command-line interfaces. |
iconv | Character encoding converter, a wrapper for libiconv. |
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 |
iofilter | Filtering std::stream through external program. |
jsonxx | Simple C++ wrapper for libjansson library. |
log | A simple way of writing log messages to stdin or file. |
mapview | Viewer for maps and geodata. For use in ms2view program. |
mp | Reading and writing of MP files. MP is a vector map format used for compiling Garmin GPS maps. |
opt | A map<string,string> container with functions for getting/putting values of arbitrary types. Used widely in mapsoft. |
osmxml | Reading OSM XML files. |
rainbow | Convert double values into RGB color gradients. Useful code which I use in many places. |
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. |
shape | Reading and writing of Shape-files, wrapper for shapelib. |
srtm | Working with digital elevation models (hgt anf tiff formats). |
time_fmt | Functions for reading and writing time in different forms. |
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. |
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. |
vmap | Reading and writing of VMAP, old mapsoft format for vector maps. |
vmap2 | VMAP2 vector maps, new format (text/database), all operations with this format. |