Thursday, September 18, 2014

How to display the MesoWest weather stations in Leaflet.js?

1 Comment
Snippet to display MesoWest weather stations in Leaflet.
 //Hold markers group  
 var mesoMarkersGroup=new L.LayerGroup();   
 //Get weather information from Mesowest for the state VA  
 $.getJSON('http://api.mesowest.net/stations?callback=?',  
      {  
           state:'va',                   
           latestobs:1,  
           token:'demoToken'  
      },   
      function (data)   
      {  //Loop through all the weather stations  
        for(var i=0;i<data.STATION.length;i++)  
           {  
            try{  
                 var stn = data.STATION[i];  
                 var dat = stn.OBSERVATIONS;  
                 var stnInfo =stn.NAME.toUpperCase();  
                 var elev=parseInt(stn.ELEVATION);            
                 stnInfo = "<b>Air Temp:&nbsp;</b>"+Math.round(dat.air_temp[1])+"&deg;F"+ "</br><b>Wind Speed:&nbsp;</b>"+Math.round(dat.wind_speed[1]* 1.150)+"MPH"+"</br>  
                 +<b>Wind Direction:&nbsp;</b>"+getCardinalDirection(Math.round(dat.wind_direction[1]))+"</br><b>Relative Humidity:&nbsp;</b>"+dat.relative_humidity[1]+"%"+"</br>  
                 +<b>Elevation:&nbsp;</b>"+elev+"&prime;";       
                 //Add stations into Leaflet markers group  
                 L.marker(L.latLng(stn.LATITUDE,stn.LONGITUDE),{title:stn.NAME.toUpperCase()}).bindPopup(stnInfo).addTo(mesoMarkersGroup);  
            }    
            catch(e)  
            {  
                alert("Error! "+ e);  
            }  
           }   
  })       
 .done(function()  
 {  
 })  
 .fail(function()  
 {       
      alert("Could not access the MesoWest!");  
 });  
 //Add markers group to the Map  
 map.addLayer(mesoMarkersGroup);  

Where are my streets Chrome? Google Maps bug on Chrome or vice-versa

Be The First To Comment
I was checking the route for nearest police station from my office around 3 PM MT using the Chrome. The  Google Map's street looks so funny and floppy. All the street lines and highways lines were wiped out. The interstate has some brown points, if you zoom in them the point looks like half circle. Which has the bug Google Maps or Chrome? Click on images for bigger picture !

(Missing roads)

                                                                 (Missing roads on zoom)

                                                                         (More zoom in...)
(Looks good in  the Firefox though)

Wednesday, September 17, 2014

The Manager's Guide to PostGIS - Paul Ramsey at FOOSS4G 2014 PDX

Be The First To Comment
Interesting talk by Paul Ramsey about the decision process to adopt PostGIS vs other spatial databases at FOOSS4G 2014 Portland, OR. Ramsey, "what do managers need to know before they can get comfortable with the idea of making the move."
 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me