Skip to content

Commit 314572d

Browse files
authored
Merge pull request #33 from ngageoint/develop
release 1.3.1
2 parents 53f4e00 + dfcfd5d commit 314572d

File tree

6 files changed

+41
-13
lines changed

6 files changed

+41
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Adheres to [Semantic Versioning](http://semver.org/).
44

55
---
66

7-
## 1.3.1 (TBD)
7+
## [1.3.1](https://github.com/ngageoint/geopackage-core-java/releases/tag/1.3.1) (07-13-2017)
88

9-
* TBD
9+
* Improved handling of unknown Contents bounding boxes
10+
* User table zoom level bounding of degree unit projections
11+
* Tile Bounding Box Utils method to bound degree unit bounding box with web mercator limits
1012

1113
## [1.3.0](https://github.com/ngageoint/geopackage-core-java/releases/tag/1.3.0) (06-27-2017)
1214

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ The [GeoPackage Java](https://github.com/ngageoint/geopackage-java) library is a
3737

3838
### Installation ###
3939

40-
Pull from the [Maven Central Repository](http://search.maven.org/#artifactdetails|mil.nga.geopackage|geopackage-core|1.3.0|jar) (JAR, POM, Source, Javadoc)
40+
Pull from the [Maven Central Repository](http://search.maven.org/#artifactdetails|mil.nga.geopackage|geopackage-core|1.3.1|jar) (JAR, POM, Source, Javadoc)
4141

4242
<dependency>
4343
<groupId>mil.nga.geopackage</groupId>
4444
<artifactId>geopackage-core</artifactId>
45-
<version>1.3.0</version>
45+
<version>1.3.1</version>
4646
</dependency>
4747

4848
### Build ###

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h2 class="project-tagline">by the National Geospatial-Intelligence Agency</h2>
1818
<a href="http://ngageoint.github.io/geopackage-core-java/docs/api/" class="btn">API</a>
1919
<a href="https://github.com/ngageoint/geopackage-core-java/zipball/master" class="btn">.zip</a>
2020
<a href="https://github.com/ngageoint/geopackage-core-java/tarball/master" class="btn">.tar.gz</a>
21-
<a href="http://search.maven.org/#artifactdetails|mil.nga.geopackage|geopackage-core|1.3.0|jar" class="btn">The Central Repository</a>
21+
<a href="http://search.maven.org/#artifactdetails|mil.nga.geopackage|geopackage-core|1.3.1|jar" class="btn">The Central Repository</a>
2222
</section>
2323

2424
<section class="main-content">

src/main/java/mil/nga/geopackage/core/contents/Contents.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,11 @@ public ForeignCollection<TileMatrix> getTileMatrix() {
392392
* @return bounding box
393393
*/
394394
public BoundingBox getBoundingBox() {
395-
BoundingBox boundingBox = new BoundingBox(getMinX(), getMaxX(),
396-
getMinY(), getMaxY());
395+
BoundingBox boundingBox = null;
396+
if (minX != null && maxX != null && minY != null && maxY != null) {
397+
boundingBox = new BoundingBox(getMinX(), getMaxX(), getMinY(),
398+
getMaxY());
399+
}
397400
return boundingBox;
398401
}
399402

src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,20 @@ public static double getPixelYSize(BoundingBox webMercatorBoundingBox,
905905
*/
906906
public static BoundingBox boundWgs84BoundingBoxWithWebMercatorLimits(
907907
BoundingBox boundingBox) {
908+
return boundDegreesBoundingBoxWithWebMercatorLimits(boundingBox);
909+
}
910+
911+
/**
912+
* Bound the upper and lower bounds of the degrees bounding box with web
913+
* mercator limits
914+
*
915+
* @param boundingBox
916+
* degrees bounding box
917+
* @return bounding box
918+
* @since 1.3.1
919+
*/
920+
public static BoundingBox boundDegreesBoundingBoxWithWebMercatorLimits(
921+
BoundingBox boundingBox) {
908922
BoundingBox bounded = new BoundingBox(boundingBox);
909923
if (bounded.getMinLatitude() < ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE) {
910924
bounded.setMinLatitude(ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE);

src/main/java/mil/nga/geopackage/user/UserCoreDao.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import mil.nga.geopackage.projection.ProjectionTransform;
1515
import mil.nga.geopackage.tiles.TileBoundingBoxUtils;
1616

17+
import org.osgeo.proj4j.units.DegreeUnit;
18+
1719
/**
1820
* Abstract User DAO for reading user tables
1921
*
@@ -604,13 +606,20 @@ public int getZoomLevel() {
604606
throw new GeoPackageException(
605607
"No projection was set which is required to determine the zoom level");
606608
}
609+
int zoomLevel = 0;
607610
BoundingBox boundingBox = getBoundingBox();
608-
ProjectionTransform webMercatorTransform = projection
609-
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
610-
BoundingBox webMercatorBoundingBox = webMercatorTransform
611-
.transform(boundingBox);
612-
int zoomLevel = TileBoundingBoxUtils
613-
.getZoomLevel(webMercatorBoundingBox);
611+
if (boundingBox != null) {
612+
if (projection.getUnit() instanceof DegreeUnit) {
613+
boundingBox = TileBoundingBoxUtils
614+
.boundDegreesBoundingBoxWithWebMercatorLimits(boundingBox);
615+
}
616+
ProjectionTransform webMercatorTransform = projection
617+
.getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR);
618+
BoundingBox webMercatorBoundingBox = webMercatorTransform
619+
.transform(boundingBox);
620+
zoomLevel = TileBoundingBoxUtils
621+
.getZoomLevel(webMercatorBoundingBox);
622+
}
614623
return zoomLevel;
615624
}
616625

0 commit comments

Comments
 (0)