|
POST
|
I think I've painted myself into a corner and I'm not sure how to get what I want. I'm developing a web application which will utilize NWS weather radar images as an overlay option. The images are always being refreshed but are only accessible as GIF files. Within my app, I'm pulling in these images directly from the NWS and adding them into my map as a mapImageLayer and they work great. The problem is that this layer type does not support an identify/query on the pixel values. I thought a possible workaround was to publish the "Get Cell Value" tool from ArcToolBox (Data Management->Raster->Raster Properties) as a geoprocessing service and then pass the URL of my radar image to query the values. My GP service actually works but always returns NoData because the GIF files as provided by the NWS do not have embedded georeferenced information. That information *IS* known and can be put into a world file but the GP service doesn't see it when the input raster is from a remote location (hence the NoData values). I tested this theory by passing a local network copy of the file complete with world file to my GP service and it returned a valid value. So- the trick is how can I supply that spatial reference for an image I'm not hosting so that the GP task recognizes it and returns a proper value? I don't know if this is possible but the only thing I could come up with was to "pause" processing after the scratch workspace was established and then add the world file for the image into the workspace and continue the GP process. This would be SOOOO much easier if the JS API just supported identify/queryTasks on mapImageLayers. Oh well. Anyone have ideas? Steve
... View more
03-05-2013
07:56 AM
|
0
|
0
|
2187
|
|
POST
|
Bump. Anyone? Bueller? If it's not supported within the API, can this be done with a GP service? I noticed that in ArcToolbox there's a "Get Cell Value" tool under Data Management->Raster->Raster Properties. I wonder if that tool can be published as a GP service and then used with my mapImageLayer..
... View more
03-04-2013
07:11 AM
|
0
|
0
|
455
|
|
POST
|
This link is where you'll find the latest (previous) versions of the API.
... View more
03-02-2013
09:48 AM
|
0
|
0
|
659
|
|
POST
|
EXAMPLE: animating images using mapImageLayer Hey everyone, I'm excited about something I just cooked up and wanted to pass it along for others to use. I've been spending a lot of quality time trying to incorporate weather radar overlays into my current project. I've been able to add them to my map as a mapImageLayer successfully and one of the comments I received back from a co-worker was can you loop the radar image? As designed, mapImageLayers don't have any animation functionality but I thought you might be able to fudge it using javascript's window.setInterval method and then shuffling out the mapImage in the layer at a given interval. Sure enough- you can! I have set up a fiddle for it here: http://jsfiddle.net/scole/maDXn/ The ideal use for this is animating radar images and this is exactly what I'm using it for. If you're interested in using it for this purpose, read on... To set things up, first you need to figure out what your local radar site is named and what radar product you want to use. My suggestion is to go to this NWS site and click on the symbol closest to your location. Once you click on that symbol, the current radar image will be displayed. On that dialog, look in the upper left corner where it says "Adjacent Radars." The three letter code in the center is the name of the radar that you are using. Jot that down because you'll need that later. The next thing you need to do is determine the parameters for the mapImage representation of the radar image. The easiest way to do this is to visit this NWS page and download one of their KMZ files for the radar and product you want to incorporate. Find your radar under the "All images for single radar" combo box and grab the KMZ file. Open the KMZ in Google Earth and then drill down into the folder of the product you want to use (Short-Range Reflectivity, 1-Hour Precipitation, etc). Right click and access the properties of the image overlay. Go to the Location tab and jot down what the lat/long bounding box is for that particular product (this will vary from product to product but it is consistent between images). These are the lat/longs you'll specify in my example code while defining the mapImage. Lastly, go to the NWS image file site and then follow the link listed there for the accessing the individual radar site images. They are arranged into subfolders according to the product (reflectivity, 1-hour precipitation, etc). Now- within the product folder, there will be many subfolders along with GIF images (which are actually the "current" radar image). Each subfolder name is the name of the radar site, which you jotted down earlier. The folder contains an archive of previous radar images and this is where we will get our individual images for the animation. Inside the folder you will see a series of GIFs that have the naming format of <Radar Site abbreviation>_<Date>_<Time>_<Product>.gif and the most recent images are found at the bottom of the directory. To taylor this example for location, simply update the URL found in the getNwsFileList function at the line that starts with "loadContents" with the URL of the folder I was just describing. The code will digest the list of files on that site and push them into an array of file names. You'll also have to update the parameters for the mapImage as previously discussed. My little solution is still a little rough around the edges- it's a little too jerky the first run since it's loading the images into the browser's cache. Once it does, though, the animation runs pretty nice. I tried commenting my code throughout so hopefully that all makes sense. You may have noticed on ESRI's blog this week a post about a web map that also incorporates a radar animation. It draws upon a NWS REST service with 1km cell resolution and looks pretty bad zoomed in. For whatever reason, the images I am using in my example have a finer resolution and hold up better while zoomed in. Maybe because they are regional images instead of country wide, I dunno. Anyways, I hope this proves useful for others. Naturally, it would be great if this was built into the API but this could be an acceptable workaround. I have submitted an idea for adding this functionality to the API if you're so inclined to vote for it. I have attached the code for posterity. Enjoy! Steve
... View more
02-28-2013
07:18 AM
|
0
|
0
|
1733
|
|
POST
|
This has me stumped. I want to access the pixel values of a mapImageLayer and provide the user with an infoWindow where they clicked to return some related information. QueryTask and IdentifyTask only take URLs from REST services so how (can) one do an infoWindow with mapImageLayers? Thanks- Steve
... View more
02-22-2013
07:53 AM
|
0
|
1
|
741
|
|
POST
|
In my current app I'm developing, I am adding weather radar images from the NWS as mapImageLayers and they display just fine. The source images have a static URL and refresh themselves every two minutes. My desire is to have my application utilize the most current version. I already have a five minute timer associated with my page because there is another data layer which requires updating every five minutes. I'm trying to add some additional code in my updating subroutine to update my mapImageLayers but visibly, nothing is changing. Here's a snippit of my attempted updating code: // Define the NWS Storm Total Precip Layer
stormPrecipMi = new esri.layers.MapImage({
'extent': { 'xmin': -125.725647, 'ymin': 45.22319, 'xmax': -119.251570, 'ymax': 51.156890, 'spatialReference': { 'wkid': 4326 }},
'href': "http://radar.weather.gov/ridge/RadarImg/NTP/ATX_NTP_0.gif"
});
stormPrecipMi.height = 550;
stormPrecipMi.width = 600;
stormPrecipMi.scale = 1;
if (nwsStormPrecipLayer != undefined) {
nwsStormPrecipLayer.removeAllImages;
nwsStormPrecipLayer.addImage(stormPrecipMi);
}
map.setExtent(map.extent); In my code my layer variables are declared globally and no errors are generated in the console window. FWIW, here's my live app: http://gismaps.snoco.org/fws/ Right now, the only way to get updated images is to physically reload the page. Is there another way? Thanks- Steve
... View more
02-21-2013
01:27 PM
|
0
|
0
|
1009
|
|
POST
|
Thanks guys for the responses. I would have hoped for some more but such is life. Unavailable services seem to be my biggest fear so Matt's link to the Service Notification script was worth it. I wasn't aware of that before and will definitely get that set up within our organization.
... View more
02-19-2013
09:28 AM
|
0
|
0
|
777
|
|
POST
|
This is more of an open ended discussion and general question- As I debug my application more and get it ready for deployment, I've thought more about the post-development phase of an application and one large question has been looming- how do you stay informed about when your app fails? One situation that comes to mind is when the map services you are utilizing in your map are not available. For example, yesterday and into this morning, I noticed that the layers in my app weren't loading correctly and that the JSON requests were timing out. As it turns out, our Server ran out of disk space. Since I'm actively developing and debugging I can take action fairly quickly; once we publish, however, how do I get timely indications of problems without having to constantly monitor its performance manually (or worse yet get informed by a user)? Thanks! Steve
... View more
02-14-2013
06:10 AM
|
0
|
3
|
1167
|
|
POST
|
I thought that the first layer added to the map had to be a base map (or was treated as such). With that logic, maybe you can just add the basemap but pass the option to make the basemap invisible: // Create the map
var map = new esri.Map("map", {
extent:initExtent //initExtent is a variable w/ your initial extent
});
// Set up and establish the data layers for the map, beginning with the basemap
var primaryMapServiceURL = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
var theBasemap = new esri.layers.ArcGISTiledMapServiceLayer(primaryMapServiceURL, {
visible: false
});
map.addLayer(theBasemap); The above code is from v2.8 of the API..
... View more
02-13-2013
02:06 PM
|
0
|
0
|
3483
|
|
POST
|
@Diana- Thanks for posting that! I've been looking for that reference for the last week and couldn't remember where I had originally read that. You just saved me a whole lot of headache trying to find it again. 😄
... View more
02-13-2013
11:46 AM
|
0
|
0
|
931
|
|
POST
|
Awesome- glad it worked for you! Sometimes it's an easy fix!
... View more
02-12-2013
10:39 AM
|
0
|
0
|
1046
|
|
POST
|
I haven't used either of the widgets you reference but you should be able to. In your map initialization function, try adding something like: dijit.byId('Your Measurement Widgit ID here').hide(); Another possibility could be adding a parameter on the HTML side of things. In one of my apps, I'm using a standard dijit TitlePane which defaults to an expanded state. In my HTML, I added open="false" into the line and it now loads closed by default: <div data-dojo-type="dijit/TitlePane" id="layersList" title="<b>Show Me...</b>" open="false"> Good luck! Steve
... View more
02-12-2013
10:37 AM
|
0
|
0
|
2481
|
|
POST
|
I'm COMPLETELY throwing this out as wild advice but you could look into this HTML5 Canvas for Internet Explorer and see if it helps make the heatmap apps work? I stumbled across this while trying to get charting working for IE-8 (the canvas is an issue for this as well). I never pursued what I have linked but maybe it can work for you... Good luck! Steve
... View more
02-11-2013
09:00 AM
|
0
|
0
|
1614
|
|
POST
|
Take a look at this thread I started a couple weeks ago. ESRI might have introduced a bug within the MapImage functionality with v3.3 of the API. Look at Derek's initial response to my question. There's a certain way you'll need add the mapImage layer to your map (basically, after the map loads- not during).
... View more
02-11-2013
05:57 AM
|
0
|
0
|
1046
|
|
POST
|
This bug looks to have been logged as NIM079257 but there is no status or evaluation attached to its description. I'm experiencing this issue both with KML files and mapImage Layers. I'm assuming this has no fix or workaround still? My example: http://gismaps.snoco.org/fws/ Under the "Show Me.." menu, Storm Total Precipitation is a KML Layer and Radar Image / 1-Hour Precipitation are mapImage Layers. Click to turn the layer on and zoom the map out three levels to see the effect. Unlike the original poster, I'm using ArcGIS Server 10.1 and v3.3 of the API.
... View more
02-08-2013
08:17 AM
|
0
|
0
|
1947
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-12-2026 01:43 PM | |
| 1 | 03-12-2026 08:41 AM | |
| 2 | 03-10-2026 10:10 AM | |
| 1 | 02-18-2026 09:20 AM | |
| 3 | 01-22-2026 02:03 PM |