Class OsmSearchEngine

This class search the osm data

See theOsmSearchEngine for the one and only one instance of this class

Source : file core/osmSearch/OsmSearchEngine.js at line 44

Constructor

new OsmSearchEngine ( )

The constructor

Source : file core/osmSearch/OsmSearchEngine.js at line 258

Public getters and setters

readonly get previousSearchBounds : LeafletObject

A leaflet LatLngBounds object with the previous search limits

Source : file core/osmSearch/OsmSearchEngine.js at line 316

readonly get searchBounds : LeafletObject

A leaflet LatLngBounds object with the current search limits

Source : file core/osmSearch/OsmSearchEngine.js at line 309

Public methods

async search ( )

Start a search into osm for the items selected in the dictionary

Source : file core/osmSearch/OsmSearchEngine.js at line 269

Private properties

#filterItems : Array of DictionaryItem

A list of DictionaryItem objects used to filter the results received from Osm

Source : file core/osmSearch/OsmSearchEngine.js at line 58

#previousSearchBounds : LeafletObject

A leaflet LatLngBounds object with the previous search limits

Source : file core/osmSearch/OsmSearchEngine.js at line 65

#searchStarted : Boolean

A flag to avoid to start a new search when a search is already ongoing

Source : file core/osmSearch/OsmSearchEngine.js at line 51

Private getters and setters

readonly static get #SEARCH_DIMENSION : Number

A constant with the half dimension in meter of the search area

Source : file core/osmSearch/OsmSearchEngine.js at line 73

Private methods

#addPointOfInterest ( osmElement, pointsOfInterest )

Filter the osmElement with the list of selected DictionaryItems and add the osmElement to the map of pointsOfInterest if the osmElement pass the filter. Add also a description, a latitude and longitude to the osmElement

Source : file core/osmSearch/OsmSearchEngine.js at line 105

Parameters

Name Type Description
osmElement OsmElement

The object to analyse

pointsOfInterest Map

A map with all the retained osmElements

#computeSearchBounds ( )

Compute the search bounds

Source : file core/osmSearch/OsmSearchEngine.js at line 235

#filterOsmElement ( osmElement, filterTags )

Compare the tags of the osmElement with the tags of the filterTags

Source : file core/osmSearch/OsmSearchEngine.js at line 82

Parameters

Name Type Description
osmElement OsmElement

The osmElement to compare

filterTags Array of Object

The filter tags to use Seee DictionaryItem.filterTagsArray

Returns

True when all the tags present in the filterTags are present in the osmElement with the same value
Type : Boolean

#getSearchQueries ( )

Build an array of queries for calls to OSM.

Source : file core/osmSearch/OsmSearchEngine.js at line 125

Returns

An array of string to use with OverpassAPIDataLoader
Type : Array of String

#searchFilterItems ( item )

Search all selected items on the tree dictionary and for each selected item, add it to a list of selected items and add the first tag to the root tags map.

Source : file core/osmSearch/OsmSearchEngine.js at line 224

Parameters

Name Type Description
item DictionaryItem

The item from witch the search start. Recursive function. The first call start with this.#dictionary