Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MATSim CW20 #97

Merged
merged 53 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f16ab0a
combined distribution of tour start and duration
rakow May 8, 2024
ca38361
add routing test with multiple same options
paulheinr May 8, 2024
0177cbf
Merge pull request #3259 from matsim-org/add-routing-test
paulheinr May 8, 2024
9f92c11
build(deps): bump info.picocli:picocli from 4.7.5 to 4.7.6
dependabot[bot] May 8, 2024
e3fd2fc
Merge pull request #3260 from matsim-org/dependabot/maven/info.picocl…
michalmac May 8, 2024
4e03121
build(deps-dev): bump net.bytebuddy:byte-buddy from 1.14.14 to 1.14.15
dependabot[bot] May 8, 2024
208bc3a
Merge pull request #3261 from matsim-org/dependabot/maven/net.bytebud…
michalmac May 8, 2024
0f8e482
add javadoc comment to constructor of OTFVisLiveModule
kainagel May 9, 2024
0e36d76
Merge branch 'master' into otfvis-module-protection-hint
kainagel May 9, 2024
588741b
Merge pull request #3262 from matsim-org/otfvis-module-protection-hint
kainagel May 9, 2024
138f63a
factor out drt optimization constraint params from drt config group …
nkuehnel May 10, 2024
f2ef7a2
add python script to analysis kid data
rakow May 13, 2024
3777451
add new events for new times distribution
rewertvsp May 13, 2024
4aa48e2
add todo
rewertvsp May 13, 2024
032e9aa
Merge branch 'master' into ssct-durations
rewertvsp May 13, 2024
31c23c9
Merge pull request #3265 from matsim-org/ssct-durations
rewertvsp May 13, 2024
0c89132
change format of list creation
rewertvsp May 14, 2024
d7ad71d
make output files of the class configurable
rewertvsp May 14, 2024
e8458ed
Merge pull request #3268 from matsim-org/ssct-improvements-for-compil…
rewertvsp May 14, 2024
f623322
add trip filter for trip start OR end in shp area (#3269)
simei94 May 15, 2024
1a75b4d
read first 5 lines of csv to check delimiter (#3271)
simei94 May 15, 2024
a9cdc5b
inline abstract module attributes and get rid of them
paulheinr May 16, 2024
47369c7
Merge pull request #3273 from matsim-org/guice-clean-up
paulheinr May 16, 2024
48bda59
Allow for storing multiple DrtOptimizationConstraintsParams
marecabo May 16, 2024
543191c
recognize EPSG:4326 as equal to WGS84 when using special coordinate t…
rakow May 16, 2024
07ba389
Add test
marecabo May 17, 2024
e9e8ce0
update to geotools 31 (resolve transitive dependency conflicts) (#3272)
nkuehnel May 17, 2024
1f92c5d
build(deps): bump io.grpc:grpc-all from 1.63.0 to 1.64.0
dependabot[bot] May 17, 2024
067cb2f
Merge pull request #3274 from matsim-org/dependabot/maven/io.grpc-grp…
michalmac May 17, 2024
ffeb556
build(deps): bump org.mockito:mockito-core from 5.11.0 to 5.12.0
dependabot[bot] May 17, 2024
21a4ff0
Merge pull request #3267 from matsim-org/dependabot/maven/org.mockito…
michalmac May 17, 2024
7182f71
build(deps): bump org.mockito:mockito-junit-jupiter
dependabot[bot] May 17, 2024
618da2f
Merge pull request #3266 from matsim-org/dependabot/maven/org.mockito…
michalmac May 17, 2024
b5efabd
update gtfs2matsim in application contrib (#3278)
vsp-gleich May 17, 2024
24cbb34
build(deps): bump com.google.code.gson:gson from 2.10.1 to 2.11.0
dependabot[bot] May 20, 2024
d4d7cd5
Merge pull request #3279 from matsim-org/dependabot/maven/com.google.…
michalmac May 20, 2024
70eec34
Move optimization constraints params to optimizer package
nkuehnel May 21, 2024
12ca6a5
add middleman for drt optimization constraints
nkuehnel May 21, 2024
6a359cc
Merge branch 'master' into multiple-drt-optimization-params
nkuehnel May 21, 2024
a4a112b
re-order replanning parameter comments to make them more understandab…
simei94 May 22, 2024
f6396f8
---
dependabot[bot] May 22, 2024
b867f8c
Merge pull request #3282 from matsim-org/dependabot/maven/jakarta.val…
michalmac May 22, 2024
64b2943
---
dependabot[bot] May 22, 2024
599714f
Merge pull request #3281 from matsim-org/dependabot/maven/net.bytebud…
michalmac May 22, 2024
a23186e
Merge branch 'master' into multiple-drt-optimization-params
nkuehnel May 23, 2024
04a66fb
Merge pull request #3275 from marecabo/multiple-drt-optimization-params
marecabo May 24, 2024
c0149d6
Bump org.apache.commons:commons-compress from 1.26.1 to 1.26.2
dependabot[bot] May 24, 2024
6a12bd5
Merge pull request #3287 from matsim-org/dependabot/maven/org.apache.…
michalmac May 24, 2024
6c6a2e3
Bump com.google.protobuf:protobuf-java from 4.26.1 to 4.27.0
dependabot[bot] May 24, 2024
de96dbd
Merge pull request #3286 from matsim-org/dependabot/maven/com.google.…
michalmac May 24, 2024
9b101a0
Fix bug in bicycle score handler (#3288)
rakow May 27, 2024
4796104
fix: prebooked drt with variable stop durations and group sizes (#3290)
sebhoerl May 27, 2024
7bb99a7
Documentation mode choice + make mode choice analysis standard (#3285)
simei94 May 27, 2024
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 @@ -20,6 +20,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.api.feature.simple.SimpleFeature;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
Expand All @@ -41,7 +42,6 @@
import org.matsim.core.utils.geometry.CoordUtils;
import org.matsim.core.utils.gis.GeoFileReader;
import org.matsim.facilities.*;
import org.opengis.feature.simple.SimpleFeature;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
import java.util.HashSet;
import java.util.Set;

import org.geotools.data.DataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.api.data.DataStore;
import org.geotools.api.data.FileDataStoreFinder;
import org.geotools.api.data.SimpleFeatureSource;
import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.data.simple.SimpleFeatureIterator;
import org.geotools.data.simple.SimpleFeatureSource;
import org.opengis.feature.simple.SimpleFeature;

/**
* Utility class for reading shape (.shp) files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.matsim.facilities.ActivityFacility;
import org.matsim.facilities.FacilitiesUtils;
import org.matsim.utils.gis.shp2matsim.ShpGeometryUtils;
import org.opengis.feature.simple.SimpleFeature;

public final class GridUtils {
// used from outside, e.g. in vsp playgrounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import java.util.Collection;
import java.util.List;

import org.geotools.api.feature.simple.SimpleFeature;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.triangulate.VoronoiDiagramBuilder;
import org.matsim.contrib.matrixbasedptrouter.utils.BoundingBox;
import org.matsim.core.utils.gis.GeoFileWriter;
import org.opengis.feature.simple.SimpleFeature;

/**
* @author dziemke
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.api.feature.simple.SimpleFeatureType;
import org.geotools.feature.simple.SimpleFeatureBuilder;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
import org.locationtech.jts.geom.Coordinate;
Expand All @@ -40,8 +42,6 @@
import org.matsim.core.utils.geometry.CoordUtils;
import org.matsim.facilities.ActivityFacilities;
import org.matsim.facilities.ActivityFacility;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;

/**
* @author dziemke
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.api.metadata.Identifier;
import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.NoSuchAuthorityCodeException;
import org.geotools.api.referencing.crs.CRSAuthorityFactory;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.api.referencing.operation.MathTransform;
import org.geotools.api.referencing.operation.TransformException;
import org.geotools.referencing.CRS;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
import org.opengis.metadata.Identifier;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.NoSuchAuthorityCodeException;
import org.opengis.referencing.crs.CRSAuthorityFactory;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;

/**
* Utility-class providing functionality related to coordinate reference
Expand Down Expand Up @@ -94,7 +94,7 @@ public static int getSRID(CoordinateReferenceSystem crs) {
/*
* Randomly get one identifier.
*/
Identifier identifier = (Identifier) (crs.getIdentifiers().iterator().next());
Identifier identifier = crs.getIdentifiers().iterator().next();
if (identifier == null) {
return 0;
} else {
Expand All @@ -118,7 +118,7 @@ public static MathTransform findTransform(Geometry source, Geometry target) {
CoordinateReferenceSystem targetCRS = getCRS(target.getSRID());

try {
return CRS.findMathTransform(sourceCRS, targetCRS);
return CRS.findMathTransform(sourceCRS, targetCRS);
} catch (FactoryException e) {
e.printStackTrace();
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
import java.util.List;
import java.util.Set;

import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.api.referencing.operation.MathTransform;
import org.geotools.referencing.CRS;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.index.SpatialIndex;
import org.locationtech.jts.index.quadtree.Quadtree;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;

/**
* Representation of a spatial index containing zones backed by a quadtree.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.api.feature.simple.SimpleFeature;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
Expand All @@ -41,7 +42,6 @@
import org.matsim.facilities.ActivityOption;
import org.matsim.facilities.FacilitiesUtils;
import org.matsim.utils.objectattributes.ObjectAttributes;
import org.opengis.feature.simple.SimpleFeature;
import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer;
import org.openstreetmap.osmosis.core.container.v0_6.EntityContainer;
import org.openstreetmap.osmosis.core.container.v0_6.EntityProcessor;
Expand Down Expand Up @@ -89,7 +89,7 @@ class CombinedOsmSink implements Sink {

private Map<String, Integer> typeCount = new HashMap<>();

private List <SimpleFeature> landUseAreas = new ArrayList <SimpleFeature>();
private List <SimpleFeature> landUseAreas = new ArrayList<>();

private int featureErrorCounter = 0;
private int buildingErrorCounter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.api.feature.simple.SimpleFeature;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
Expand All @@ -40,7 +41,6 @@
import org.matsim.facilities.ActivityOption;
import org.matsim.facilities.FacilitiesUtils;
import org.matsim.utils.objectattributes.ObjectAttributes;
import org.opengis.feature.simple.SimpleFeature;
import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer;
import org.openstreetmap.osmosis.core.container.v0_6.EntityContainer;
import org.openstreetmap.osmosis.core.container.v0_6.EntityProcessor;
Expand Down Expand Up @@ -69,11 +69,11 @@ class LandUseBuildingSink implements Sink {
private Map<Long, RelationContainer> relationMap;
private ActivityFacilities facilities;
private ObjectAttributes facilityAttributes;
private Map<String, String> landUseTypeMap = new HashMap<>();
private Map<String, String> buildingTypeMap = new HashMap<>();
private final Map<String, String> landUseTypeMap;
private Map<String, String> buildingTypeMap;
private Map<String, Integer> typeCount = new HashMap<>();

private List <SimpleFeature> features = new ArrayList <SimpleFeature>();
private List <SimpleFeature> features = new ArrayList<>();

private double buildingTypeFromVicinityRange;
private String[] tagsToIgnoreBuildings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.data.DataStore;
import org.geotools.data.DataStoreFinder;
import org.geotools.data.simple.SimpleFeatureStore;
import org.geotools.api.data.DataStore;
import org.geotools.api.data.DataStoreFinder;
import org.geotools.api.data.SimpleFeatureStore;
import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.api.feature.simple.SimpleFeatureType;
import org.geotools.feature.DefaultFeatureCollection;
import org.geotools.feature.simple.SimpleFeatureBuilder;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
Expand All @@ -49,8 +51,6 @@
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.core.utils.gis.GeoFileWriter;
import org.matsim.facilities.ActivityFacility;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;

public class GeoserverUpdater implements FacilityDataExchangeInterface {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.data.DataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.api.data.DataStore;
import org.geotools.api.data.FileDataStoreFinder;
import org.geotools.api.data.SimpleFeatureSource;
import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.data.simple.SimpleFeatureIterator;
import org.geotools.data.simple.SimpleFeatureSource;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
Expand All @@ -45,7 +46,6 @@
import org.matsim.core.utils.geometry.geotools.MGC;
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.core.utils.gis.GeoFileReader;
import org.opengis.feature.simple.SimpleFeature;

/**
* @author mmayobre, ikaddoura
Expand Down
2 changes: 1 addition & 1 deletion contribs/analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import java.util.Map;
import java.util.Map.Entry;

import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.locationtech.jts.geom.Coordinate;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.network.Link;
Expand All @@ -43,8 +45,6 @@
import org.matsim.core.utils.gis.PolylineFeatureFactory;
import org.matsim.core.utils.gis.GeoFileWriter;
import org.matsim.core.utils.io.IOUtils;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
* Analyzes the average link travel times and writes them to files (absolute and
Expand Down
4 changes: 2 additions & 2 deletions contribs/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>com.github.matsim-org</groupId>
<artifactId>gtfs2matsim</artifactId>
<version>master-33809c4f0f-1</version>
<version>fc8b13954d</version>
<exclusions>
<!-- Exclude unneeded dependencies and these with known CVE -->
<exclusion>
Expand Down Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.5</version>
<version>4.7.6</version>
</dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class CsvOptions {
@CommandLine.Option(names = "--csv-format", description = "CSV Format", defaultValue = "Default")
private CSVFormat.Predefined csvFormat;

@CommandLine.Option(names = "--csv-delimiter", description = "CSV Delimiter", required = false)
@CommandLine.Option(names = "--csv-delimiter", description = "CSV Delimiter")
private Character csvDelimiter;

@CommandLine.Option(names = "--csv-charset", description = "CSV input encoding", defaultValue = "UTF8")
Expand Down Expand Up @@ -56,24 +56,48 @@ public CsvOptions(CSVFormat.Predefined csvFormat, Character csvDelimiter, Charse
*/
public static Character detectDelimiter(String path) throws IOException {
try (BufferedReader reader = IOUtils.getBufferedReader(path)) {
String firstLine = reader.readLine();
int[] comma = new int[5];
int[] semicolon = new int[5];
int[] tab = new int[5];
String[] lines = new String[5];

// check five first lines for separator chars. It might be that the csv file has additional info in the first x lines (e.g. EPSG)
for (int i = 0; i < 5; i++) {
lines[i] = reader.readLine();
if (lines[i] == null) {
comma[i] = 0;
semicolon[i] = 0;
tab[i] = 0;
} else {
comma[i] = StringUtils.countMatches(lines[i], ",");
semicolon[i] = StringUtils.countMatches(lines[i], ";");
tab[i] = StringUtils.countMatches(lines[i], "\t");
}
}

int comma = StringUtils.countMatches(firstLine, ",");
int semicolon = StringUtils.countMatches(firstLine, ";");
int tab = StringUtils.countMatches(firstLine, "\t");
Integer index = null;

if (comma == 0 && semicolon == 0 && tab == 0) {
throw new IllegalArgumentException("No delimiter found in the first line of the file.");
for (int i = 0; i < comma.length - 1; i++) {
// only check next index if line with separators was not found
if (index == null) {
if (!(comma[i] == 0 && semicolon[i] == 0 && tab[i] == 0)) {
index = i;
}
}
}

// Comma is preferred as the more likely format
if (comma >= semicolon && comma >= tab) {
return ',';
} else if (tab >= semicolon)
return '\t';
else
return ';';
}
if (index == null) {
throw new IllegalArgumentException("No delimiter found in the first line of the file.");
} else {
// Comma is preferred as the more likely format
if (comma[index] >= semicolon[index] && comma[index] >= tab[index]) {
return ',';
} else if (tab[index] >= semicolon[index])
return '\t';
else
return ';';
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import org.apache.commons.lang3.ArrayUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.api.data.*;
import org.geotools.api.feature.simple.SimpleFeature;
import org.geotools.api.feature.simple.SimpleFeatureType;
import org.geotools.api.referencing.FactoryException;
import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
import org.geotools.data.*;
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.data.shapefile.ShapefileDataStoreFactory;
Expand All @@ -21,10 +26,6 @@
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.core.utils.gis.GeoFileReader;
import org.matsim.core.utils.io.IOUtils;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import picocli.CommandLine;

import javax.annotation.Nullable;
Expand Down
Loading