What OSMDCON does
The software was developed in response to the need for a program that takes freely available water depth data and overlays that data in the form of text and contour lines on an OpenStreetMap map. It takes the 256X256 pixel map image "tiles" from OpenStreetMap, and similar for Seamarks from OpenSeaMap, to produce a chart with a user-defined amount of depth detail. (Seamarks are features like buoys, beacons, anchorages etc.) The user does not need to be familiar with the quirks of the OSM system; just select a chart area on a world-wide GUI map, a few clicks and wait a few minutes.....
Getting Started
You will need a PC with a broadband connection running Windows XP or later, with at least 2GB of RAM. Faster performance is obtained if the machine has multiple processors, and a solid state disk drive. About 10 to 50GB of disk space is required for the software and, (the major part), the data; it depends on how large an area you need to work on. The system has been extensively tested on a dual 3.4Ghz processor with 4GB RAM and a 120GB SSDD, yielding elapsed times of around 3 minutes per run. A note about solid state disk drives; if you haven't got one - get one! They're about 40GBP on Ebay and currently represent the most cost-effective upgrade available. Anyway, onwards........
The software may be downloaded from https://sourceforge.net/projects/osmdcon/ .
Using "Administrator Rights" if applicable, install into C:/IMAGE_PROCESSING by specifying C:/ as the initial folder.
Navigate to "C:/IMAGE_PROCESSING/lib/setup/setup.tcl"
Edit with a Text Editor the file setup.tcl near the top as follows:
# new user? please change this..........
array set env [ list SSDD H: ] ; # or delete this line if no SSDD
# end SSDD
Change the drive letter on the SSDD line to the drive letter of your Solid State Disk Drive, e.g. E: , or delete the line completely if no drive present.
Now download Tcl/Tk from the Activestate web site. Be sure to choose the x86 version of release 8.6.4.1
Start the resultant .exe file and install into the folder C:/Tcl (the default).
Download tcllib-x.xx.zip from the Sourceforge site. Unzip into a temporary folder and run installer.tcl in that folder by simply clicking on the file, as you would for a normal .exe or .bat file. Apart from loading some required extensions to Tcl, this proves the successful installation of Tcl/Tk.
Now run AAA_setup.tcl in the C:/IMAGE_PROCESSING folder. This sets an environment variable for Tcl/Tk, and downloads more required Tcl "extensions".
For further proof, start AAA_OSM_MAP_DISPLAY.tcl in C:/IMAGE_PROCESSING. A map should appear built dynamically from tiles at the OpenStreetMap site (Internet required) , with landscape and portrait rectangles following the mouse. Good.
Navigate to C:/IMAGE_PROCESSING/lib/IMAGEMAGICK and run ImageMagick-6.9.6-3-Q16-HDRI-x86-dll.exe . This will install ImageMagick on your system. Allow it to update the system path. Please note that OSMDCON will only work with this version.
We then need to download an amount of data from various sources, as follows:
a) EMODnet depth data from the EMODnet portal. Select a layer in the drop-down panel until "Download products" appears, then click on "Download products". You should see a gridded map of Europe. Click on the grid for your required area. A panel will pop up showing the cell name, e.g. B3, and a list of download types. Select "Download as EMO file". A download of file e.g. B3.emo.zip will commence. Repeat for multiple cells if needed. Not in Europe? See Processing later. The resolution of EMOD data is approximately 200 X 200 metres - better than the "30 arc seconds" of GEBCO.
b) Land Polygons from OpenStreetMap Data . Choose the file for "Large polygons are split", Shapefile, and WGS84.
c) Seamark Data from OpenStreetMap Data Extracts . E.g. great-britain-latest.osm.pbf and ireland-and-northern-ireland-latest.osm.pbf . Be sure to choose .osm.pbf files! If you're only interested in the UK and Ireland, you can skip this step.
Confirm that the following folders exist:
X:/CHART_DATA
X:/CHART_DATA/TILES
X:/CHART_DATA/PNGS
where X is either the SSDD letter or C if no SSDD, as applicable.
These were created by AAA_OSM_MAP_DISPLAY.tcl above. Unzip the downloaded data files in a) and b) into X:/CHART_DATA . Copy the file(s) in c) to the same folder.
Now we can create the SQLITE Database files needed by OSMDCON:
i) Depth Data
Edit with a text editor the file C:\IMAGE_PROCESSING\OSMDCON_bounds.inc . Consider the following at the top of the file, (it represents a "bounding box" of all the charts that we'll possibly need) ,
# ############################################
# the bounds of the Output ((-)ddd.ddddd format).......
set top_left_lon -11.0 ; # WEST
set top_left_lat +62.0 ; # NORTH
set bot_right_lon +12.0 ; # EAST
set bot_right_lat +44.0 ; # SOUTH
# end bounds
# ############################################
and change the values to form a rectangle encompassing your area. There is no need to be that accurate, in fact, over-estimate the coordinates by 0.25. The values as supplied represent the UK and Ireland, so you would need B2.emo and B3.emo from EMODnet. The larger the rectangle, the longer the ensuing processing will take; only define a bounding box for your needs!
Save the file and start C:\IMAGE_PROCESSING\AAA_depths_emo_to_DB.tcl . Select a file named Xn.emo, e.g. B3.emo , and answer Yes to "Initialise the DataBase". It will take a while..... When the total records stats are displayed on the console, type x to exit the program. Repeat the run for additional .emo files, but reply No to the initialisation of the database.
ii) Land Polygons
Start C:\IMAGE_PROCESSING\AAA_land_polygons_to_DB.tcl . It will ask for a .shp file. A .shp file is used in geographical information systems (GIS) software. shp is short for shape. Select the unzipped polygons .shp file in X:/CHART_DATA , typically land_polygons.shp . It will take a while..... When the total records stats are displayed on the console, type x to exit the program.
iii) Seamarks Data
One more to go........... Start C:\IMAGE_PROCESSING\AAA_OSM_PBF_to_SEAMARKS_DB.tcl . Run in a similar fashion to Depth Data, selecting file(s) from c) above, e.g. great-britain-latest.osm.pbf . If you skipped c) above, copy SEAMARKS.DB from folder C:\IMAGE_PROCESSING to X:/CHART_DATA .
Phew! About 2 hours (or less) will have elapsed - was it worth it? Well let's consider what we've downloaded and installed:
iv) A powerful high-level programming language in Tcl/Tk.
v) An extensive data set of depths, land polygons and seamarks.
vi) A comprehensive image manipulation tool - ImageMagick.
More than worth it...... You could even charge your mates a beer for producing charts for them!
Right, let's get into what we're here for - producing charts.
|