Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Reverse Geocoding
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter  
View profile  
 More options Aug 9 2012, 2:10 pm
From: Peter <pwb...@mail.missouri.edu>
Date: Thu, 9 Aug 2012 11:10:17 -0700 (PDT)
Local: Thurs, Aug 9 2012 2:10 pm
Subject: Reverse Geocoding

Hi all,

I am writing a twitter scraper and I am getting the geo-point from each
tweet and they are being mapped fine. The only thing I am not getting is
the location name itself like '101 North 4th Street'. I know that there's a
reverse geocoding module in the documentation, but I'm not sure how to use
it exactly. Does anyone know what to do with this?

Thanks,
Peter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Davis  
View profile  
 More options Aug 9 2012, 2:28 pm
From: Adam Davis <adavi...@kent.edu>
Date: Thu, 9 Aug 2012 14:28:42 -0400
Local: Thurs, Aug 9 2012 2:28 pm
Subject: Re: [EB Code] Reverse Geocoding

Peter,

When in doubt, read the docs. It seems like the reverse geocoder takes in
the point as an argument and returns the block information for the given
point.

http://openblockproject.org/docs/packages/ebpub.geocoder.html#module-...

Adam


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karen Tracey  
View profile  
 More options Aug 9 2012, 2:36 pm
From: Karen Tracey <kmtra...@caktusgroup.com>
Date: Thu, 9 Aug 2012 14:36:32 -0400
Local: Thurs, Aug 9 2012 2:36 pm
Subject: Re: [EB Code] Reverse Geocoding

On Thu, Aug 9, 2012 at 2:10 PM, Peter <pwb...@mail.missouri.edu> wrote:
> Hi all,

> I am writing a twitter scraper and I am getting the geo-point from each
> tweet and they are being mapped fine. The only thing I am not getting is
> the location name itself like '101 North 4th Street'. I know that there's a
> reverse geocoding module in the documentation, but I'm not sure how to use
> it exactly. Does anyone know what to do with this?

Here's how it works in the shell for some of my data:

>>> from ebpub.geocoder.reverse import reverse_geocode
>>> from ebpub.db.models import NewsItem
>>> rni =

NewsItem.objects.filter(schema__slug='restaurants',location__isnull=False)[ 0]
>>> block, distance = reverse_geocode(rni.location)
>>> block

<Block: 25952-26230 Andrew Jackson Hwy E.>
>>> distance
0.0
>>> rni.location_name

u'26133 Andrew Jackson Hwy'


So you can get to the closest block, but I don't know that there is any way
to have it guess about what number on the block you might be closest to...

Karen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Winkler  
View profile  
 More options Aug 9 2012, 3:01 pm
From: Paul Winkler <p...@openplans.org>
Date: Thu, 9 Aug 2012 15:01:27 -0400
Local: Thurs, Aug 9 2012 3:01 pm
Subject: Re: [EB Code] Reverse Geocoding

Thanks for posting that!

> So you can get to the closest block, but I don't know that there is any way
> to have it guess about what number on the block you might be closest to...

There isn't currently, no.

--

Paul Winkler, software engineer @ OpenPlans
http://openplans.org/team/#paul-winkler
irc.freenode.net: slinkp
yahoo: slinkp23
AIM:   slinkp1970


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter  
View profile  
 More options Aug 9 2012, 5:36 pm
From: Peter <pwb...@mail.missouri.edu>
Date: Thu, 9 Aug 2012 14:36:34 -0700 (PDT)
Local: Thurs, Aug 9 2012 5:36 pm
Subject: Re: Reverse Geocoding

Thanks everyone! now I'm trying to strip the string that it returns. The
string I am getting is '(<Block: 344-599 E. Stadium Blvd.>,
0.00115576433658708)' and all I want to display is '344-599 E. Stadium
Blvd.'. I've tried doing this by using this code:

             test = reverse_geocode(item.location)
     block, address = test.split(':')
     item.location_name = address

And I would think that would give me block = (<Block: and address = 344-599
E. Stadium Blvd.>, 0.00115576433658708). and then I could split it again,
but the first split didn't work. Am I using split incorrectly?

Thanks,
Peter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Winkler  
View profile  
 More options Aug 9 2012, 5:45 pm
From: Paul Winkler <p...@openplans.org>
Date: Thu, 9 Aug 2012 17:45:22 -0400
Local: Thurs, Aug 9 2012 5:45 pm
Subject: Re: [EB Code] Re: Reverse Geocoding

On Thu, Aug 09, 2012 at 02:36:34PM -0700, Peter wrote:
> Thanks everyone! now I'm trying to strip the string that it returns. The
> string I am getting is '(<Block: 344-599 E. Stadium Blvd.>,
> 0.00115576433658708)' and all I want to display is '344-599 E. Stadium
> Blvd.'. I've tried doing this by using this code:

>              test = reverse_geocode(item.location)
>      block, address = test.split(':')
>      item.location_name = address

> And I would think that would give me block = (<Block: and address = 344-599
> E. Stadium Blvd.>, 0.00115576433658708). and then I could split it again,
> but the first split didn't work. Am I using split incorrectly?

The problem is that reverse_geocode doesn't return a string;
it returns a pair of objects, the first of which is a block instance.

Try something like this:

 (block, distance) = reverse_geocode(item.location)
 address = block.pretty_name

--

Paul Winkler, software engineer @ OpenPlans
http://openplans.org/team/#paul-winkler
irc.freenode.net: slinkp
yahoo: slinkp23
AIM:   slinkp1970


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »