Commit 3152a987 authored by Luna Riegel's avatar Luna Riegel
Browse files

Refactor: Rename functions

parent cc30db8a
...@@ -228,9 +228,11 @@ public class EmbeddedDatabaseHandler { ...@@ -228,9 +228,11 @@ public class EmbeddedDatabaseHandler {
public List<GmlId> getBufferIntersectingObjects(CityObject co, double bufferSize) { public List<GmlId> getBufferIntersectingObjects(CityObject co, double bufferSize) {
return getBufferIntersectingObjects(co.getGmlId(), bufferSize); return getBufferIntersectingObjects(co.getGmlId(), bufferSize);
public List<GmlId> getBufferCollisionCandidates(CityObject co, double bufferSize) {
return getBufferCollisionCandidates(co.getGmlId(), bufferSize);
} }
public List<GmlId> getBufferIntersectingObjects(GmlId gmlID, double bufferSize) { public List<GmlId> getBufferCollisionCandidates(GmlId gmlID, double bufferSize) {
List<GmlId> intersectingObjects = new ArrayList<>(); List<GmlId> intersectingObjects = new ArrayList<>();
try (Connection con = dataSource.getConnection()) { try (Connection con = dataSource.getConnection()) {
try (PreparedStatement ps = con.prepareStatement("SELECT gmlid FROM features AS tab1" + try (PreparedStatement ps = con.prepareStatement("SELECT gmlid FROM features AS tab1" +
...@@ -251,11 +253,11 @@ public class EmbeddedDatabaseHandler { ...@@ -251,11 +253,11 @@ public class EmbeddedDatabaseHandler {
return intersectingObjects; return intersectingObjects;
} }
public List<GmlId> getBBoxIntersectingObjects(CityObject co) { public List<GmlId> getBBoxCollisionCandidates(CityObject co) {
return getBBoxIntersectingObjects(co.getGmlId()); return getBBoxCollisionCandidates(co.getGmlId());
} }
public List<GmlId> getBBoxIntersectingObjects(GmlId id) { public List<GmlId> getBBoxCollisionCandidates(GmlId id) {
List<GmlId> intersectingObjects = new ArrayList<>(); List<GmlId> intersectingObjects = new ArrayList<>();
try (Connection con = dataSource.getConnection()) { try (Connection con = dataSource.getConnection()) {
......
...@@ -112,7 +112,7 @@ public class DataBaseHandlerTest { ...@@ -112,7 +112,7 @@ public class DataBaseHandlerTest {
handler.marshallCityObject(b4); handler.marshallCityObject(b4);
assertEquals(4, handler.getFeatureCount()); assertEquals(4, handler.getFeatureCount());
List<GmlId> objects = handler.getBBoxIntersectingObjects(b); List<GmlId> objects = handler.getBBoxCollisionCandidates(b);
assertEquals(1, objects.size()); assertEquals(1, objects.size());
assertEquals(4, handler.getFeatureCount()); assertEquals(4, handler.getFeatureCount());
...@@ -193,7 +193,7 @@ public class DataBaseHandlerTest { ...@@ -193,7 +193,7 @@ public class DataBaseHandlerTest {
handler.marshallCityObject(b4); handler.marshallCityObject(b4);
assertEquals(4, handler.getFeatureCount()); assertEquals(4, handler.getFeatureCount());
List<GmlId> objects = handler.getBufferIntersectingObjects(b, Math.sqrt(2)); List<GmlId> objects = handler.getBufferCollisionCandidates(b, Math.sqrt(2));
assertEquals(1, objects.size()); assertEquals(1, objects.size());
assertEquals(4, handler.getFeatureCount()); assertEquals(4, handler.getFeatureCount());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment