olammi.iki.fi/sw
Fetch_map Usage

Usage

                  python fetch_map.py --help
                  python fetch_map.py --info
                  python fetch_map.py [options] <map_name> <coord_N> <coord_E> <size_x> <size_y> [scale]
                  python fetch_map.py --corners [options] <map_name> <coord_bl_N> <coord_bl_E> <coord_tr_N> <coord_tr_E> [scale]

Options

                    --help    - Prints out a help and exits.

                    --info    - Prints out a list of supported service names,
                                map scales and supported calibration file types. 
                                Exits without fetching any maps.   

                    -s service_code
                    --service service_code - Use the given service to retrieve
                                the maps. Default is "kkp" = Kansalaisen 
                                Karttapaikka. Use option --info to see the list 
                                of supported services.

                    --cachedonly - Uses only the cached images. Will not contact
                                the actual service for new map data. If the 
                                result map contains areas that are not found in 
                                the cache, those areas will appear yellow in the
                                result map.

                    --cache directory - Use cache directory given with this 
                                parameter. Default is "./map_cache/".

                    --palette - Convert the result image to palette mode
                                before saving. Default is RGB true color
                                mode when the result file format supports
                                it.

                    --corners - If given, the script expects 4 coordinate values 
                                (bottom left and top right corners of the map) 
                                instead of the map center coordinate and size. 

                    --force-coordinates - Unused since v3.0h

                    --starttime HHMM - Start time for the download. For example
                                option "--starttime 0200" will make the
                                script wait until clock is 02:00 at night
                                and then start the map download. By default
                                the script will start the download right away.
                                Using the cached map parts will not be delayed.

                    --save type - Save a calibration file of given type. By 
                                default the script will save the result map  
                                image and map calibration file for OziExplorer. 
                                Use option --info to see the list of supported 
                                calibration file types. Multiple options may be
                                given on same command line.

                   --overlap Nx Ny overlap_km - Save multiple overlapped map 
                               files from the configured area by paremeters. 
                               When using this option, fetch_Map will create 
                               multiple map images that overlap each other by 
                               configured distance <overlap_km>. The number of
                               images in horisontal and vertical directions 
                               are configured with parameters <Nx> and <Ny>. 
                               The map image location will be added to the map
                               and calibration file names.

                               Example:

                                 python fetch_map.py --overlap 4 3 0.5 TestMap
                                 6815986 2480962 6.0 5.0 1:16000

                               The above command would generate 12 separate map
                               files TestMap_1_1.png, TestMap_1_2.png, ..., 
                               TestMap_4_3.png. The generated map files next to
                               other image will overlap each other by 
                               0.5 kilometers.

Parameters

                    map_name  - Name of the map, result map will be outputted 
                                to file <map_name>. If parameter contains
                                no file extension, '.png' will be appended
                                and PNG-picture format will be used by
                                default.
                    coord_N     - Northing coordinate of the middle point of  
                                the result map
                    coord_E     - Easting coordinate of the middle point of  
                                the result map
                    size_x    - width of the result map in kilometers 
                                (approx), example: 10.2
                    size_y    - height of the result map in kilometers
                                (approx), example: 8.5
                    coord_bl_N - Northing coordinate of the bottom left corner 
                                of the result map (see --corners option).
                    coord_bl_E - Easting coordinate of the bottom left corner 
                                of the result map (see --corners option).
                    coord_tr_N - Northing coordinate of the top right corner
                                of the result map (see --corners option).
                    coord_tr_E - Easting coordinate of the top right corner 
                                of the result map (see --corners option).
                    scale     - (optional parameter) scale of the result map. 
                                 Use option --info to retrieve supported scales 
                                 for services.

Coordinates

                    Coordinates can be given in KKJ, YKJ, ETRS-TM35FIN and 
                    WGS84 formats. WGS84 coordinates are lat and lon values 
                    for northing and easting. Possible formats for WGS84 
                    coordinate values are according to following examples:
 
                       61.451378 (for 61.451378 degrees)
                       61,27.083 (for 61 degrees, 27.083 minutes)
                       61,27,4.96 (for 61 degrees, 27 minutes, 4.96 seconds)

                    Grid coordinate values with easting less than 1000000
                    are considered as ETRS-TM35FIN coordinates and with
                    with easting greater than or equal 1000000 are considered
                    KKJ or YKJ.

                    ATTENTION! Both lat and lon coordinates of a single map  
                    point must always be given in the same coordinate system 
                    (e.g. WGS84 or KKJ).  

Example

                  Example command will fetch 6x5 kilometer map in 1:40000
                  scale from Pirkkala area.

                    python fetch_map.py Pirkkala 6815986 2480962 6.0 5.0 1:40000

                  the same map using WGS84 coordinate system

                    python fetch_map.py Pirkkala 61,27,4.96 23.639721 
                    6.0 5.0 1:40000

                  again the same map using ETRS-TM35FIN coordinate system

                    python fetch_map.py Pirkkala 6817681 320897 6.0 5.0 1:40000

                  same area but the map service is Retkikartta.fi and
                  scale 1:25000

                    python fetch_map.py -s rka Pirkkala 61,27,4.96 
                    23.639721 6.0 5.0 1:25000

Map service related help: Kansalaisen Karttapaikka (kkp)

Module options:      --orto    - Fetch airplane pictures from Karttapaikka
                                 (experimental, not fully tested.)
9.4.2009 taloLogger v1.0b home automation log application released