How to time-enable a raster layer using ArcGIS Javascript API? - raster

I have a set of raster layers that cover the same place, over different years. I want to display it on my website using the timeslider so that I can clearly view the changes between rasters over different years. However, the example given by ESRI site is based on featurelayer, and I have a raster layer. How can I make the raster layer time-aware?

If you currently have multiple raster layers, you will need to convert them to a single layer that also happens to be time-aware.
Esri Support wrote a blog post about this -- back in 2011, but the principles should still work -- and a GIS StackExchange question covers publication of time-aware datasets as an image service. To summarize their workflow:
Create a new mosaic dataset or raster catalog. Add the individual rasters in.
Add a new field, of type date (e.g. year).
Populate year with values.
Enable time on the layer, and publish it as an image service.
The Esri JavaScript API example will help with implementation, once you've got everything configured and published.

Related

Acquire and reconstruct map from online interactive maps

I am scraping data from some interactive maps, including markers locations, and would like to acquire and reconstruct the map image to use with those markers. For example, consider the map for the videogame Elden Ring provided by Map Genie here.
From what I understand, the tiles are 256x256 and are fetched depending on the user's view position and their zoom.
I am unaware how I may programmatically acquire all the map tiles (and put them together) such that it still relates to the longitude/latitude data of the scraped markers. I generally use Selenium in python to scrape web data, but in this instance, the data is 'dynamically fetched', and I'm not sure how to start.

Extracting Polygons from Online Map

The below linked map contains a number of layers which I would like to be able to extract as polygons [if possible]. I've not previously done any web-scraping and realise that doing so in regards to the geographic data on this system represents a significant challenge.
Ideally I would only want to extract the data relating to the 'Shopping Local Centre' category.
Happy to try to use Phython or R to achieve such, just wondered if anyone had any ideas.....
Web scraping (using BeautifulSoup, for example) would get you the HTML objects from a webpage. You would need basic knowledge of Python for this.
Or you could avoid that by going this route:
With QGIS and Geofabrik you can gather retail location polygons and their attributes of a given area.
Use Geofabrik to download your area of interest in *.shp (shapefile) format. It looks like you're in Greater Manchester, so I navigated to the download page here (it's a 50MB file for the greater-manchester-latest-free.shp.zip).
Once you download that, open it in QGIS and you'll see in the attributes it has retail locations.
That site is using WMS to display the map (I work for the company that makes iShare) so there is no vector content for you to scrape as it works entirely with images.
The easiest way to get the data would be to ask the council to provide it, you might need to make it a freedom of information request but they should be happy to provide the data in a usable GIS format.

Drawing HERE Data on to ESRI JS Map

I am currently investigating the possibility of utilising the HERE APIs as source data inputs into possible solutions we would like to develop as a company on ESRI.
I understand that any data we retrieve from the API, i would need to create ESRI objects on the fly, and add them to an ESRI map layer.
However, one thing that is not clear in my mind, is how to calculate the tiles for my particular map extent.
The REST API specifies some base information, regarding calculating tiles based on lat lon - but what is the lat/lon of? is the map center? is it the bottom left or bottom right?
Are there any JS helper methods that HERE have, that would calculate the tiles required for a particular extent?
Are you referring to this documentation part: https://developer.here.com/documentation/map-tile/common/map_tile/topics/mercator-projection.html ?
It is the coordinate of the part of the map which you want to display e.g. the center of your map view.

what is the MapBox solution to add a vector-tile layer into Leaflet map?

