Search in sources :

Example 1 with LinkType

use of org.w3._2005.atom.LinkType in project geotoolkit by Geomatys.

the class OwcXmlIO method write.

private static FeedType write(final MapLayers context) throws FactoryException {
    final FeedType feed = ATOM_FACTORY.createFeedType();
    final LinkType link = ATOM_FACTORY.createLinkType();
    link.setRel("profile");
    link.setHref("http://www.opengis.net/spec/owc-atom/1.0/req/core");
    link.setTitle(context.getIdentifier() == null ? "" : context.getIdentifier());
    feed.getAuthorOrCategoryOrContributor().add(ATOM_FACTORY.createFeedTypeLink(link));
    final TextType title = ATOM_FACTORY.createTextType();
    title.getContent().add(context.getIdentifier() == null ? "" : context.getIdentifier());
    feed.getAuthorOrCategoryOrContributor().add(ATOM_FACTORY.createFeedTypeTitle(title));
    final Envelope aoi = context.getAreaOfInterest();
    if (aoi != null) {
        final String ogc = IdentifiedObjects.lookupURN(aoi.getCoordinateReferenceSystem(), null);
        final WhereType where = GEORSS_FACTORY.createWhereType();
        final DirectPositionType lowerCorner = new DirectPositionType(aoi.getLowerCorner());
        final DirectPositionType upperCorner = new DirectPositionType(aoi.getUpperCorner());
        final EnvelopeType envelopeType = new EnvelopeType(null, lowerCorner, upperCorner, ogc);
        envelopeType.setSrsDimension(2);
        where.setEnvelope(envelopeType);
        feed.getAuthorOrCategoryOrContributor().add(GEORSS_FACTORY.createWhere(where));
    }
    for (final MapItem mapItem : context.getComponents()) {
        toEntry(null, mapItem, feed.getAuthorOrCategoryOrContributor());
    }
    return feed;
}
Also used : WhereType(org.geotoolkit.georss.xml.v100.WhereType) FeedType(org.w3._2005.atom.FeedType) EnvelopeType(org.geotoolkit.gml.xml.v311.EnvelopeType) DirectPositionType(org.geotoolkit.gml.xml.v311.DirectPositionType) LinkType(org.w3._2005.atom.LinkType) Envelope(org.opengis.geometry.Envelope) MapItem(org.apache.sis.portrayal.MapItem) TextType(org.w3._2005.atom.TextType)

Aggregations

MapItem (org.apache.sis.portrayal.MapItem)1 WhereType (org.geotoolkit.georss.xml.v100.WhereType)1 DirectPositionType (org.geotoolkit.gml.xml.v311.DirectPositionType)1 EnvelopeType (org.geotoolkit.gml.xml.v311.EnvelopeType)1 Envelope (org.opengis.geometry.Envelope)1 FeedType (org.w3._2005.atom.FeedType)1 LinkType (org.w3._2005.atom.LinkType)1 TextType (org.w3._2005.atom.TextType)1