Geographical objects and collections

To describe geographical objects in YMapsML, we use the ymaps:GeoObject element. A population of geographical objects can be put together in a collection, using the ymaps:GeoObjectCollection element to describe it.

To provide compatibility with the GML standard, each of these elements is wrapped in one of the container elements — gml:featureMember or gml:featureMembers. The only exception is the ymaps:GeoObjectCollection element, which is located in the ymaps:ymaps root element.

The difference between these containers consists of the following. The gml:featureMember element can contain either a single object description (ymaps:GeoObject), or a single collection description (ymaps:GeoObjectCollection). The gml:featureMembers element can contain any number of descriptions of geographical objects or collections.

The structure of a ymaps:GeoObject element containing a description of a geographical object appears as follows.

Collections can be used to group together both geographical objects and collections themselves. Considering the information above that ymaps:GeoObject and ymaps:GeoObjectCollection elements are enclosed in gml:featureMember and gml:featureMembers containers, the structure of the ymaps:GeoObjectCollection elements will look rather predictable.