Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ nexus and to the maven repo (last is only possibly from master).
## Release Notes

### 0.33.0

- Use TLongObjectMap instead of TIntObjectMap in Multigraph

### 0.32.0
- Remove use of the temporary parameter "multiple" for poi gravitation
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.targomo</groupId>
<artifactId>java-client</artifactId>
<version>0.33.0-SNAPSHOT</version>
<version>0.33.0-SNAPSHOT-LONG</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the separate version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, but I wanted to keep it just before the merge so it'll not break other branches on core and stats. I'll update those when all the MRs are ready to be merged in.

<name>Targomo Java Client Library</name>
<description>Java client library for easy usage of Targomo web services.</description>
<url>https://github.com/targomo/targomo-java</url>
Expand Down Expand Up @@ -220,7 +220,7 @@
<dependency>
<groupId>com.targomo</groupId>
<artifactId>jackson-datatype-trove</artifactId>
<version>0.0.8</version>
<version>0.0.9</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/targomo/client/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class Constants {

public static final float NO_VALUE_ENTRY_FLOAT_TROVE_MAPS = -Float.MAX_VALUE;
public static final int NO_VALUE_ENTRY_INT_TROVE_MAPS = Integer.MIN_VALUE;
public static final long NO_VALUE_ENTRY_LONG_TROVE_MAPS = Long.MIN_VALUE;

public static final String POLYGON_VALUES = "values";
public static final String POLYGON_INTERSECTION_MODE = "intersectionMode";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public class StatisticTravelOptions extends TravelOptions {
@Transient
private boolean useStatisticTargets = false;

@Transient
private Integer multiGraphH3FixedZoomLevel;

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -107,6 +110,7 @@ public boolean equals(Object o) {
return super.equals(o) &&
Objects.equals(useH3Reachability, that.useH3Reachability) &&
Objects.equals(useStatisticTargets, that.useStatisticTargets) &&
Objects.equals(multiGraphH3FixedZoomLevel, that.multiGraphH3FixedZoomLevel) &&
Objects.equals(getClosestSources, that.getClosestSources) &&
Objects.equals(omitIndividualStatistics, that.omitIndividualStatistics) &&
Objects.equals(inactiveSources, that.inactiveSources) &&
Expand Down Expand Up @@ -135,7 +139,7 @@ public int hashCode() {
multiGraphDomainStatisticCollectionId, multiGraphLayerUnboundedStatistics, multiGraphReferencedStatisticIds,
multiGraphTravelTimeApproximation, statisticIds, chartInterval, statisticCollectionId,
multigraphCalculateGravitationPerReferenceId, returnOriginId, competingRoutingOptions,
routingAggregationType.ordinal(), multiGraphIgnoreRoutingErrorMessages);
routingAggregationType.ordinal(), multiGraphIgnoreRoutingErrorMessages, multiGraphH3FixedZoomLevel);
}

@Override
Expand Down Expand Up @@ -182,6 +186,8 @@ public String toString(){
builder.append(useH3Reachability);
builder.append("\n\tuseStatisticTargets: ");
builder.append(useStatisticTargets);
builder.append("\n\tmultiGraphH3FixedZoomLevel: ");
builder.append(multiGraphH3FixedZoomLevel);
builder.append("\n}\n");
return builder.toString();
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/targomo/client/api/pojo/MultiGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.targomo.client.api.enums.MultiGraphDomainType;
import gnu.trove.map.TIntFloatMap;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.TLongFloatMap;

import java.util.HashMap;
import java.util.Map;
Expand All @@ -16,7 +16,7 @@
*/
public class MultiGraph extends BaseGraph {

private final Map<String, TIntFloatMap> layers;
private final Map<String, TLongFloatMap> layers;

// the type of the layer: values per vertex or per edge
private final MultiGraphDomainType domainType;
Expand All @@ -30,7 +30,7 @@ public MultiGraph(long networkID, MultiGraphDomainType domainType){
@JsonCreator
public MultiGraph(@JsonProperty("networkID") long networkID,
@JsonProperty("nodes") TIntObjectMap<double[]> nodes,
@JsonProperty("layers") Map<String,TIntFloatMap> layers,
@JsonProperty("layers") Map<String, TLongFloatMap> layers,
@JsonProperty("edges") TIntObjectMap<int[]> edges,
@JsonProperty("supportingPoints") TIntObjectMap<double[][]> supportingPoints,
@JsonProperty("domainType") MultiGraphDomainType domainType) {
Expand All @@ -39,7 +39,7 @@ public MultiGraph(@JsonProperty("networkID") long networkID,
this.domainType = domainType;
}

public Map<String, TIntFloatMap> getLayers() {
public Map<String, TLongFloatMap> getLayers() {
return layers;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class MultiGraphRequest<R extends MultiGraphResponse<?>> extends TargomoR

static {
MAPPER.registerModule(new TroveModule(Constants.NO_VALUE_ENTRY_INT_TROVE_MAPS,
Constants.NO_VALUE_ENTRY_LONG_TROVE_MAPS,
Constants.NO_VALUE_ENTRY_FLOAT_TROVE_MAPS)); //required to properly deserialize MultiGraphs
}

Expand Down