Skip to content

thaddeus002/cartograph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cartograph

A library, and command line tools, to play with geographic data.

This project is still experimental.

Dependencies

This project use

  • yder as logger module.
  • yImage for drawing and image superposition.

Theses dependencies are include in the projet as git submodules. So, use the following command to clone the repository, and have all the needed code :

$ git clone --recurse-submodules https://github.com/thaddeus002/cartograph.git

Examples

BLN data representation

BLN file format is a simple text format to represent curves (countries' boundaries, coast, roads, rivers, ...) as a succesion of points. Drawing lines between the points make the curve's trace. One or more curves can be present in one file. A curve is one header on a file line containing the number (n) of points, and optionnaly the name of the curve separate from n by a comma. The header is followed by n lines containing the points coordinates separated by commas. The coordinates may be (X,Y) for Lambert projection, or more often (lon, lat).

For example, the file world.bln contains world's countries ' boundaries with a pretty good resolution.

The program trace can make a map from bln data. It's built by the command :

$ make -C src trace

Then we can use it to create a graphic representation of the data of file world.bln, and also plot some cities from file cities.csv.

world

This map was made by the command :

$ src/trace data/world.bln data/cities.csv

The first argument is the filename for bln data and the second, which is optional, is the name of a csv file containing points to plot on the map.

Use bln for image background (program draw_background.c)

For this example, data layer is provide as a png image by a WMS server. The temperatures are placed on an image with a black background.

To localize the data we need a background image with at least countries boundaries. We have this boundaries in file europe.bln.

data source : Météo France

geoservices' documentation (in french)

The raw image is :

raw_fr

The program output shows the same data with a better background :

bln_fr

About

C library and command line tools to play with geographic data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published