-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from matsim-vsp/complete-rail-scraping
Complete rail scraping
- Loading branch information
Showing
21 changed files
with
716 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.tub.vsp.bvwp; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.tub.vsp.bvwp.data.container.analysis.RailAnalysisDataContainer; | ||
import org.tub.vsp.bvwp.io.RailCsvWriter; | ||
import org.tub.vsp.bvwp.scraping.RailScraper; | ||
|
||
import java.util.List; | ||
|
||
public class RunLocalRailScraping { | ||
private static final Logger logger = LogManager.getLogger(RunLocalRailScraping.class); | ||
|
||
public static void main(String[] args) { | ||
RailScraper scraper = new RailScraper(); | ||
|
||
logger.info("Starting scraping"); | ||
List<RailAnalysisDataContainer> allRailData = scraper.extractAllLocalBaseData("./data/rail/all", "", "^2.*", "") | ||
.stream() | ||
.map(RailAnalysisDataContainer::new) | ||
.toList(); | ||
|
||
logger.info("Writing csv"); | ||
RailCsvWriter csvWriter = new RailCsvWriter(); | ||
|
||
//TODO | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/org/tub/vsp/bvwp/data/container/analysis/RailAnalysisDataContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.tub.vsp.bvwp.data.container.analysis; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.tub.vsp.bvwp.data.container.base.rail.RailBaseDataContainer; | ||
|
||
public class RailAnalysisDataContainer { | ||
Logger logger = LogManager.getLogger(RailAnalysisDataContainer.class); | ||
|
||
private final RailBaseDataContainer baseDataContainer; | ||
|
||
public RailAnalysisDataContainer(RailBaseDataContainer baseDataContainer) { | ||
this.baseDataContainer = baseDataContainer; | ||
} | ||
|
||
//add analysis stuff here... | ||
} |
74 changes: 74 additions & 0 deletions
74
src/main/java/org/tub/vsp/bvwp/data/container/base/rail/RailBaseDataContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,79 @@ | ||
package org.tub.vsp.bvwp.data.container.base.rail; | ||
|
||
import java.util.Objects; | ||
|
||
public class RailBaseDataContainer { | ||
private String url; | ||
|
||
RailProjectInformationDataContainer projectInformation; | ||
RailPhysicalEffectDataContainer physicalEffect; | ||
RailCostBenefitAnalysisDataContainer costBenefitAnalysis; | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public RailBaseDataContainer setUrl(String url) { | ||
this.url = url; | ||
return this; | ||
} | ||
|
||
public RailProjectInformationDataContainer getProjectInformation() { | ||
return projectInformation; | ||
} | ||
|
||
public RailBaseDataContainer setProjectInformation(RailProjectInformationDataContainer projectInformation) { | ||
this.projectInformation = projectInformation; | ||
return this; | ||
} | ||
|
||
public RailPhysicalEffectDataContainer getPhysicalEffect() { | ||
return physicalEffect; | ||
} | ||
|
||
public RailBaseDataContainer setPhysicalEffect(RailPhysicalEffectDataContainer physicalEffect) { | ||
this.physicalEffect = physicalEffect; | ||
return this; | ||
} | ||
|
||
public RailCostBenefitAnalysisDataContainer getCostBenefitAnalysis() { | ||
return costBenefitAnalysis; | ||
} | ||
|
||
public RailBaseDataContainer setCostBenefitAnalysis(RailCostBenefitAnalysisDataContainer costBenefitAnalysis) { | ||
this.costBenefitAnalysis = costBenefitAnalysis; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
RailBaseDataContainer that = (RailBaseDataContainer) o; | ||
|
||
if (!Objects.equals(url, that.url)) { | ||
return false; | ||
} | ||
if (!Objects.equals(projectInformation, that.projectInformation)) { | ||
return false; | ||
} | ||
if (!Objects.equals(physicalEffect, that.physicalEffect)) { | ||
return false; | ||
} | ||
return Objects.equals(costBenefitAnalysis, that.costBenefitAnalysis); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = url != null ? url.hashCode() : 0; | ||
result = 31 * result + (projectInformation != null ? projectInformation.hashCode() : 0); | ||
result = 31 * result + (physicalEffect != null ? physicalEffect.hashCode() : 0); | ||
result = 31 * result + (costBenefitAnalysis != null ? costBenefitAnalysis.hashCode() : 0); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.