New API. Latitude, Longitude Coordinates Problem

  • 1
  • Question
  • Updated 1 week ago
Hi,

I can not find a way to build my application for the current weather conditions by geolocation with the new API.

I have my own personal application that tells me the current weather conditions as I move on my mobile. By means of a variable, I simply add it to the application and this brings the conditions of my current location, obtaining the data from the station closest to my position.

Before I used, for example:

api.wunderground.com/api/my_key/geolookup/q/37.77,-122.39.json

Now I have tried several application options, but I do not get it, something I'm missing.
Please someone knows and can you give me an example.

Thks

Photo of elee

elee

  • 8 Posts
  • 1 Reply Like

Posted 3 weeks ago

  • 1
Photo of Rimvydas Pocius

Rimvydas Pocius

  • 1 Post
  • 0 Reply Likes
Yes new api key didn't work. I hope WU will be fix.
Photo of rlevis

rlevis

  • 2 Posts
  • 1 Reply Like
I know that OpenWeatherMap supports lookups based on location coordinates.
Photo of Tom

Tom

  • 51 Posts
  • 18 Reply Likes
Just a dumb question.   Have you tried the WU app?  I have an iPhone and it does exactly what it sounds like you are wanting.  I can not speak about an android app.  It locates me and provides data from the station closest to me.  If I am at home... it's my own data.

You can also create favorites.  If you pick your own station as a favorite, you can get your station data from anywhere.

It also does not use the API.

Not trying to be a smart one, but why reinvent the wheel?
https://itunes.apple.com/us/app/weather-underground-forecast/id486154808?mt=8

Edit:  I did look the app up on the PlayStore and it looks very much the same.
https://play.google.com/store/apps/details?id=com.wunderground.android.weather
(Edited)
Photo of elee

elee

  • 8 Posts
  • 1 Reply Like
Hi Tom, you are quite right in your comments as I have not said exactly what I do with my personal app.

I live in Costa Rica, this is a country where climate prediction is very complex due to its tropical conditions.

After many years of trial and error, I have managed to make my own data that makes my app manage to prevent rain between 90 to 15 minutes before it appears. Which is very useful.

All the weather app or service that exists, no one approaches or 10% chance of rain with its forecast for Costa Rica.

My app is powered by the main data offered by the WU API and inside I do hundreds of calculations that do magic. But with the new API, simple things are missing but they are very important for me. For example, with the new API I no longer have the current condition of the sky (Sunny, Party Cloudy, Rainy, etc).

Nor do I have to look for my current position in Costa Rica by geolocation. My app what it does is get my current position by GPS, process the data in Google and convert the coordinates into a variable that could previously be placed in the request that I made to the API and it was connected in a precise way to the PWS of WU nearest and gave me the necessary data to do magic.




Photo of Victoria Gardner

Victoria Gardner, Official Rep

  • 519 Posts
  • 70 Reply Likes
I am struggling with this a bit, Elee, in part because I cannot imagine that the "current conditions" narrative of sunny, etc in the old API was so much more accurate/useful that being able to get the current UV reading from a PWS.  I doubt it was actually updated with much frequency.  And it almost certainly was not just for one particular PWS, but for an entire area.  I know when I used to look at it on my phone, maybe it was right and maybe not.  But I never would have depended on it to to the exclusion of actual hard data from a PWS.

So in some ways, the new API is more honest.

If it were me, I would use the first day of the 5-day forecast and combine it with the current conditions, which could verify whether the cloudy/sunny status was accurate.  The forecast is updated as needed, although I don't know exactly how often or whether there are regional variations to those updates.  But the forecast gives you the narrative you want, and the icon code that you can always turn into text as well.

It also lets you call it by geocode.  You might even want to standardize locations, so that places you know you will be frequently are fixed, so you're not constantly recomputing them.  

I might also add in data from the 1-day rapid history.  It will change over the day, and comparisons to the forecast could be made, along with pressure changes.  Since you already have a lot of data, you may be able to make micro-forecasts based on your knowledge of how the geography and atmosphere interact, such as sudden wind direction shifts combined with pressure changes along this particular hillside almost always indicate a strong thunderstorm rolling in.

But in all honesty, that's exactly what I use the WU app on my phone for.  I know my local terrain. I know how to read the conditions from the app, and I make my own interpretations for my chances to need a coat or a rain poncho.  I can imagine doing that coding myself, but I much prefer to let the folks who are doing it handle it.

Does that make sense?  Does it help with recreating your app?  

--Victoria
Photo of elee

elee

  • 8 Posts
  • 1 Reply Like
Hello Victoria, very grateful for your comments.
It makes a lot of sense what he says, I agree with you.

In the last days I have had many hours to investigate and manage to change some things.

Not wanting to bother and forgiving my ignorance in some fields, I just want to know one last thing:

What would be the substitute with the new API to this request that I did before with the old API?


Example

api.wunderground.com/api/my_key/geolookup/q/37.77,-122.39.json

Again, sorry if I'm missing something, it may be because of the language (my native language is Spanish) or because of something technical that I can not understand.

:(
(Edited)
Photo of Victoria Gardner

Victoria Gardner, Official Rep

  • 519 Posts
  • 70 Reply Likes
Changing is hard!  Your language use is fantastic, Elee!  

What you want is "location services", "near":  https://docs.google.com/document/d/14BKNJwPiU8T6UNFBzPn5NuNcAJjFcSWmMIc2TSqg51Q/edit#heading=h.o0w4iwk0epbc

This lets you look up things (PWSs, airports) near the geocode you provide.  Is that what you want?

--Victoria
Photo of elee

elee

  • 8 Posts
  • 1 Reply Like
Hi Victoria, sorry to answer so far.
With this link that you sent me, I found exactly what I needed and started working without stopping on my code. I have had days of hard work and finally I managed to solve several localization issues.
Almost, I almost have all my code ready, I am waiting for the resolution we have in another post about adding the weather conditions in the new API. (New API: Missing Current Condition Narrative and City of PWS). I am sure that the great team of WU is going to give us a solution for this.

Thank you very much for your support and availability, very grateful.

Photo of Victoria Gardner

Victoria Gardner, Official Rep

  • 519 Posts
  • 70 Reply Likes
Hi, Elee!  Congratulations!

There will be an answer eventually, but we're very busy with work related to bringing the API all the way down.  So you might want to work around/with the last bit until we get an answer.  

--Victoria
Photo of Tom

Tom

  • 51 Posts
  • 18 Reply Likes
Thanks for the explanation.  I am sure that Victoria will speak to the issue, but I think it is likely that there will be no changes.  I know that is disastrous for your app and the all the time you spent developing it.  Many of us have had to completely rewrite our code to either use data available from other sources like Darksky and OpenWeather Map or make severe compromises in what we can accomplish.

My best hope for WU is that, eventually weather people like Victoria will get more of a say, and some minor tweaks will be approved.
Photo of Victoria Gardner

Victoria Gardner, Official Rep

  • 519 Posts
  • 70 Reply Likes
Aww, Tom, that's very kind.  I so enjoy being called a weather person!

But I am, alas, the least knowledgable of most of the people around me, upon whom I depend to answer your questions.  Almost all of them are meteorologists.  Some have advanced degrees in computer science.  It's truly an awesome group of people I work with here.

--Victoria