How can we use Mapbox JS to filter unclassified raster using image service? - raster

I want to filter the unclassified raster using image services based on the Legend Value of Raster(Image Service)
I have tried the map.setFilter to filter the class value (Legend) of the raster using image service. But, it's not working properly.

Related

Loading ESRI raster in Mapbox GL JS

Is it possible to load ESRI raster tiles from a tiles.arcgis.com service? In this mapbox demo, the line that specifies the basemap tiling service (from Stamen, in this case) is this:
'tiles': [
'https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg'
],
When I edit the fiddle example, however, and try to substitute a tileset I'm interested in using, it doesn't seem to work:
'tiles': [
'https://tiles.arcgis.com/tiles/QcN4ko50whTktDF1/arcgis/rest/services/Ortho_Midland2020_0520and0521/MapServer/tile/{z}/{x}/{y}.jpg'
],
I was able to get direct access to some of the individual tiles, like this, but can't seem to get the URL string right. Here is a page with metadata, as well as the start and end tiles for each zoom level.
Can someone please point out where I'm going wrong with that URL string? I've also changed the initial zoom and x/y to be relevant to the dataset:
center: [-84.39479, 43.820487],
zoom: 11
Here is a fiddle that I've been trying out various URLs in. I would super appreciate pointers about how to format the ESRI tileset URL for use in mapbox gl js. Thanks in advance!
Two issues:
First, the URLs should not have .jpg on the end.
Second, ArcGIS online URLs are z/y/x, not z/x/y
So the correct URL is:
https://tiles.arcgis.com/tiles/QcN4ko50whTktDF1/arcgis/rest/services/Ortho_Midland2020_0520and0521/MapServer/tile/{z}/{y}/{x}
Updated JS Fiddle: https://jsfiddle.net/stevage/z9nao1cv/4/

Here.com api, getMapPackageAtGeoCoordinates for multiple coordinates

getMapPackageAtGeoCoordinates: take only 1 value as parameter.
I've a long list of NMAGeoCoordinates and I'm looking for a way to get the "packageId" without doing multiple calls (or using a bounding box as parameter)
UPDATE
My iOS app has a list of routes (hundreds of them) and each route has multiple intermediate points.
For each route should be possible to download the map data offline.
I'm using this api:
https://developer.here.com/documentation/ios-premium/dev_guide/topics/maps-offline-maploader.html
I'm not using the other method based on NMAMapDataPrefetcher because I need to have control over packages installed.
So given a list of NMAGeoCoordinates I need to get a list of possible NMAMapPackage to download.
I can't use the start or destination coordinate because each route can include multiple countries.
I can't call getMapPackageAtGeoCoordinates multiple times to get a complete list of possible countries included in a route (it's to many calls, on the order of tens for each route)
So I'm wondering if there a better way to solve this problem, maybe using a bounding box to get all the NMAMapPackage included in a route.
I've also checked the REST api:
https://developer.here.com/documentation/routing/topics/resource-calculate-route.html
looks like there a way to calculate a route and get a summary of country traversed, usign the RouteAttributeType "summaryByCountry". The response include a field "country" using an ISO 3166-1-alpha-3 format, but there no way to convert this value to an NMAMapPackage id.
There is no other way except you describe to receive NMAMapPackage using geoCoordinates.
This is the only way to use bounding box to download area he needs without multiple invocations.
#interface NMAGeoBoundingBox : NSObject<NSCoding>
+ (nullable instancetype)geoBoundingBoxContainingGeoCoordinates:(nonnull NSArray<NMAGeoCoordinates *> *)coordinates
#interface NMAMapDataPrefetcher : NSObject
- (NSInteger)fetchMapDataForBoundingBox:(nonnull NMAGeoBoundingBox *)boundingBox
error:(NMAPrefetchRequestError *_Nullable)error
NS_SWIFT_NAME(fetchMapDataForBoundingBox(_:error:));

Exporting images in an image collection from GEE

Please I would like to know the best way to export image bands from an Image Collection in Google Earth Engine for use on my local machine. The image collection contains 21 elements which I would like to export as single image bands or an image composite of all 21 elements. How do I go about this please. Below is a code extract I have written. Thanks
var S1_1 = ee.ImageCollection('COPERNICUS/S1_GRD')
.filterBounds(SA)
.filterDate('2016-10-01', '2017-06-01')
.filterMetadata('transmitterReceiverPolarisation', 'equals', ['VV', 'VH'])
.filterMetadata('resolution_meters', 'equals' , 10);
You may want to see this answer which shows you how to turn an image collection into a single band image. From there, use Export.image.toDrive().

JMapViewer adding tiles of a region on Panel

Hi there i'm using JMapViewer to show maps in my swing app and I've successfully created a panel with map tiles on it but these map tiles are of a particular area used in demo source of Map Viewer, i'm confused about how can i show the tiles of some particular area i want. Just like Google maps i want to show some location of my country (Pakistan) in the maps and i don't know how can i do it.
Secondly, Please explain what are Layer's and Layer Group in JMapViewer? Just an idea.
Edit: how can i download tiles of Islamabad region and then add them to maps.
What i've learnt from demo is this:
private void loadMapTiles(){
map().setTileSource(new OsmTileSource.Mapnik());
map().setTileLoader(new OsmTileLoader(map()));
}
But this shows some specific area they have set to.
I've downloaded JTileDownloader but i'm confused about the url thing because i don't now where to get the url of some specific area.
Given a JMapViewer named map, something like this should display Islamabad:
Coordinate c = new Coordinate(33.7167, 73.0667);
map.setDisplayPosition(c, 10);
org.openstreetmap.gui.jmapviewer.Demo, included in the distribution, is a complete example that illustrates how to use Layer. Click the Tree Layers Visible checkbox to see the effect.
Addendum: Here's the result using MapQuest-OSM at 11x zoom; Mapnik seems to work, too. If no TileSource includes the tiles you want, you may need one of the approaches mentioned here.

Convert a Google Earth KmlPolygon into KML string

If I have a KmlPolygon object, how might I convert this to a KML string? This functionality would allow you to save whatever has been modelled and use it as a layer in Google Earth desktop for instance, or even load it back into the web plugin.
EDIT
This would do the opposite of fetchKml.
Found it. You can use the getKml() function of KmlFeature to return the KML string. You can also add multiple KmlPolygon objects by constructing a KmlDocument using the dom.buildDocument() of the utility library, and then using getKml() on that.

Resources