Skip to main content Link Search Menu Expand Document (external link)

gol map

Displays query results on a Leaflet map in a web browser.

Usage:

gol map <gol-file> <query> [<options>] 

The query must be written in GOQL, the Geo-Object Query Language. GOQL is similar to MapCSS, which is used by Mapnik and Overpass to select OSM objects.

The basemap and the click/hover behavior of the displayed features can be customized using various options.

For example:

gol map france na[tourism=museum] -a paris.wkt -t {name} -l {website}

queries france.gol and displays all museums in the Paris area (defined in paris.wkt). Their names are shown as tooltips. Clicking on a feature will open the museum’s website.

Multiple sets of features can be displayed on the same map. In this case, the query for each subset is prefixed by a color:

gol map berlin red: na[amenity=fire_station] yellow: n[emergency=fire_hydrant]

displays all fire stations in red, and hydrants in yellow. The color can be any predefined Web color, or a custom color in the form #RRBBGG (e.g. #00f0e0 for bright turquoise).

Options

-a, --area <COORDS> | <FILE>

Defines the (multi)polygon area to which the command should be applied. The following coordinate formats are supported:

  • GeoJSON

  • WKT

  • Raw coordinates in the form lon_0, lat_0, ... , lon_n, lat_n. To specify multiple polygons, or a polygon with one or more “holes,” place each ring in parentheses. Rings do not need to be closed.

You can specify coordinate values directly, or via a file.

-b, --bbox <W>,<S>,<E>,<N>

Defines the rectangular area (bounding box) to which the command should be applied. Coordinates are specified in WGS-84 (degrees longitude and latitude) and take the form <west>,<south>,<east>,<north>. Coordinates must not be separated by spaces (otherwise, they would be interpreted as separate arguments).

As an alternative, this option accepts a tile descriptor in the form z/x/y.

-m, --map <URL>

The URL of the tileserver which hosts the basemap.

-A, --attribution <TEXT>

The attribution text to display at the bottom of the map. Can be plain text or HTML, and must be enclosed in double quotes if it contains spaces, pspecial characters or HTML tags.

-t, --tooltip [ <TEXT> ]

Text to display when user hovers over a feature. <TEXT> may be HTML and typically includes template parameters. If <TEXT> is omitted, the tooltip displays the feature’s tags (Use option --keys to control which tags will be included).

-p, --popup [ <TEXT> ]

Text to display in a popup when user clicks on a feature. <TEXT> may be HTML and typically includes template parameters. If <TEXT> is omitted, the popup displays the feature’s tags (Use option --keys to control which tags will be included). In that case, you can use --link to customize the popup’s header link, and --edit to display an EDIT button.

Navigates to the given URL (may be a template) when user clicks on a feature. If <URL> is omitted, it defaults to https://www.openstreetmap.org/{type}/{id}.

If option --popup is specified, this option defines the page that will be opened when the user click’s on the popup’s header.

If option --edit is specified, but not --popup, --link is ignored.

-e, --edit [ <URL> ]

Navigates to the given URL (may be a template) when user clicks the EDIT button in a feature’s popup. If --popup is not specified, --edit takes the place of --link. If <URL> is omitted, it defaults to https://www.openstreetmap.org/edit?{type}={id}.