Skip to content

Commit

Permalink
fix dbhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
moovida committed Feb 7, 2024
1 parent 41ca3d1 commit 373340f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ public static DefaultFeatureCollection runRawSqlToFeatureCollection( String name
tableName = afterFrom.substring(0, nextAp);
} else {
int nextSpace = afterFrom.indexOf(' ');
tableName = afterFrom.substring(0, nextSpace);
if (nextSpace == -1) {
tableName = afterFrom;
}else {
tableName = afterFrom.substring(0, nextSpace);
}
}

if (tableName == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ public void testTransformationUtils() throws Exception {
assertEquals(4000, (int) transformed.getY());
}

public void testTransformationUtilsTmp() throws Exception {
Envelope env = new Envelope(11.337890625, 11.42578125, 44.465151013519616, 44.5278427984555);
Rectangle rect = new Rectangle(0, 0, 512, 512);

AffineTransformation worldToPixel = TransformationUtils.getWorldToRectangle(env, rect);

Coordinate srcPt = new Coordinate(150.0, 3000.0);
Coordinate transformed = worldToPixel.transform(srcPt, new Coordinate());
assertEquals(50, (int) transformed.x);
assertEquals(2000, (int) transformed.y);

srcPt = new Coordinate(100.0, 1000.0);
transformed = worldToPixel.transform(srcPt, new Coordinate());
assertEquals(0, (int) transformed.x);
assertEquals(4000, (int) transformed.y);
}

public void testTransformationUtils2() throws Exception {
Envelope env = new Envelope(100, 200, 1000, 5000);
Rectangle rect = new Rectangle(0, 0, 100, 4000);
Expand Down

0 comments on commit 373340f

Please sign in to comment.