Skip to content

Commit

Permalink
missing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
rtroilo committed Feb 18, 2021
1 parent f5038ae commit 8db7266
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.heigit.ohsome.oshdb.tool.importer.extract.collector;

import static org.heigit.ohsome.oshdb.osm.Coordinates.GEOM_PRECISION;

import crosby.binary.Osmformat.HeaderBBox;
import crosby.binary.Osmformat.HeaderBlock;
import java.io.PrintStream;
Expand All @@ -9,7 +11,6 @@
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import org.heigit.ohsome.oshdb.OSHDB;
import org.heigit.ohsome.oshdb.osm.OSMType;
import org.heigit.ohsome.oshpbf.parser.osm.v0_6.Entity;
import org.heigit.ohsome.oshpbf.parser.osm.v0_6.Node;
Expand Down Expand Up @@ -123,7 +124,7 @@ public void print(PrintStream out){
}

if(minLon != Integer.MAX_VALUE){
out.printf("data.bbox=%.7f,%.7f,%.7f,%.7f%n",minLon*OSHDB.GEOM_PRECISION,minLat*OSHDB.GEOM_PRECISION,maxLon*OSHDB.GEOM_PRECISION,maxLat*OSHDB.GEOM_PRECISION);
out.printf("data.bbox=%.7f,%.7f,%.7f,%.7f%n",minLon*GEOM_PRECISION,minLat*GEOM_PRECISION,maxLon*GEOM_PRECISION,maxLat*GEOM_PRECISION);
}

out.printf("data.timerange=%s,%s%n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static TransfomRelation instance(final byte[] data, final int offset, fin

protected TransfomRelation(byte[] data, int offset, int length, byte header, long id,
long baseTimestamp, long baseLongitude, long baseLatitude, int dataOffset, int dataLength, long[] nodeIds, long[] wayIds) {
super(data, offset, length, header, id, OSHDBBoundingBox.EMPTY, baseTimestamp, baseLongitude, baseLatitude, new int[0], dataOffset, dataLength);
super(data, offset, length, header, id, new OSHDBBoundingBox(0L, 0L, 0L, 0L), baseTimestamp, baseLongitude, baseLatitude, new int[0], dataOffset, dataLength);

offsetToId = new HashMap<>(2);
offsetToId.put(OSMType.NODE,nodeIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public static TransformOSHNode instance(final byte[] data, final int offset, fin

private TransformOSHNode(final byte[] data, final int offset, final int length, final byte header, final long id,
final long baseTimestamp, final long baseLongitude, final long baseLatitude, final int dataOffset, final int dataLength) {
super(data, offset, length, header,id, OSHDBBoundingBox.EMPTY, baseTimestamp, baseLongitude, baseLatitude, new int[0], dataOffset, dataLength);
super(data, offset, length, header,id, new OSHDBBoundingBox(0L, 0L, 0L, 0L), baseTimestamp, baseLongitude, baseLatitude, new int[0], dataOffset, dataLength);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static TransformOSHWay instance(final byte[] data, final int offset, fina
}

private TransformOSHWay(final byte[] data, final int offset, final int length, byte header, final long id, final long baseTimestamp,final long baseLongitude, final long baseLatitude, final int dataOffset, final int dataLength, final long[] nodeIds) {
super(data, offset, length, header, id, OSHDBBoundingBox.EMPTY,
super(data, offset, length, header, id, new OSHDBBoundingBox(0L, 0L, 0L, 0L),
baseTimestamp, baseLongitude, baseLatitude,
new int[0],
dataOffset, dataLength);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.heigit.ohsome.oshdb.tool.importer.util;

import static org.heigit.ohsome.oshdb.OSHDB.coordinateToLong;
import static org.heigit.ohsome.oshdb.osm.Coordinates.GEOM_PRECISION_TO_LONG;
import static org.heigit.ohsome.oshdb.osm.Coordinates.coordinateToLong;

import java.util.Comparator;
import org.heigit.ohsome.oshdb.OSHDB;
import org.heigit.ohsome.oshdb.util.OSHDBBoundingBox;

public class ZGrid {
Expand Down Expand Up @@ -167,19 +167,19 @@ private static long morton(long x, long y) {
}

private static long normalizeLon(long lon) {
return lon + (long) (180.0 * OSHDB.GEOM_PRECISION_TO_LONG);
return lon + (long) (180.0 * GEOM_PRECISION_TO_LONG);
}

private static long denormalizeLon(long lon) {
return lon - (long) (180.0 * OSHDB.GEOM_PRECISION_TO_LONG);
return lon - (long) (180.0 * GEOM_PRECISION_TO_LONG);
}

private static long normalizeLat(long lat) {
return lat + (long) (90.0 * OSHDB.GEOM_PRECISION_TO_LONG);
return lat + (long) (90.0 * GEOM_PRECISION_TO_LONG);
}

private static long denormalizeLat(long lat) {
return lat - (long) (90.0 * OSHDB.GEOM_PRECISION_TO_LONG);
return lat - (long) (90.0 * GEOM_PRECISION_TO_LONG);
}

private static boolean validateLon(long lon) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.heigit.ohsome.oshdb.util.xmlreader;

import static org.heigit.ohsome.oshdb.osm.Coordinates.GEOM_PRECISION_TO_LONG;

import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.ListMultimap;
Expand All @@ -24,7 +26,6 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.heigit.ohsome.oshdb.OSHDB;
import org.heigit.ohsome.oshdb.impl.osh.OSHNodeImpl;
import org.heigit.ohsome.oshdb.impl.osh.OSHWayImpl;
import org.heigit.ohsome.oshdb.osh.OSHEntity;
Expand Down Expand Up @@ -124,8 +125,8 @@ private void read(Document doc) throws IOException {
double lon = osm.isVisible() ? attrAsDouble(e, "lon") : 0.0;
double lat = osm.isVisible() ? attrAsDouble(e, "lat") : 0.0;

long longitude = Math.round(lon * OSHDB.GEOM_PRECISION_TO_LONG);
long latitude = Math.round(lat * OSHDB.GEOM_PRECISION_TO_LONG);
long longitude = Math.round(lon * GEOM_PRECISION_TO_LONG);
long latitude = Math.round(lat * GEOM_PRECISION_TO_LONG);

osm.setExtension(longitude, latitude);

Expand Down

0 comments on commit 8db7266

Please sign in to comment.