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, layers 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 "pti" = Paikkatietoikkuna. 
                               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.

                   --direction <d> - By default the given coordinate point in 
                               the command line is the center point of the 
                               result map. However with this parameter,
                               user can define, to which compass direction from the
                               given point the map is generated. Valid 
                               values for <d> are C (default), N, NE, E, SE, S, 
                               SW, W and NW.
                               For example "--direction SW" will result to a
                               map with lower right corner coordinate to be
                               the point given in the command line.

                   --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.

                   --layer <layername>[:<alpha%>] - Add a named transparent layer provided 
                               by the map service. Use --info to see available layer names.
                               If <alpha%> is given, it will override the module
                               default transparency for this layer. Value is 
                               an integer between 0-100, where 100 is fully
                               not transparent and 0 is fully transparent.
                               Example: --layer foobar:50

                   --nobg    - If given with layer option, will produce a map with no
                               background map and transparent background with the 
                               layers on top. 

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 (see also --direction -option)
                   coord_E     - Easting coordinate of the middle point of  
                               the result map (see also --direction -option)
                   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).  

Examples

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

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

                 the same map using WGS84 coordinate system

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

                 again the same map using ETRS-TM35FIN coordinate system

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

                 again the same map using ETRS-TM35FIN coordinate system,
                 using Paikkatietoikkuna map service, having terrain base map and
                 one additional layer

                   python fetch_map.py -s pti --layer tm35lehtijako --terrain 
                   Pirkkala 6817681 320897 6.0 5.0 1:32000

                 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: Paikkatietoikkuna (pti)

Module options:      --terrain   - Fetch terrain (maasto) maps instead of 
                                   service default base maps

                     --orto      - Fetch air pictures instead of 
                                   service default base maps

                     --hillshade - Fetch hillshade ("3D") pictures instead of 
                                   service default base maps

Map service related help: Retkikartta.fi (rka)

Module options:      --maastokartta - Use maastokartta as background map
                                      (default)

                     --ilmakuva     - Use aerial pictures as background map

                     --rinnevarjostus - Use hillshade ("3D") pictures as background map

                     --taustakartta - Use taustakartta material as background map

                     --selkokartta  - Use selkokartta material as background map
01.02.2024 taloLogger v1.8d released