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 #79

Merged
merged 76 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
0553601
add mode2mode specific transfer constants to SwissRailRaptor
jfbischoff Dec 22, 2023
2432321
add mode2mode specific transfer constants to SwissRailRaptor
jfbischoff Dec 22, 2023
1fd9bff
Merge remote-tracking branch 'origin/master' into feature/improve-tra…
jfbischoff Dec 22, 2023
550c627
Merge branch 'master' into feature/improve-transfer-times
jfbischoff Dec 24, 2023
d0a13b2
build(deps): bump org.jxmapviewer:jxmapviewer2 from 2.6 to 2.8
dependabot[bot] Dec 28, 2023
a9bfbc7
Merge pull request #3020 from matsim-org/dependabot/maven/org.jxmapvi…
michalmac Dec 28, 2023
e7dd33e
ev: fix ConcurrentModificationException in VehicleChargingHandler.not…
michalmac Dec 29, 2023
813df9f
Merge pull request #3022 from matsim-org/fix-VehicleChargingHandler
michalmac Dec 29, 2023
d8d8a12
build(deps): bump org.slf4j:slf4j-api from 2.0.9 to 2.0.10
dependabot[bot] Dec 29, 2023
b3af497
Merge pull request #3023 from matsim-org/dependabot/maven/org.slf4j-s…
michalmac Dec 29, 2023
719d2a2
Provides a way to provide custom handling for unknown parameters ni R…
mrieser Dec 30, 2023
1ec0633
Merge pull request #3027 from matsim-org/2960-support-custom-config-m…
mrieser Dec 30, 2023
3769a38
code cleanup: remove redundant suppression
mrieser Dec 30, 2023
0aba012
make test actually compare similar objects
mrieser Dec 30, 2023
0dfa26d
Ensure deterministic depot selection (#3026)
steffenaxer Dec 30, 2023
7a53f16
modernize code
mrieser Dec 30, 2023
7212803
code cleanup: replace e.printStackTrace with better exception handling
mrieser Dec 30, 2023
247deef
Remove uuid (#3028)
steffenaxer Dec 30, 2023
aa28c6e
code cleanup: delete method commented out since 10+ years
mrieser Dec 30, 2023
abba456
code cleanup: use try-with-resources
mrieser Dec 30, 2023
78e2bad
make inner classes static
mrieser Dec 30, 2023
ad0325a
misc code cleanup suggested by IntelliJ
mrieser Dec 30, 2023
2271c58
remove empty javadoc comments
mrieser Dec 30, 2023
e86faee
Merge branch 'master' into code-cleanup
mrieser Dec 30, 2023
1751ed6
fix compilation issue
mrieser Dec 31, 2023
d0633a7
Merge pull request #3029 from matsim-org/code-cleanup
mrieser Dec 31, 2023
a165e1e
Ensure unique identifier (#3030)
steffenaxer Dec 31, 2023
388b889
build(deps): bump org.assertj:assertj-core from 3.24.2 to 3.25.0
dependabot[bot] Jan 1, 2024
90e5f29
Merge pull request #3031 from matsim-org/dependabot/maven/org.assertj…
michalmac Jan 1, 2024
e315fe4
Cleanup small scale traffic generation (#3032)
rakow Jan 2, 2024
7c5df1d
build(deps): bump org.assertj:assertj-core from 3.25.0 to 3.25.1
dependabot[bot] Jan 3, 2024
f3ecf4a
Merge pull request #3034 from matsim-org/dependabot/maven/org.assertj…
michalmac Jan 3, 2024
8c4d313
build(deps): bump com.google.errorprone:error_prone_annotations
dependabot[bot] Jan 4, 2024
5bbad7c
Merge pull request #3035 from matsim-org/dependabot/maven/com.google.…
michalmac Jan 4, 2024
ebbdf29
Merge remote-tracking branch 'origin/master' into feature/improve-tra…
jfbischoff Jan 5, 2024
9561281
Merge pull request #3013 from matsim-org/feature/improve-transfer-times
jfbischoff Jan 5, 2024
cc49d9c
also generate sources.jar for test-jar
mrieser Jan 5, 2024
f88b41a
Merge pull request #3038 from matsim-org/generate-test-sources-jar
mrieser Jan 5, 2024
0354b78
build(deps): bump org.slf4j:slf4j-api from 2.0.10 to 2.0.11
dependabot[bot] Jan 9, 2024
5203264
Merge pull request #3039 from matsim-org/dependabot/maven/org.slf4j-s…
michalmac Jan 9, 2024
010e4a1
use carrierVehicleTypes instead of allVehicles for analysis
rewertvsp Jan 10, 2024
6a47e66
Merge pull request #3040 from matsim-org/useCarrierVehicleTypesFileFo…
rewertvsp Jan 10, 2024
93637d1
build(deps): bump org.apache.maven.plugins:maven-failsafe-plugin
dependabot[bot] Jan 10, 2024
3a989a4
Merge pull request #3041 from matsim-org/dependabot/maven/org.apache.…
michalmac Jan 10, 2024
6bd8857
build(deps): bump org.apache.maven.plugins:maven-surefire-report-plugin
dependabot[bot] Jan 10, 2024
07919c4
add PathElement to RaptorTransferCostCalculator
jfbischoff Jan 10, 2024
a71e75e
Merge branch 'master' into pathElementToTransferCostCalculator
jfbischoff Jan 10, 2024
5333487
Merge pull request #3043 from matsim-org/dependabot/maven/org.apache.…
michalmac Jan 10, 2024
28bd7cc
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin
dependabot[bot] Jan 10, 2024
400cfd3
Merge pull request #3042 from matsim-org/dependabot/maven/org.apache.…
michalmac Jan 10, 2024
f4a234a
package reorganization
kainagel Jan 10, 2024
e239202
some package reorganisation; some reformatting
kainagel Jan 10, 2024
c97d77b
build use case that tests the full infrastructure (existing tests als…
kainagel Jan 10, 2024
f110e47
Merge pull request #3045 from matsim-org/decongestion
kainagel Jan 10, 2024
5021483
Merge branch 'master' into pathElementToTransferCostCalculator
jfbischoff Jan 11, 2024
56c3601
Merge pull request #3044 from matsim-org/pathElementToTransferCostCal…
jfbischoff Jan 11, 2024
9adfdfc
make WeightedCoord a record
jfbischoff Jan 11, 2024
31eb0e3
allow CoordAggregation in PTSkimMatrices
jfbischoff Jan 11, 2024
3cb51be
Merge remote-tracking branch 'origin/master'
jfbischoff Jan 11, 2024
ca20784
Merge pull request #3046 from matsim-org/coordWeightingInPTSkimCalcul…
jfbischoff Jan 11, 2024
8d97201
bugfix make coordAggregator actually accessible
jfbischoff Jan 11, 2024
db021eb
bugfix make coordAggregator actually accessible
jfbischoff Jan 11, 2024
18ed3b4
Merge remote-tracking branch 'origin/master'
jfbischoff Jan 11, 2024
5cadc8a
Merge pull request #3048 from matsim-org/skimmatricesLittleBugfix
jfbischoff Jan 11, 2024
8a975bc
move test input files
kainagel Jan 12, 2024
81dbb93
Merge branch 'master' into parkingMaintenance
kainagel Jan 12, 2024
8f9569e
Merge pull request #3049 from matsim-org/parkingMaintenance
kainagel Jan 12, 2024
6054c26
build(deps): bump io.grpc:grpc-all from 1.60.1 to 1.61.0
dependabot[bot] Jan 12, 2024
78e30fc
Merge pull request #3050 from matsim-org/dependabot/maven/io.grpc-grp…
michalmac Jan 12, 2024
8948c5c
build(deps): bump com.google.protobuf:protobuf-java
dependabot[bot] Jan 12, 2024
a051b39
Merge pull request #3047 from matsim-org/dependabot/maven/com.google.…
michalmac Jan 12, 2024
1ec38bc
build(deps): bump org.mockito:mockito-core from 5.8.0 to 5.9.0
dependabot[bot] Jan 15, 2024
5bab1fd
Merge pull request #3053 from matsim-org/dependabot/maven/org.mockito…
michalmac Jan 15, 2024
b236f2d
DrtCompanion with PassengerGroupIdentifier (#3051)
steffenaxer Jan 15, 2024
863f4d4
Move DRT_COMPANION_AGENT_PREFIX
steffenaxer Jan 15, 2024
48ea6b7
Merge pull request #3054 from steffenaxer/drtCompanionPrefix
steffenaxer Jan 15, 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 @@ -16,6 +16,7 @@
import org.matsim.api.core.v01.Coord;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.core.utils.geometry.geotools.MGC;
import org.matsim.core.utils.geometry.transformations.IdentityTransformation;
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.core.utils.gis.ShapeFileReader;
import org.matsim.core.utils.io.IOUtils;
Expand Down Expand Up @@ -47,6 +48,11 @@
*/
public final class ShpOptions {

/**
* Special value for {@link #createIndex(String, String)} to use the same crs as the shape file.
*/
public static final String SAME_CRS = "same_crs";

private static final Logger log = LogManager.getLogger(ShpOptions.class);

@CommandLine.Option(names = "--shp", description = "Optional path to shape file used for filtering", required = false)
Expand Down Expand Up @@ -204,10 +210,15 @@ public Index createIndex(String queryCRS, String attr, Set<String> filter) {
if (queryCRS == null)
throw new IllegalArgumentException("Query crs must not be null!");

CoordinateTransformation ct = TransformationFactory.getCoordinateTransformation(queryCRS, detectCRS());

try {
return new Index(ct, attr, filter);
ShapefileDataStore ds = openDataStoreAndSetCRS();
CoordinateTransformation ct;
if (queryCRS.equals(SAME_CRS))
ct = new IdentityTransformation();
else {
ct = TransformationFactory.getCoordinateTransformation(queryCRS, shpCrs);
}
return new Index(ct, ds, attr, filter);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand All @@ -222,6 +233,15 @@ public Index createIndex(String queryCRS, String attr) {
return createIndex(queryCRS, attr, null);
}

/**
* Create an index without a filter and the same query crs as the shape file.
*
* @see #createIndex(String, String)
*/
public Index createIndex(String attr) {
return createIndex(SAME_CRS, attr, null);
}

/**
* Create a coordinate transformation to the shape file crs. Tries to autodetect the crs of the shape file.
*/
Expand All @@ -247,6 +267,25 @@ private String detectCRS() {
return shpCrs;
}

/**
* Open the shape file for processing and set the crs if not already specified.
*/
private ShapefileDataStore openDataStoreAndSetCRS() throws IOException {
ShapefileDataStore ds = openDataStore(shp);

if (shpCrs == null) {
try {
CoordinateReferenceSystem crs = ds.getSchema().getCoordinateReferenceSystem();
shpCrs = "EPSG:" + CRS.lookupEpsgCode(crs, true);
log.info("Using detected crs for {}: {}", shp, shpCrs);
} catch (FactoryException | NullPointerException e) {
throw new IllegalStateException("Could not determine crs of the shape file. Try to specify it manually using --shp-crs.", e);
}
}

return ds;
}

/**
* Create an inverse coordinate transformation from the shape file crs. Tries to autodetect the crs of the shape file.
*/
Expand All @@ -269,9 +308,7 @@ public final class Index {
* @param ct coordinate transform from query to target crs
* @param attr attribute for the result of {@link #query(Coord)}
*/
Index(CoordinateTransformation ct, String attr, @Nullable Set<String> filter) throws IOException {
ShapefileDataStore ds = openDataStore(shp);

Index(CoordinateTransformation ct, ShapefileDataStore ds, String attr, @Nullable Set<String> filter) throws IOException {
if (shpCharset != null)
ds.setCharset(shpCharset);

Expand Down Expand Up @@ -342,11 +379,10 @@ public boolean contains(Coord coord) {
return false;
}


/**
* Return all features in the index.
*/
public List<SimpleFeature> getAll() {
public List<SimpleFeature> getAllFeatures() {
List<SimpleFeature> result = new ArrayList<>();
itemsTree(result, index.getRoot());

Expand All @@ -372,6 +408,14 @@ private void itemsTree(List<SimpleFeature> list, AbstractNode node) {
public int size() {
return index.size();
}

/**
* Return underlying shp file. Should be used carefully.
*/
public ShpOptions getShp() {
return ShpOptions.this;
}

}

}
Loading
Loading