Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ private EmissionSourceFeature handleSourceMember(final FeatureMember member, fin
*/
public EmissionSource toEmissionSource(final T source, final Geometry geometry) throws AeriusException {
final EmissionSource returnSource = visitor.visit(source);

if (returnSource != null) {
fromGenericEmissionSource(source, returnSource, geometry);
conversionData.putAndTrack(source.getId());
}
return returnSource;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
package nl.overheid.aerius.gml.base;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import nl.overheid.aerius.gml.base.GMLLegacyCodeConverter.Conversion;
import nl.overheid.aerius.gml.base.GMLLegacyCodeConverter.GMLLegacyCodeType;
Expand Down Expand Up @@ -55,7 +53,6 @@ public class GMLConversionData {

private final List<AeriusException> errors;
private final List<AeriusException> warnings;
private final Set<String> idMap = new HashSet<>();
private final GMLLegacyCodeConverter legacyCodeConverter;
private final int srid;
private final ReceptorUtil receptorUtil;
Expand Down Expand Up @@ -113,18 +110,6 @@ public CharacteristicsType getCharacteristicsType() {
return characteristicsSupplier.getCharacteristicsType();
}

/**
* Checks if given id is unique and if not adds it to the list of exceptions.
* @param gmlId Feature Member String id
*/
public void putAndTrack(final String gmlId) {
if (idMap.contains(gmlId)) {
errors.add(new AeriusException(ImaerExceptionReason.GML_ID_NOT_UNIQUE, gmlId, gmlId));
} else {
idMap.add(gmlId);
}
}

/**
* @param codeType The code type to convert.
* @param oldCode The old code to try and convert. Will be returned if not converted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import nl.overheid.aerius.validation.DefinitionsValidator;
import nl.overheid.aerius.validation.EmissionSourceLimitValidator;
import nl.overheid.aerius.validation.EmissionSourceValidator;
import nl.overheid.aerius.validation.SituationCohesionValidator;

/**
* Importer for IMAER GML files.
Expand Down Expand Up @@ -162,6 +163,7 @@ public void importStream(final InputStream inputStream, final Set<ImportOption>
addDefinitions(reader, importOptions, result, situation);
setCrs(result);

SituationCohesionValidator.checkCohesion(situation, result.getExceptions(), result.getWarnings());
addCalculationSetOptions(theme, reader, result);
LOGGER.info("GML imported with GML version: {}", version);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,6 @@ public enum ImaerExceptionReason implements Reason {
*/
GML_INVALID_ROAD_CATEGORY_MATCH(5219),

/**
* The source id string contains a number that already is used on another id, while the string id itself might be unique.
*
* @param 0 violating id.
* @param 1 id that is violated.
*/
GML_ID_NOT_UNIQUE(5220),
/**
* GML contains an unknown combination of road characteristics that don't match a known vehicle category.
*
Expand Down
Loading