Open binu8051 opened 2 years ago
any tips please.
Do you have separate data set for the shoreline or do you intend to use vector tiles? If you have a separate dataset (a GeoJSON file, for example), you can probably use 'search API' of the SDK and simply set search radius to 1KM. If you want to reuse vector tiles, then I think this is not currently possible, as shoreline (land) is not explicitly encoded in the tiles.
Thanks, i can find the coatline GeoJSON file from here https://github.com/OSGeo/PROJ/blob/master/docs/plot/data/coastline50.geojson
Can i get some sample codes for the search API. BTW my app is completely offline app.
@binu8051 Here are roughly the steps you need to do:
FeatureCollection
from your GeoJSONFeatureCollectionSearchService
instance using your feature collectionSearchRequest
specifying your GPS position as geometry and defining proper search radius (1000m in your case)findFeatures
method of search servive using your search request and check whether the result is empty or not.Note that the result will contain the nearest shoreline segment (if within your search radius), but you will not get the nearest point in the result. Also, the search could be slow and should be done in a background thread.
Hi my app is used by the fishermen and i need to alert them when they come closest to the sea shore. for example 1kilometer. How to calculate the distance between the current location to nearest sea shore? which map i need to use, now i am using this as basemap https://github.com/CartoDB/mobile-android-maps-app/blob/master/maps-app/src/main/assets/world-carto.streets-z0-4.mbtiles Thanks