Polygon Files for Osmosis
The polygon files that Osmosis uses for clipping to an area have the following format:
name polygon-number lon lat lon lat ... END name polygon-number lon lat lon lat ... END ... END
The first line contains the (arbitrary) name of the polygon file, the following line left-aligned a number and then one coordinate pair per line. A polygon is closed by END (left-aligned); more polygones can follow. At the end of the file there is an additional END.
If the polygon number starts with an exclamation mark, the following lines describe a "hole" in the polygon.
Example polygon for Great Britain
A further example is also on the
OpenStreetMap-Wiki.
The Digital Chart of the World-Server of Penn State University offers polygon files in this format for all countries.
If you want to edit such a polygon file, you can use the JOSM editor taking a small detour: Convert the polygon file with the helper script poly2osm.pl into an OSM file, edit the file with JOSM, save the file, and use osm2poly.pl to convert it back. (Never upload the converted polygon files to the OSM server!)