ただし、タイル ID を自分で計算する必要はありません。 HereTileResolver クラスを詳細に調べて、さまざまなエリアクエリーのタイル ID を計算できます。 このクラスはロケーション ライブラリの一部です。 以降の章では、タイル ID を使用してタイル情報を取得し、 HERE Tile Partitioning スキームに従ってタイル ID を計算するアプリケーションを作成します。
HERE Tile Partitioning の詳細について は、「パーティション」を参照してください。
次のコード スニペットを使用すると 19319030 、前述のサンフランシスコタイル ID に関するすべての情報を取得できます。
Scala
Java
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.BoundingBox
importcom.here.platform.location.inmemory.geospatial.TileId
importcom.here.platform.location.integration.herecommons.geospatial.{
HereTileLevel,
HereTileResolver
}object HereTileInformationTutorialScala {def main(args: Array[String]):Unit={val sanFranciscoTileId = TileId(19319030)val zoomLevel = HereTileLevel.apply(sanFranciscoTileId)
println(s"Zoom Level for Tile ${sanFranciscoTileId.value} is ${zoomLevel.value}")val boundingBox: BoundingBox = HereTileResolver.boundingBoxOf(sanFranciscoTileId)
printf(s"Bounding box for Tile ${sanFranciscoTileId.value} is $boundingBox")}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.BoundingBox;importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel;importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver;publicclassHereTileInformationTutorial{publicstaticvoidmain(String[] args){long sanFranciscoTileId =19319030L;int zoomLevel =HereTileLevel.apply(sanFranciscoTileId).value();System.out.printf("Zoom Level for Tile %s is %s%n", sanFranciscoTileId, zoomLevel);BoundingBox boundingBox =HereTileResolver.boundingBoxOf(sanFranciscoTileId);System.out.printf("Bounding box for Tile %s is %s", sanFranciscoTileId, boundingBox);}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.inmemory.geospatial.TileId
importcom.here.platform.location.integration.herecommons.geospatial.{
HereTileLevel,
HereTileResolver
}object QuadTreeTraversalTutorialScala {val ZOOM_LEVEL_TWELVE =12val ZOOM_LEVEL_FOURTEEN =14def main(args: Array[String]):Unit={val sanFranciscoTileId =19319030val resolverTwelve: HereTileResolver =new HereTileResolver(HereTileLevel(ZOOM_LEVEL_TWELVE))val resolverFourteen: HereTileResolver =new HereTileResolver(
HereTileLevel(ZOOM_LEVEL_FOURTEEN))val descendantTiles: Set[TileId]=
resolverFourteen.fromAncestorTile(TileId(sanFranciscoTileId))
println(
s"The Tile $sanFranciscoTileId (level $ZOOM_LEVEL_TWELVE) has the following descendant Tiles on level $ZOOM_LEVEL_FOURTEEN: ${descendantTiles.map(_.value).mkString(",")}")val sanFranciscoDescendantTile = descendantTiles.head
val ancestorTile: TileId =
resolverTwelve.fromDescendantTile(sanFranciscoDescendantTile)
println(
s"The tile ${sanFranciscoDescendantTile.value} (level $ZOOM_LEVEL_FOURTEEN) has the following ancestor Tile on level $ZOOM_LEVEL_TWELVE: ${ancestorTile.value}")}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel;importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver;importjava.util.Set;publicclassQuadTreeTraversalTutorial{publicstaticfinalint ZOOM_LEVEL_TWELVE =12;publicstaticfinalint ZOOM_LEVEL_FOURTEEN =14;publicstaticvoidmain(String[] args){int sanFranciscoTileId =19319030;HereTileResolver resolverTwelve =newHereTileResolver(newHereTileLevel(ZOOM_LEVEL_TWELVE));HereTileResolver resolverFourteen =newHereTileResolver(newHereTileLevel(ZOOM_LEVEL_FOURTEEN));Set<Long> descendantTiles = resolverFourteen.fromAncestorTile(sanFranciscoTileId);System.out.printf("The Tile %s (level %s) has the following descendant Tiles on level %s: %s%n",
sanFranciscoTileId, ZOOM_LEVEL_TWELVE, ZOOM_LEVEL_FOURTEEN, descendantTiles);long sanFranciscoDescendantTile = descendantTiles.stream().findFirst().get();long ancestor = resolverTwelve.fromDescendantTile(sanFranciscoDescendantTile);System.out.printf("The Tile %s (level %s) has the following ancestor Tile on level %s: %s",
sanFranciscoDescendantTile, ZOOM_LEVEL_FOURTEEN, ZOOM_LEVEL_TWELVE, ancestor);}}
The Tile 19319030 (level 12) has the following descendant Tiles on level 14: [309104494, 309104484, 309104489, 309104485, 309104481, 309104493, 309104486, 309104482, 309104492, 309104491, 309104483, 309104487, 309104480, 309104490, 309104495, 309104488]
The Tile 309104494 (level 14) has the following ancestor Tile on level 12: 19319030
ポイント検索
特定の地理座標 を含むタイル を取得する必要がある場合は、ロケーション ライブラリ HereTileResolver [ Java API | Scala API ] クラスの fromCoordinate(geoCoordinate) メソッドを使用します。
次のコード スニペットを使用 12 すると、サンフランシスコのゴールデンゲートブリッジをカバーするズーム レベルのタイル ID を取得できます。
地理座標 インスタンスは Golden Gate Bridge 、緯度 37.82171 および Golden Gate Bridge 経度を使用して作成 -122.47881されます。
Scala
Java
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.GeoCoordinate
importcom.here.platform.location.inmemory.geospatial.TileId
importcom.here.platform.location.integration.herecommons.geospatial.{
HereTileLevel,
HereTileResolver
}object HereTileWithPointTutorialScala {val ZOOM_LEVEL_TWELVE =12def main(args: Array[String]):Unit={val goldenGateBrgLatitude =37.82171val goldenGateBrgLongitude =-122.47881val hereTileResolver =new HereTileResolver(HereTileLevel(ZOOM_LEVEL_TWELVE))val geoCoordinateSanFrancisco = GeoCoordinate(goldenGateBrgLatitude, goldenGateBrgLongitude)val tileId = hereTileResolver.fromCoordinate(geoCoordinateSanFrancisco)
println(
s"Tile ${tileId.value} on level $ZOOM_LEVEL_TWELVE containing the point $geoCoordinateSanFrancisco")}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.GeoCoordinate;importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel;importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver;publicclassHereTileWithPointTutorial{publicstaticfinalint ZOOM_LEVEL_TWELVE =12;publicstaticvoidmain(String[] args){double goldenGateBrgLatitude =37.82171;double goldenGateBrgLongitude =-122.47881;HereTileResolver hereTileResolver =newHereTileResolver(newHereTileLevel(ZOOM_LEVEL_TWELVE));GeoCoordinate geoCoordinateSanFrancisco =newGeoCoordinate(goldenGateBrgLatitude, goldenGateBrgLongitude);Long tileId = hereTileResolver.fromCoordinate(geoCoordinateSanFrancisco);System.out.printf("Tile %s on level %s contains the point %s",
tileId, ZOOM_LEVEL_TWELVE, geoCoordinateSanFrancisco);}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.BoundingBox
importcom.here.platform.location.inmemory.geospatial.TileId
importcom.here.platform.location.integration.herecommons.geospatial.{
HereTileLevel,
HereTileResolver
}object HereBoundingBoxTutorialScala {val ZOOM_LEVEL_FIFTEEN =15def main(args: Array[String]):Unit={val westBoundLongitude =-122.511241val eastBoundLongitude =-122.452919val southBoundLatitude =37.763901val northBoundLatitude =37.774723val hereTileResolver =new HereTileResolver(HereTileLevel(ZOOM_LEVEL_FIFTEEN))val bbox =new BoundingBox(northBoundLatitude,
southBoundLatitude,
eastBoundLongitude,
westBoundLongitude)val tilesCoveringBbox: Set[TileId]= hereTileResolver.fromBoundingBox(bbox)
println(
s"Tiles covering $bbox on level $ZOOM_LEVEL_FIFTEEN are [${tilesCoveringBbox.map(_.value).mkString(",")}]")}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.BoundingBox;importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel;importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver;importjava.util.Set;publicclassHereBoundingBoxTutorial{publicstaticfinalint ZOOM_LEVEL_FIFTEEN =15;publicstaticvoidmain(String[] args){double westBoundLongitude =-122.511241;double eastBoundLongitude =-122.452919;double southBoundLatitude =37.763901;double northBoundLatitude =37.774723;HereTileResolver hereTileResolver =newHereTileResolver(newHereTileLevel(ZOOM_LEVEL_FIFTEEN));BoundingBox bbox =newBoundingBox(
northBoundLatitude, southBoundLatitude, eastBoundLongitude, westBoundLongitude);Set<Long> tilesCoveringBbox = hereTileResolver.fromBoundingBox(bbox);System.out.printf("Tiles covering %s on level %s are %s", bbox, ZOOM_LEVEL_FIFTEEN, tilesCoveringBbox);}}
Java と Scala の両方で次のアプリケーションを実行すると、 Holly Park サンフランシスコのジオコード化された円と 150 ズーム レベルを使用した半径メーターをカバーするタイルが返さ 18れます。 地理座標 インスタンスは Holly Park 、緯度 37.74638 および Holy Park 経度を使用して作成 -122.43584されます。
次の図は、半径 150 がメートルの円を示し Holy Park ています。この円は、カバーと、この円をカバーする 4 つのタイルで構成されています。
Scala
Java
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.GeoCoordinate
importcom.here.platform.location.inmemory.geospatial.TileId
importcom.here.platform.location.integration.herecommons.geospatial.{
HereTileLevel,
HereTileResolver
}object HereTileRadiusSearchScala {val ZOOM_LEVEL_EIGHTEEN =18def main(args: Array[String]):Unit={val sanFranciscoLatitude =37.73721val sanFranciscoLongitude =-122.41994val radiusInMeters =100val hereTileResolver =new HereTileResolver(HereTileLevel(ZOOM_LEVEL_EIGHTEEN))val sanFranciscoGeoCoordinates =new GeoCoordinate(sanFranciscoLatitude, sanFranciscoLongitude)val tilesCoveringCircle: Set[TileId]=
hereTileResolver.fromCenterAndRadius(sanFranciscoGeoCoordinates, radiusInMeters)
println(
s"A circle with a center at $sanFranciscoGeoCoordinates and radius of $radiusInMeters meters covers the following tiles on level $ZOOM_LEVEL_EIGHTEEN: ${tilesCoveringCircle
.map(_.value).mkString(", ")}")}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.GeoCoordinate;importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel;importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver;importjava.util.Set;publicclassHereTileRadiusSearchTutorial{publicstaticfinalint ZOOM_LEVEL_EIGHTEEN =18;publicstaticvoidmain(String[] args){double sanFranciscoLatitude =37.73721;double sanFranciscoLongitude =-122.41994;double radiusInMeters =100;HereTileResolver hereTileResolver =newHereTileResolver(newHereTileLevel(ZOOM_LEVEL_EIGHTEEN));GeoCoordinate geoCoordinateSanFrancisco =newGeoCoordinate(sanFranciscoLatitude, sanFranciscoLongitude);Set<Long> tilesCoveringCircle =
hereTileResolver.fromCenterAndRadius(geoCoordinateSanFrancisco, radiusInMeters);System.out.printf("A circle with a center at %s and radius of %s meters covers the following tiles on level %s: %s",
geoCoordinateSanFrancisco, radiusInMeters, ZOOM_LEVEL_EIGHTEEN, tilesCoveringCircle);}}
A circle with a center at 37.73721,-122.41994 and radius of 100.0 meters covers the following tiles on level 18: [79130751637, 79130751551, 79130751592, 79130751680, 79130751594, 79130751681, 79130751549, 79130751595, 79130751593]
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/caseclass GeoCoordinateScala(latitude:Double, longitude:Double){def getLatitude:Double= latitude
def getLongitude:Double= longitude
}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/publicclassGeoCoordinateJava{privatedouble latitude;privatedouble longitude;publicGeoCoordinateJava(double latitude,double longitude){this.latitude = latitude;this.longitude = longitude;}publicdoublegetLatitude(){return latitude;}publicdoublegetLongitude(){return longitude;}@OverridepublicStringtoString(){returnString.format("(%s,%s)", latitude, longitude);}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.javadsl.GeoCoordinateAdapter
class GeoCoordinateAdapterScala privateextends GeoCoordinateAdapter[GeoCoordinateScala]{overridedef getLatitude(instance: GeoCoordinateScala):Double= instance.latitude
overridedef getLongitude(instance: GeoCoordinateScala):Double= instance.longitude
}object GeoCoordinateAdapterScala {lazyval getInstance =new GeoCoordinateAdapterScala()}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.javadsl.GeoCoordinateAdapter;publicclassGeoCoordinateAdapterJavaimplementsGeoCoordinateAdapter<GeoCoordinateJava>{privateGeoCoordinateAdapterJava(){}@OverridepublicdoublegetLatitude(GeoCoordinateJava instance){return instance.getLatitude();}@OverridepublicdoublegetLongitude(GeoCoordinateJava instance){return instance.getLongitude();}publicstaticGeoCoordinateAdapterJavagetInstance(){returnnewGeoCoordinateAdapterJava();}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.javadsl.GeoCoordinateAdapter
importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel
importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver
import java.{lang, util};object HereTileRadiusSearchWithGcAdapterTutorialScala {val ZOOM_LEVEL_EIGHTEEN =18def main(args: Array[String]):Unit={val sanFranciscoLatitude =37.73721val sanFranciscoLongitude =-122.41994val radiusInMeters =100val hereTileResolver =new HereTileResolver(new HereTileLevel(ZOOM_LEVEL_EIGHTEEN))val gca: GeoCoordinateAdapter[GeoCoordinateScala]= GeoCoordinateAdapterScala.getInstance
val geoCoordinateSanFrancisco: GeoCoordinateScala =
GeoCoordinateScala(sanFranciscoLatitude, sanFranciscoLongitude)val tilesCoveringCircle: util.Set[lang.Long]=
hereTileResolver.fromCenterAndRadius(geoCoordinateSanFrancisco, radiusInMeters)(gca)
println(
s"A circle with a center at $geoCoordinateSanFrancisco and radius of $radiusInMeters meters covers the following tiles on level $ZOOM_LEVEL_EIGHTEEN: $tilesCoveringCircle")}}
/*
* Copyright (c) 2018-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/importcom.here.platform.location.core.geospatial.javadsl.GeoCoordinateAdapter;importcom.here.platform.location.integration.herecommons.geospatial.HereTileLevel;importcom.here.platform.location.integration.herecommons.geospatial.javadsl.HereTileResolver;importjava.util.Set;publicclassHereTileRadiusSearchWithGcAdapterTutorial{publicstaticfinalint ZOOM_LEVEL_EIGHTEEN =18;publicstaticvoidmain(String[] args){double sanFranciscoLatitude =37.73721;double sanFranciscoLongitude =-122.41994;double radiusInMeters =100;HereTileResolver hereTileResolver =newHereTileResolver(newHereTileLevel(ZOOM_LEVEL_EIGHTEEN));GeoCoordinateAdapter<GeoCoordinateJava> gca =GeoCoordinateAdapterJava.getInstance();GeoCoordinateJava geoCoordinateSanFrancisco =newGeoCoordinateJava(sanFranciscoLatitude, sanFranciscoLongitude);Set<Long> tilesCoveringCircle =
hereTileResolver.fromCenterAndRadius(geoCoordinateSanFrancisco, radiusInMeters, gca);System.out.printf("A circle with a center at %s and radius of %s meters covers the following tiles on level %s: %s",
geoCoordinateSanFrancisco, radiusInMeters, ZOOM_LEVEL_EIGHTEEN, tilesCoveringCircle);}}
A circle with a center at 37.73721,-122.41994 and radius of 100.0 meters covers the following tiles on level 18: [79130751637, 79130751551, 79130751592, 79130751680, 79130751594, 79130751681, 79130751549, 79130751595, 79130751593]