Background:
Leaflet map
a vector tile layer
MapBox Studio to generate vector tiles (protocol buffer format)
MapBox.com for tile hosting
using Leaflet.MapboxVectorTile plugin to parse and render MapBox vector tiles
Issues:
Cannot get original feature geometry: I wanted to fetch feature geometry so can zoom to it e.g. when user clicks at it. But this plugin (Leaflet.MapboxVectorTile) doesn't have a clear way to do so. The geom values (including BBOX) are all in relative coordinates (i.e., not the original geometry)
Poor capability in identifying feature (click/hover): Another problem with this plugin is its identification algorithm is not robust enough. The authors disabled hover-identify as it turns out to be very slow. For clicking, I noticed sometimes it's hard to select a polygon (happens for some polygons and depends on where you clicked within the polygon), you have to click at certain locations so the plugin is able to identify the feature.
This plugin is very good in my experience except for above two issues.
My Questions:
Is there a counterpart MapBox solution that does the similar thing to this plugin? In other words, to parse and render a vector tile layer service on map, with support in robust feature identifying and ability to fetch feature geometry?
Currently the tiles generated in MapBox studio is in .pbf which is great in terms of efficient data transmission. I wonder if it supports JSON format (GeoJSON or TopoJSON) out of box? If it does, I probably could try using MapBox.JS featureLayer to consume vector tile json data.
I understand MapBOX GL.js is designed for vector tile based maps. I am looking for adding a vector tile layer though.
appreciate any response. thanks!
You'll want to try out mapbox-gl-leaflet, a library that integrates the efficient Mapbox GL library into Leaflet as a layer.
Cannot get original feature geometry
Vector tiles do not contain the original feature geometry. Mapbox GL does provide an api that delivers GeoJSON, but it isn't going to be your raw data: if it was, then the map would be slow and inefficient, since raw data is over-detailed.

Drill down in SSRS US Map Reports

I have been interested in map reporting, so I wanted to create a map report with drill down functionality, so basically created two reports as follows:
a) Main report based on SQL Server Spatial data for showing US States wide sales
b) Drill down map report based on ESRI shapfile for showing US Counties sales for the selected state
I downloaded the US Counties ESRI shapefile.
Once I was done with the reports, I tested the map with drilldown functionality. I previewed the main report, hover the mouse over Texas and I don't see the counties for Texas state. I see only a map of the US with tiny dots.
So, I am not sure what I missed. I chose County Name column from the spatial data and also the county name from the analytical dataset. Is it the ESRI shapefile?
Please advise.
To my knowledge SSRS does not support 'hover over' features only an 'action' feature. The action can go to a hyperlink, go to a report, or go to a section. To do a drill down for a report, even if it is geographic you need to have a reference to something you can pass to something else. I recently did something similar to what you are asking though. You can make a 'subreport' that dynamically gets created from a geographic data type that represents states. What I did:
I downloaded a program that takes Census shape files and puts them into a SQL database:
http://www.sharpgis.net/page/sql-server-2008-spatial-tools.aspx
I got a shape file of the counties of the US from the Census.
I created a database called 'Spatial'
I created a table and inserted data into it from step 1's app called 'Counties'
I created a generic US map as my 'Main' report, using the geographic options for the US.
I created a subreport of a map type but chose the spatial data wizard. The options are not that important to get started but HOW you make the image. This report gets it's data from the 'geographic' column of the table I made so the query would be like this(ensure to have a datasource go to the Spatial Database):
Select StateName, Counties, geog(geographic type)
from UsCounties
where StateName = #State
The report when done looks like a blob, because it is created at run time, not statically. You can 'preview' it and pass in a state like 'OR' or 'WA' from a variable that should be created called 'State'. If it was not auto created you may do so and make it a 'Text' variable. It will display the state shape if it was set up correct.
You may go back to the report in step 5 and then go to the 'Polygon Properties' of the layer you created.
Select the 'Action' pane on the left. Choose 'Go to report', specify the sub report you created, the report will want a variable match for 'State' the generic US state has an 'Abbreviation' that corresponds to the state two digit code.
Now you should be able to run the main report and when you click anywhere in a state it will 'drillthrough' to a report that is created at runtime from the spatial database. This is vector based so it is fairly quick depending on your hardware hosting your machine and how much data you show.
Keep in mind that with SSRS it is hard to make it have some 3d features and hover over for some reason is completely ignored for objects but is relegated to only 'tooltips' which you can load up with functions to give text and numbers but not much more. There is a hack I wrote in another place of how you can use javascript to pop out a window, but under the hood you are really just doing a drill through presented differently.

Resources