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:GeoObjectCollectionelement 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:GeoObjectCollectionelement, which is located in the ymaps:ymapsroot element.

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

The structure of a ymaps:GeoObjectelement 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 element will look rather predictable.