>> Hey friends, I'm
Scott Hanselman and this is another
episode of Azure Friday.
I'm here with Julie Collar from the Azure Maps team. Hi.
>> Hi.
>> So, we're going to do a whole series
of Azure Maps episodes,
and this one we're going to talk about
search and cool REST API,
and you've got some great demos for me.
>> Yeah.
>> So, what's the story with Azure Maps?
>> So, the overall story or the search story?
>> Well, the search story.
>> So, we have a lot of search APIs.
We do a lot of different things.
Anywhere from geocoding, which is
a commonly used thing for mapping,
and we do reverse geocoding,
we let you search for points of interest,
and we have it's really cool thing that lets you
search long route, that will be coming soon.
>> Okay, cool. So, we'll try to
cover these in a series of episodes.
>> Yes.
>> So, if you've just found this episode,
make sure to find the other
Azure Maps episodes because there's a ton of stuff,
we're going to go in-depth in each segment.
>> Yes.
>> Cool. So, the Azure Maps search API, it's a REST API.
>> Yes.
>> Okay, and how do I use it?
>> I can show you. So, I've got
some examples here in post mail that I'd like to share.
Let's start with the first one with geocoding,
because this is a really common scenario.
So, this one, let me pull up my query here.
So, this one is actually searching for building 24,
which is where I am on campus,
and so I started with the address of building 24.
I passed the sense of the query,
and then if I move this up here,
I can see the results,
and you see that it gives me
back a lot of information about this particular location,
but in particular it gives me my position.
So, if you want your latitude/longitude you can
get that information from this particular query.
>> Actually, two things that are interesting here.
Of course you've got a subscription key.
>> Yeah.
>> That's, it's your private key and
certainly we can see it but you'll change it.
>> Yes.
>> You'll change tomorrow. Then there's,
like you said, there's a ton of information.
It didn't just give you
an align that said here's the address.
>> That's right.
>> There's a bunch of extra stuff.
>> You get a lot of extra information.
With geocoding you get information about the location,
the latitude, the longitude.
If you want things like POI though
there's a different search for that.
>> POI?
>> Points Of Interest.
>> Okay.
>> Yes. So that'll-, I
could show that one a little bit later and we have
some different combinations if you want to get
a combination of the two things,
or if you just want the points of interest.
>> It sounds very flexible.
>> Yeah.
>> It's not just one thing in, one thing out.
>> Sure. It's all about what you need.
>> Cool.
>> For the next one, let me show you.
So, that's if you just
have an address that you want to search for.
So, I knew the address of
my building, and so I typed that in.
But sometimes you have a Web form that you're building,
for your application, and so,
for that one you might want to piece out the address,
you might want to have the number of the address,
the street name, because that's how people write them.
>> In separate text boxes.
>> Exactly. So, for that one this one's very flexible.
So in this query, it's been broken down.
So, you've got the country code, the street number,
the street name, the municipality,
the subdivision, and the postal code.
So of these boxes,
you can imagine somebody had filled them on a Web form.
>> This is something that works
not just in the US of course.
>> Correct. >> There's hundreds of countries?
>> Yeah. We are supported globally.
>> Okay.
>> So, I'm going to send this one and
it should get back the exact same information,
as just the way that it was passed through
that Web form that provides different information.
>> I see. So, this means that as
a developer if I have a full single line,
I've got an API that matches that,
and I don't have to necessarily worry about
chopping it up or parsing it.
>> Exactly.
>> If I have a more natural address segmented Web form.
>> Yeah. So, those are two applications for geocoding.
On the other side, so say
you don't necessarily want to geocode,
you want a combination, you want both things.
So for that, you can do a fuzzy search.
So, a fuzzy search gives you even more information.
So, I'm using the same address again.
For this particular query I've
got the address of my building,
building 24, I will send this one, and if I can get.
There we go. You've got the address range information.
So, it did a geocode, and-
>> I see, I'm anticipating here, I'm
extrapolating and also said
address range saying well
it did in this fact, in this case,
give you a single address
but if there was a building next door,
or on both sides I'm like well, kind of
in this general range of addresses.
>> Yeah, Fuzzy Search is a little bit more forgiving too.
So, you can give it, I could just say Redmond,
and I could get lots of information back about Redmond,
or if I don't know the number of my building,
I could have just passed
the other information about where it
was and I can get information about that area.
Maybe not necessarily that specific building.
>> Okay. So, it's not Fuzzy Search in a string sense,
like I'm sure I could misspell
Redmond, and it would figure it out.
>> Yeah, it will do that.
>> But it's fuzzy in an address way,
like if I accidentally use the wrong zip code, all right.
>> Yeah. >> If I spelled Redmond wrong.
>> Yeah, it's very forgiving for things like that.
>> That's cool. All right. I can see use for that.
>> Yeah, and let me show you, we actually
built a sample with a Map control,
and so I will show you what this
looks like if you were to build
this out using our Map control.
Start with search. So, here this is a map of Los Angeles.
If I want to search for the Convention Center,
I can start to type,
and there we go. That's the address.
I know the address, but the address of
the Los Angeles Convention Center,
and then it zooms in there.
We have the information, we were able to get
that in a latitude/longitude,
and so from our APIs we are able to
pinpoint this location and show this on the map here.
>> It's interesting. There's a lot
going on there, it looks simple.
You type, you hit enter, and then it spreads.
But it auto completed.
>> Yes.
>> It corrected things for you.
It found the address.
It put a pin over the thing.
It resumed and reoriented.
>> Yes.
>> Now, is all of that encapsulated in that Map control?
>> It is. Our Map control does all of this for you.
>> Seriously?
>> Yeah.
>> I'm noticing here it says slash examples.
That means that, this is an example
that I can go and get the code for.
>> It is, yeah. We have this example available publicly.
So, it will be shared in the notes of the video.
>> So, this wasn't hard to get started on.
You just signed up,
you got a subscription key, and you were ready to go?
>> Very simple to get going. Yes.
>> This is all hosted in Azure.
Do I have to go into the Azure portal and sign up?
Or what's that experience like if I want to get
started right after this video and make this happen?
>> Go to the Azure portal, create
an account for Azure Maps,
and you will be started very quickly.
>> Very cool All right. Is that all?
>> I've got a little bit more.
>> All right.
>> So, we also do reverse geocoding.
>> What is reverse geocoding?
>> Reverse geocoding is the opposite.
So, that's if you have the position,
so you've got a GPS position from something,
and you want to figure out the address.
>> Okay. So, like geocaching.
Someone gave me two numbers,
I have no idea where they are.
>> Exactly. So, very
helpful if you have a device and you want to
find out where that person is and
somebody wants to share their location with you.
So, that's what reverse geocoding does.
So, for that one I'll show you in the query,
I passed my latitude and longitude.
>> Okay.
>> So, the last query parameter, that's where I am.
>> Hope this is a mystery location.
>> This location is Safeco Field
>> Okay.
>> So, here we get the information
back about where it is,
the street that it's on,
and the position but it
tells you that this is Safeco Field.
>> Even cooler. Look at that on line 21,
it says bounding box to basically say
here's about how big
Safeco Field is because it's quite large.
>> Yeah, and it tells you how to show that on the Map.
>> Interesting.
>> Yeah.
>> Well, there is a lot of information there,
and I can do anything with that information I want to.
>> Yes.
>> I could draw regions on Maps and do whatever.
>> Then we have something else for a reverse geocoding.
Also, we can pass you back the cross streets.
So, let's do the same look-up.
So, I will provide the same location,
which is Safeco Field,
and here, they're going to give you the cross streets.
So, they're telling you Occidental Avenue
and Edgar Martinez Drive.
South and in case you don't know where Safeco Field is,
I will pull that up. There it is.
You see Occidental Avenue,
and Edgar Martinez Drive.
So it's giving you the closest cross street.
Which is helpful for driving
apps or things like that where you want
to know where to pick somebody up,
it will give you that closest cross street.
>> On the corner of, if
you could go back to post mail real quick,
I noticed something else
there that I thought that was cool.
It's really quite a clean and intuitive URL there.
You've got /search/address/reverse/crossStreet/json Does
that imply that I could ask for
other things that aren't Json?
>> Today we only support Json format,
but in the future we might support more formats.
>> Yeah, and the URL is so clean that I
could almost figure it out myself.
>> Yeah.
>> That's pretty exciting.
>> Yeah. So, that is reverse geocoding.
Then we also talked about points of interest,.
>> Right.
>> POI, we refer to that commonly.
So, you can also search for points of interest.
This one is very interesting because you
can get all different types of results back.
We have two different point of interest type searches.
You can either search by name if you know
exactly what you're looking for,
or you can also do a category search.
The category search is amazing because
we support over 100 categories,
and I have to say we don't support tacos. I'm so sorry.
>> Tacos is not its own category?
>> Tacos is not its own category.
>> Cancel the show.
So, like categories like supermarket, and gas.
>> Yeah, amusement places, ATMs, all sorts.
We do support Mexican food but we don't have tacos.
>> Okay. I respect that. I will allow you to stay.
>> Okay. So let me show a POS search.
>> Okay.
>> So, by name, and
this one is searching for Statue of Liberty.
So, I'm going to send this one,
and it found the Statue of Liberty,
and it will give you points of interest around there.
So, and it gives you
information about the Statue of Liberty as well,
an important tourist attraction. >> Important tourist attraction,
just a regular tourist attraction.
>> That's right.
>> And a monument.
>> So, it'll give you
information about a bunch of different points of
interest and their locations
around the Statue of Liberty.
>> That's a good one. That one is tough because
there's no street there,
you can't drive to the Statue of Liberty.
>> Yeah.
>> Cool.
>> Then let's do a category search.
Again, lots of different categories that we support.
I picked one to start with and for this one I picked ATM.
>> Okay, cool.
>> This is always important.
>> Yeah.
>> So, we're searching for ATMs,
and you'll get a list back.
So, this is within our area.
See there's the boying employee credit.
>> So, what did you pass in, you passed in the category.
I see that, and then at this point,
and then where are you starting from?
>> This one was near Safeco actually.
>> Okay.
>> I looked for ATMs near Safeco.
>> ATMs near Safeco?
>> Yeah.
>> Okay. Then of course I can move comfortably,
I see between an address,
a cross street, and a Latin lawn.
So, if I found the API that wanted the Latin lawn,
I could give it that really easily.
>> Yes.
>> Could I say, find me an ATM near an address?
>> You can, and I'll show you
a visual example of that as well.
>> Cool.
>> So, here in
our search instead of typing this, I could have said,
ATM near
Los Angeles Convention Center
and l see a little bit but it is showing us some results.
>> It just lit up right over there.
>> So, you can find some ATMs near.
>> So, that natural language
thing that you're parsing in there.
Everyone likes to type something near here,
or near something where it feels a little bit like magic.
Does the API take near here?
>> It does. In that post mail inquiry,
I could have said that,
that is what I could have said, ATM near Safeco.
>> You're smart about that.
>> So you can do that in full English.
>> So, I'm hearing this is just really, really smart.
So, this means less work for me.
You've got a Map control that I can use,
you've got a convenient API,
and once you get the subscription key,
you can start calling these APIs as much as you want.
>> That's right.
>> You're using Web, the Web, and the Web controls,
but I could do it in my Windows apps,
or my iPhone apps, or whatever.
>> The Web control is really easy to
get started with. So, that's where you want to start.
>> All right, cool. All the examples are online.
>> All the examples are online. Yeah.
>> Thank you so much.
>> Thank you.
>> All right. I am learning all about
Azure Maps, here on Azure Friday.