Skip to content

Commit

Permalink
Merge branch 'master' into parkingChoiceMaintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
kainagel committed Jun 27, 2024
2 parents b24d01b + 0ec23f8 commit ca7746a
Show file tree
Hide file tree
Showing 848 changed files with 43,812 additions and 10,034 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-on-pr-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'
server-id: 'matsim-releases'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-on-release-created.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'
server-id: matsim-releases
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'
server-id: 'matsim-releases'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/full-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/verify-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- contribs/simwrapper
- contribs/sbb-extensions
- contribs/simulatedannealing
- contribs/small-scale-traffic-generation
- benchmark

steps:
Expand All @@ -86,7 +87,7 @@ jobs:
if: ${{matrix.module != 'matsim' || steps.detect-changes.outputs.outside-contribs == 'true'}}
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'zulu'
cache: 'maven'

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ matsimExamples
matsim/docs/doxygen/html
matsim/src/main/java/Doxyfile

# VS Code files
.vscode

# ignore output directories:
output/
6 changes: 3 additions & 3 deletions benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.matsim</groupId>
<artifactId>matsim-all</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
Expand Down Expand Up @@ -33,12 +33,12 @@
<dependency>
<groupId>org.matsim</groupId>
<artifactId>matsim</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.matsim</groupId>
<artifactId>matsim-examples</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
1 change: 1 addition & 0 deletions contribs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The MATSim core development team cannot make any guarantee that these extensions
| [shared_mobility](shared_mobility/README.md) | Simulate human-driven shared mobility (i.e., micromobility)
| [signals](signals/README.md) | Simulate traffic lights microscopically
| [simwrapper](simwrapper/README.md) | Creates dashboards automatically with [SimWrapper](https://simwrapper.github.io/)
| [small-scale-traffic-generation](small-scale-traffic-generation/README.md) | Tool to generate small-scale commercial traffic
| [socnetsim](socnetsim/README.md) | Social network simulation
| [sumo](sumo/README.md) | Converter and integrations for [SUMO](https://sumo.dlr.de/])
| [taxi](taxi/README.md) | Taxi service functionality
Expand Down
8 changes: 4 additions & 4 deletions contribs/accessibility/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.matsim</groupId>
<artifactId>contrib</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.matsim.contrib</groupId>
Expand Down Expand Up @@ -37,12 +37,12 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>matrixbasedptrouter</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>roadpricing</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sf.trove4j</groupId>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>analysis</artifactId>
<version>16.0-SNAPSHOT</version>
<version>2025.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.matsim.contrib</groupId>-->
Expand Down
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 @@ -39,9 +40,8 @@
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.network.algorithms.TransportModeNetworkFilter;
import org.matsim.core.utils.geometry.CoordUtils;
import org.matsim.core.utils.gis.ShapeFileReader;
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 Expand Up @@ -225,7 +225,7 @@ public static final ActivityFacilities createFacilityForEachLink(String facility


public static final ActivityFacilities createFacilityFromBuildingShapefile(String shapeFileName, String identifierCaption, String numberOfHouseholdsCaption) {
ShapeFileReader shapeFileReader = new ShapeFileReader();
GeoFileReader shapeFileReader = new GeoFileReader();
Collection<SimpleFeature> features = shapeFileReader.readFileAndInitialize(shapeFileName);

ActivityFacilities facilities = FacilitiesUtils.createActivityFacilities("DensitiyFacilities");
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,23 +22,23 @@
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.ShapeFileWriter;
import org.opengis.feature.simple.SimpleFeature;
import org.matsim.core.utils.gis.GeoFileWriter;

/**
* @author dziemke
*/
class VoronoiExample {

public static void main(String[] args) {
GeometryFactory geometryFactory = new GeometryFactory();

Collection<Coordinate> sites = new ArrayList<>();
sites.add(new Coordinate(70, 70));
sites.add(new Coordinate(50, 150));
Expand All @@ -48,16 +48,16 @@ public static void main(String[] args) {
sites.add(new Coordinate(250, 150));
sites.add(new Coordinate(350, 50));
sites.add(new Coordinate(370, 170));

VoronoiDiagramBuilder voronoiDiagramBuilder = new VoronoiDiagramBuilder();
voronoiDiagramBuilder.setSites(sites);
voronoiDiagramBuilder.setSites(sites);

List<Polygon> polygons = voronoiDiagramBuilder.getSubdivision().getVoronoiCellPolygons(geometryFactory);

BoundingBox boundingBox = BoundingBox.createBoundingBox(0, 0, 400, 200);
Polygon boundingPolygon = VoronoiGeometryUtils.createBoundingPolygon(boundingBox);
Collection<Geometry> cutGeometries = VoronoiGeometryUtils.cutPolygonsByBoundary(polygons, boundingPolygon);
Collection<SimpleFeature> features = VoronoiGeometryUtils.createFeaturesFromPolygons(cutGeometries);
ShapeFileWriter.writeGeometries(features, "/Users/dominik/voronoi_test.shp");
GeoFileWriter.writeGeometries(features, "/Users/dominik/voronoi_test.shp");
}
}
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
Loading

0 comments on commit ca7746a

Please sign in to comment.