User:Ohr/Australian national border

From OpenStreetMap Wiki
Jump to navigation Jump to search

The previous Australian national border has been removed by the redaction process.

Background

The page boundary=maritime gives the general background on maritime boundaries in OSM. For a more specific description Geoscience Australia has a page Maritime Boundary Definitions. The legal definition can be found in Seas and Submerged Lands (Territorial Sea Baseline) Proclamation 2006.

Process

The process is based on known segements of the baseline and the coastline.

Baseline

Basically the baseline follows the low water mark but runs straight across bays. Also there are some straight segments defined in the proclamation linked above which for example directly run from the mainland to islands. These points were taken from the proclamation, converted into a shapefile using a python script, and then converted into an osm-file using Ogr2osm. This processing also took care of the necessary change of the coordinate reference system.

Coastline

The coastline is taken from the Australia extract at Geofabrik. The extraction is done using Osmosis and Osmembrane, using the following arguments

osmosis --read-pbf file=Australien/australia.osm.pbf \
        --way-key-value keyValueList=natural.coastline,natural.reef \
        --tag-filter reject-relations --used-node --write-xml file=Coastline.osm 

This extracts both natural=coastline and natural=reef. The reef data contains some larger polygon around the Great Barrier Reef, this was manually deleted in JOSM. Using the reef data causes some uncertainty as it is unknown whether the mapped reefs are relevant or not, i.e. if they are always below the water level or show out at low tide.

Computation of the territorial waters in QGIS

The computation of the 12nm limit for the territorial waters has been done in QGIS using the following process:

  • Load both the baseline segements and the coastline/reef data into QGIS using Load OSM from file
  • Convert the OSM layers for lines and polygons into shapefiles by using Layer->Save As...
    • Project to a more coordinate reference system (CRS) suitable for the buffer computation
    • Use Selected CRS and browse for GDA94 / Geoscience Australia Lambert
  • Create a new project and re-load the shapefiles just created using Layer->Add Vector Layer...
  • To speed up the later processing simplify the coastline data using Vector->Geometry Tools->Simplify geometries
    • I have used a tolerance of 10 meters
  • Generate the offset for each layer using Vector->Geoprocessing Tools->Buffer(s)
    • Buffer distance has to be entered in layer units layer. For the projection given above the units are meters and the distance of 12 nautical miles convert to 22224 meters.
    • Check Dissolve buffer results
    • For more detailled results set Segments to approximate to 9
  • Use the Ringer-Plugin to get a large, single polygon for the mainland
    • As we used a line and not a polygon for the coastline the result is a kind of band or ring around the continent.
    • To install the plugin from Plugins->Fetch Python Plugins... you may have to add the QGIS Contributed Repository on the Repositories tab and modify the settings on the Options tab to show experimental plugins.
    • Once the plugin is installed, first enable editing via Layer->Toggle Editing then run it from Plugins->Ringer->Ringer.
    • To end editing use Layer->Toggle Editing again and select save when prompted
  • Merge the individual polygons by applying Vector->Geoprocessing Tools->Dissolve
    • For Dissolve field select --- Dissolve all --- from the drop-down list
  • Combine the different layers by repeatedly using Vector->Geoprocessing Tools->Union
  • After combining two layers merge the individual polygons by applying Vector->Geoprocessing Tools->Dissolve
  • As there are some inner holes re-apply Plugins->Ringer->Ringer.
  • Once again combine the individual polygons by applying Vector->Geoprocessing Tools->Dissolve
  • Finally convert the layer from polygons to lines using Vector->Geometry Tools->Polygons to lines
    • Otherwise the osm-file created later will contain a multipolygon-relation for the polygon.

Convert to OSM

The shapefile generated with the process above can now be converted into a osm-file using Ogr2osm. To automatically set the tags use this as a translation file:

def filterTags(attrs):
	if not attrs: return
	
	tags = {}

	# Add attribution and source_ref tags
	tags.update({'boundary':u'administrative'})
	tags.update({'border_type':u'territorial'})
	tags.update({'admin_level':u'2'})
	tags.update({'maritime':u'yes'})
	tags.update({'note':u'generated from coastline+baseline segments'})

	return tags
	#sys.exit()

The resulting file can be loaded into JOSM. There it is probably a good idea to apply Simply Way to reduce the number of points.

Upload

Up to now nothing has been uploaded. The files generated are available for preview. Proposed is to upload the following two files:

Before uploading the boundary must be split into smaller segments, at least at the state borders.

Possible Improvements

Baseline

To improve the accuracy the baseline could be mapped as a way tagged with boundary=maritime and border_type=baseline. If that's present it can also be filtered out from the planet extract and fed into the process.

Due to the buffering and dissovling the baseline segments and coastline do not have to be connected. This makes it easier to add individual segments of the baseline, for example to close bays or take shallow beaches into accoung.

Reefs

Mapping more reefs that fall dry at low tide would also help. Obviously this is not really easy to tell from satellite imagery.

Alternative Process

There is an alternative process using a program called sweep-brim originally created by Roland Olbricht. This replaces all processing in QGIS and the computations is much faster. On the downside it requires a closed line as an input, so baseline segments and coastline would have to be joined manually somehow.