9494import mil .nga .geopackage .core .srs .SpatialReferenceSystem ;
9595import mil .nga .geopackage .extension .link .FeatureTileTableLinker ;
9696import mil .nga .geopackage .extension .scale .TileScaling ;
97- import mil .nga .geopackage .extension .scale .TileScalingType ;
9897import mil .nga .geopackage .extension .scale .TileTableScaling ;
9998import mil .nga .geopackage .factory .GeoPackageFactory ;
10099import mil .nga .geopackage .features .columns .GeometryColumns ;
128127import mil .nga .geopackage .map .tiles .overlay .FeatureOverlay ;
129128import mil .nga .geopackage .map .tiles .overlay .FeatureOverlayQuery ;
130129import mil .nga .geopackage .map .tiles .overlay .GeoPackageOverlayFactory ;
131- import mil .nga .geopackage .projection .ProjectionConstants ;
132- import mil .nga .geopackage .projection .ProjectionFactory ;
133- import mil .nga .geopackage .projection .ProjectionTransform ;
134130import mil .nga .geopackage .schema .columns .DataColumns ;
135131import mil .nga .geopackage .schema .columns .DataColumnsDao ;
136132import mil .nga .geopackage .tiles .TileBoundingBoxUtils ;
155151import mil .nga .sf .GeometryEnvelope ;
156152import mil .nga .sf .GeometryType ;
157153import mil .nga .sf .LineString ;
154+ import mil .nga .sf .proj .ProjectionConstants ;
155+ import mil .nga .sf .proj .ProjectionFactory ;
156+ import mil .nga .sf .proj .ProjectionTransform ;
158157import mil .nga .sf .util .GeometryEnvelopeBuilder ;
159158import mil .nga .sf .util .GeometryPrinter ;
160159
@@ -1715,21 +1714,19 @@ private void zoomToActiveBounds() {
17151714 */
17161715 private BoundingBox transformBoundingBoxToWgs84 (BoundingBox boundingBox , SpatialReferenceSystem srs ) {
17171716
1718- mil .nga .geopackage .projection .Projection projection = ProjectionFactory .getProjection (
1719- srs );
1717+ mil .nga .sf .proj .Projection projection = srs .getProjection ();
17201718 if (projection .getUnit () instanceof DegreeUnit ) {
17211719 boundingBox = TileBoundingBoxUtils .boundDegreesBoundingBoxWithWebMercatorLimits (boundingBox );
17221720 }
17231721 ProjectionTransform transformToWebMercator = projection
17241722 .getTransformation (
17251723 ProjectionConstants .EPSG_WEB_MERCATOR );
1726- BoundingBox webMercatorBoundingBox = transformToWebMercator .transform (boundingBox );
1724+ BoundingBox webMercatorBoundingBox = boundingBox .transform (transformToWebMercator );
17271725 ProjectionTransform transform = ProjectionFactory .getProjection (
17281726 ProjectionConstants .EPSG_WEB_MERCATOR )
17291727 .getTransformation (
17301728 ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM );
1731- boundingBox = transform
1732- .transform (webMercatorBoundingBox );
1729+ boundingBox = webMercatorBoundingBox .transform (transform );
17331730 return boundingBox ;
17341731 }
17351732
@@ -2230,7 +2227,7 @@ private void displayFeatures(MapFeaturesUpdateTask task,
22302227
22312228 if (!task .isCancelled () && count .get () < maxFeatures ) {
22322229
2233- mil .nga .geopackage . projection .Projection mapViewProjection = ProjectionFactory .getProjection (ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM );
2230+ mil .nga .sf . proj .Projection mapViewProjection = ProjectionFactory .getProjection (ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM );
22342231
22352232 FeatureIndexManager indexer = new FeatureIndexManager (getActivity (), geoPackage , featureDao );
22362233 if (filter && indexer .isIndexed ()) {
@@ -2251,10 +2248,10 @@ private void displayFeatures(MapFeaturesUpdateTask task,
22512248 double filterMaxLongitude = 0 ;
22522249
22532250 if (filter ) {
2254- mil .nga .geopackage . projection .Projection featureProjection = featureDao .getProjection ();
2251+ mil .nga .sf . proj .Projection featureProjection = featureDao .getProjection ();
22552252 ProjectionTransform projectionTransform = mapViewProjection .getTransformation (featureProjection );
22562253 BoundingBox boundedMapViewBoundingBox = mapViewBoundingBox .boundWgs84Coordinates ();
2257- BoundingBox transformedBoundingBox = projectionTransform .transform (boundedMapViewBoundingBox );
2254+ BoundingBox transformedBoundingBox = boundedMapViewBoundingBox .transform (projectionTransform );
22582255 Unit unit = featureProjection .getUnit ();
22592256 if (unit instanceof DegreeUnit ) {
22602257 filterMaxLongitude = ProjectionConstants .WGS84_HALF_WORLD_LON_WIDTH ;
@@ -2847,10 +2844,10 @@ private void displayTiles(GeoPackageTileTable tiles) {
28472844 Contents contents = tileMatrixSet .getContents ();
28482845 BoundingBox contentsBoundingBox = contents .getBoundingBox ();
28492846 if (contentsBoundingBox != null ) {
2850- ProjectionTransform transform = ProjectionFactory . getProjection ( contents .getSrs ()).getTransformation (tileMatrixSet .getSrs ());
2847+ ProjectionTransform transform = contents .getSrs (). getProjection ( ).getTransformation (tileMatrixSet .getSrs (). getProjection ());
28512848 BoundingBox transformedContentsBoundingBox = contentsBoundingBox ;
28522849 if (!transform .isSameProjection ()) {
2853- transformedContentsBoundingBox = transform .transform (transformedContentsBoundingBox );
2850+ transformedContentsBoundingBox = transformedContentsBoundingBox .transform (transform );
28542851 }
28552852 displayBoundingBox = TileBoundingBoxUtils .overlap (displayBoundingBox , transformedContentsBoundingBox );
28562853 }
@@ -3380,7 +3377,7 @@ public void onMapClick(LatLng point) {
33803377
33813378 BoundingBox clickBoundingBox = MapUtils .buildClickBoundingBox (point , view , map , screenClickPercentage );
33823379 clickBoundingBox = clickBoundingBox .expandWgs84Coordinates ();
3383- mil .nga .geopackage . projection .Projection clickProjection = ProjectionFactory .getProjection (ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM );
3380+ mil .nga .sf . proj .Projection clickProjection = ProjectionFactory .getProjection (ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM );
33843381
33853382 double tolerance = MapUtils .getToleranceDistance (point , view , map , screenClickPercentage );
33863383
@@ -3409,10 +3406,10 @@ public void onMapClick(LatLng point) {
34093406
34103407 } else {
34113408
3412- mil .nga .geopackage . projection .Projection featureProjection = featureDao .getProjection ();
3409+ mil .nga .sf . proj .Projection featureProjection = featureDao .getProjection ();
34133410 ProjectionTransform projectionTransform = clickProjection .getTransformation (featureProjection );
34143411 BoundingBox boundedClickBoundingBox = clickBoundingBox .boundWgs84Coordinates ();
3415- BoundingBox transformedBoundingBox = projectionTransform .transform (boundedClickBoundingBox );
3412+ BoundingBox transformedBoundingBox = boundedClickBoundingBox .transform (projectionTransform );
34163413 Unit unit = featureProjection .getUnit ();
34173414 double filterMaxLongitude = 0 ;
34183415 if (unit instanceof DegreeUnit ) {
@@ -4141,7 +4138,7 @@ private void createTiles() {
41414138 ProjectionTransform webMercatorTransform = ProjectionFactory .getProjection (ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM )
41424139 .getTransformation (ProjectionConstants .EPSG_WEB_MERCATOR );
41434140 BoundingBox bbox = new BoundingBox (minLon , minLat , maxLon , maxLat );
4144- BoundingBox webMercatorBoundingBox = webMercatorTransform .transform (bbox );
4141+ BoundingBox webMercatorBoundingBox = bbox .transform (webMercatorTransform );
41454142 int zoomLevel = TileBoundingBoxUtils .getZoomLevel (webMercatorBoundingBox );
41464143 int maxZoomLevel = getActivity ().getResources ().getInteger (
41474144 R .integer .load_tiles_max_zoom_default );
@@ -4445,7 +4442,7 @@ private void createFeatureTiles(final String database, final String featureTable
44454442 ProjectionTransform webMercatorTransform = ProjectionFactory .getProjection (ProjectionConstants .EPSG_WORLD_GEODETIC_SYSTEM )
44464443 .getTransformation (ProjectionConstants .EPSG_WEB_MERCATOR );
44474444 BoundingBox bbox = new BoundingBox (minLon , minLat , maxLon , maxLat );
4448- BoundingBox webMercatorBoundingBox = webMercatorTransform .transform (bbox );
4445+ BoundingBox webMercatorBoundingBox = bbox .transform (webMercatorTransform );
44494446 int zoomLevel = TileBoundingBoxUtils .getZoomLevel (webMercatorBoundingBox );
44504447 int maxZoomLevel = getActivity ().getResources ().getInteger (
44514448 R .integer .load_tiles_max_zoom_default );
0 commit comments