Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed under the EUPL, Version 1.2 or – as soon they will be approved by
* the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package org.entur.netex.conversion.osm;
import net.opengis.gml._3.AbstractRingPropertyType;
import net.opengis.gml._3.DirectPositionListType;
import net.opengis.gml._3.LinearRingType;
import net.opengis.gml._3.PolygonType;
import org.openstreetmap.osm.Member;
import org.openstreetmap.osm.Node;
import org.openstreetmap.osm.Relation;
import org.openstreetmap.osm.Tag;
import org.openstreetmap.osm.Way;
import org.rutebanken.netex.model.AuthorityRefStructure;
import org.rutebanken.netex.model.FareZone;
import org.rutebanken.netex.model.FareZoneRefStructure;
import org.rutebanken.netex.model.FareZoneRefs_RelStructure;
import org.rutebanken.netex.model.GroupOfTariffZones;
import org.rutebanken.netex.model.KeyListStructure;
import org.rutebanken.netex.model.KeyValueStructure;
import org.rutebanken.netex.model.MultilingualString;
import org.rutebanken.netex.model.ObjectFactory;
import org.rutebanken.netex.model.OrganisationRefStructure;
import org.rutebanken.netex.model.PointRefStructure;
import org.rutebanken.netex.model.PointRefs_RelStructure;
import org.rutebanken.netex.model.PrivateCodeStructure;
import org.rutebanken.netex.model.PurposeOfGroupingRefStructure;
import org.rutebanken.netex.model.ScheduledStopPointRefStructure;
import org.rutebanken.netex.model.ScopingMethodEnumeration;
import org.rutebanken.netex.model.TariffZone;
import org.rutebanken.netex.model.TariffZoneRef;
import org.rutebanken.netex.model.TariffZoneRefs_RelStructure;
import org.rutebanken.netex.model.ValidBetween;
import org.rutebanken.netex.model.ZoneTopologyEnumeration;
import org.rutebanken.netex.model.Zone_VersionStructure;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.bind.JAXBElement;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Map osm Ways to Netex Zones
*
* @param
*/
public class OsmToNetexMapper {
/**
* The prefix (usually three letters) in IDs.
*/
public static final String CODESPACE = "codespace";
/**
* The objects name that will be retrieved from a tag with the same value.
*/
public static final String NAME = "name";
/**
* Reference, which is the postfix of the generated Netex ID
*/
public static final String REFERENCE = "reference"; //privatecode
public static final String ZONE_TYPE = "zone_type"; //scoping method
public static final String DEFAULT_VERSION = "1";
public static final String VALID_FROM = "valid_from";
public static final String FAREZONEID = "id";
public static final String AUTHORITYREF = "authorityRef";
public static final String MEMBERS = "members";
public static final String NEIGHBOURS = "neighbours";
public static final String PRIVATECODE = "privateCode";
public static final String SCOPINGMETHOD = "scopingMethod";
public static final String TARIFFZONETYPE ="tariffZone";
public static final String ZONETOPOLOGY ="zoneTopology";
public static final String TZMAPPING ="tzMapping";
/*
**
**
**
**
**
**
**
**
**
**
*/
private static final Logger logger = LoggerFactory.getLogger(OsmToNetexTransformer.class);
private static final net.opengis.gml._3.ObjectFactory openGisObjectFactory = new net.opengis.gml._3.ObjectFactory();
private final NetexHelper netexHelper;
public OsmToNetexMapper(NetexHelper netexHelper) {
this.netexHelper = netexHelper;
}
public List