Finding locations on a map

AnyLogic provides a search menu to help you find locations on a GIS map. When you enter a search query in the search box, AnyLogic will find places that match the query and create a list of search results. Also, AnyLogic will mark all search results on the map with a specified markup object, such as a GIS Point or a GIS Region.

Search results are temporary; every time you run a new search they update. But sometimes it might be useful to keep search results so that you can use them again in your model without going online to run a new search. AnyLogic helps you keep a map object that you found by saving it as a GIS Point or a GIS Region.

A search is first performed in the visible area of a map; then, if no results are found there, AnyLogic searches throughout the whole map.

To find an object on a map

  1. Double-click the GIS map to enter its edit mode.
  2. You will see the search box to enter your query.
  3. To enter a query, click in the search box. You will then see additional search parameters for you to select the kind of object you are looking for: a Point (such as a city, a shop, or a street), or a Region (region, district, country). Select the appropriate parameter, and type your query. 

  4. To start searching for locations on the map that match your query, click the Search button  or press Enter.
  5. Point objects found on the map are marked with a GIS Point markup object, and areas are marked with a GIS Region object. If you select a search result, you will see its full address in the Title of its Properties view.

  6. AnyLogic will display all locations it found as temporary elements in the GIS Search Results view.

  7. To make the location of a GIS Search Results element appear in the map’s center, double-click on it.
  8. Using the context menu that opens when you right-click an element listed in the GIS Search Results, you can place an agent at its location.
  9. If you clear the search box or type another query, search results from the prior query are discarded.

To keep search results in the model

  1. Search for a location on the map, and then go to the GIS Search Results view.
  2. Select the location that you need to keep in the model for further use.
  3. Right-click this element and select the option Convert To GIS Points/Regions, or click the button  in the view toolbar. This location will be saved in the model as a GIS Point or a GIS Region, depending on the type of object you are saving. 

  4. The converted elements are displayed with a color that is different from the color for elements that are still temporary, both in the search results list and on the map.

  5. Now this object will be cached and saved with the other model files. You can find converted elements in the model tree under Agent type > Presentation > Map name

  6. If you go to a converted element’s Properties view, you will see its full address in the Title field:

  7. A converted element is pinned to a particular location on the map. If you need to move it to another location, in its Properties view, deselect the Lock the location option.

To find and convert a region or a multiregion

  1. The instructions listed above also apply to searching for a region and converting the search results into a GIS Region object in order to keep it in the model. In the figure below you can see that the top search result, which is a region, has been converted:

     

  2. Sometimes when you search for a region, such as a country, the search results found on the map may not be one single region, but a “multiregion”, which is a special GIS markup object.

  3. A GIS Multiregion  is a group of regions united under one Title for your convenience. You can convert a multiregion search result just like a GIS Region search result. 
  4. AnyLogic will create several converted regions on the map as well as a multiregion that contains all the regions. You can find these new converted objects in the model tree, under the map:

  5. In the model tree you can manage the regions. For example, you might remove regions that you do not need.
  6. Whenever you need to edit all of these regions at once, navigate to the GIS multiregion properties and click the button Select regions, and this multiregion will turn into the multiple selection of these regions.

To clear the search results

  1. Navigate to the GIS Search Results view.
  2. To remove one search result element, right-click it in the list, and choose Remove elements from the context menu.
  3. To remove all elements, right-click any element in the list, and choose Remove all elements from the menu.
  4. Alternatively, click the button  to remove one selected element, or
  5. Click the button   to clear all search results.

  6. All temporary GIS markup elements on the map will also be cleared.

Related topics

 GIS tutorial

GIS markup objects

Navigating a GIS map