All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.syndication.feed.module.georss.SimpleParser Maven / Gradle / Ivy

/*
 * Copyright 2006 Marc Wick, geonames.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package com.sun.syndication.feed.module.georss;

import org.jdom.Element;

import com.sun.syndication.feed.module.Module;
import com.sun.syndication.feed.module.georss.GMLParser;
import com.sun.syndication.io.ModuleParser;
import com.sun.syndication.feed.module.georss.geometries.*;

/**
 * SimpleParser is a parser for the GeoRSS Simple format.
 *
 * @author Marc Wick
 * @version $Id: SimpleParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
 *
 */
public class SimpleParser implements ModuleParser {
    
    /*
     * (non-Javadoc)
     *
     * @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
     */
    public String getNamespaceUri() {
        return GeoRSSModule.GEORSS_GEORSS_URI;
    }
    
    private static PositionList parsePosList(Element element) {
        String coordinates = element.getText();
        String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
        PositionList posList = new PositionList();
        for (int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy