[AccessD] code to find the population within a radius of a zipcode

Stuart McLachlan stuart at lexacorp.com.pg
Sat May 5 06:46:00 CDT 2007


A nice tool if you want to build your own database of lat/long of 
towns/cities is Geomaker:
GeoMaker - Create the GeoDatabase for the entire world. This program create 
the geographical location Latitude, Longitude, and Altitude (Elevation) for 
every city, village, region, state, county in the World. The program crawls 
the data from the website www.heavens-above.com which collect data from US 
Geological Survey for the USA (and dependencies) and The National Imaging 
and Mapping Agency for all other countries. The program is available as 
.exe and the source code in Visual Basic 6

http://geomaker.mewsoft.qarchive.org/

Note that it takes a looong time to grab all the locations in a country :-(

It grabbed 22,000 records for PNG. After I dumped them into an Acess table 
and de-duped the names, I ended up with over 9000 locations -  many of them 
small villages/hamlets including 27 localities/suburbs within the National 
Capital District.


On 5 May 2007 at 6:54, William Hindman wrote:

> ...when you are using zip based lat-longs to calculate radius, the concept
> of "accuracy" is about as relevant as nasal drip regardless of which
> algorithms you use ...a zip based lat-long is the geo center of the zip
> code's mapped area ...since zip areas are highly irregular the given geo
> center may well be physically outside the zip's actual boundaries ...and
> then there is the problem of zip area geographical size which is most often
> based upon demographics ...ergo, the size of an Alaskan zip code can be
> several hundred miles in extent while that of a Manhattan zip may be
> resolved to a few floors in a single office tower ...thus search results for
> zips within a fifty mile radius of a given zip's lat-long should be
> considered with the same levity reserved for JC's stick poking efforts
> ...the calculation of the number of bubbles per poke being about as
> accurate.
> 
> William Hindman
> 
> ----- Original Message ----- 
> From: "MartyConnelly" <martyconnelly at shaw.ca>
> To: "Access Developers discussion and problem solving" 
> <accessd at databaseadvisors.com>
> Sent: Friday, May 04, 2007 4:35 PM
> Subject: Re: [AccessD] code to find the population within a radius of a
> zipcode
> 
> 
> >I would like to see code too. There are many possible errors.
> >
> > How accurate do you want to be.  Third order surveying accuarcy?
> > Generally
> > lat/long with 3 decimal places accuracy gives you 100 metre error
> > lat/long with 4 decimal places gives 10 metre error
> >
> > Other errors.
> >
> > The shape of the Earth more closely resembles a flattened spheroid
> > with extreme values for the radius of curvature, or arcradius, of
> > 6335.437 km
> > at the equator (vertically) and 6399.592 km at the poles
> > and having an average great-circle radius of 6372.795 km (3438.461
> > nautical miles).
> >
> > Using a sphere with a radius of 6372.795 km thus results in
> > a probable error of up to about 0.5%.
> >
> > Examples:
> >
> > This is a circle on the surface of the planet. At larger radii,
> > the effects of the Mercator projection become clearly visible.
> > Try a 2000 mile radius and move mouse to see if point within a circle or
> > is it an egg?
> >
> > http://maps.forum.nu/gm_sensitive_circle2.html
> >
> > This circle is actually tangent to the surface of the Earth,
> > but for small radii this is of little significance.
> >
> > http://maps.forum.nu/gm_clickable_circle.html
> >
> >
> >
> > Borge Hansen wrote:
> >
> >>>John Colby wrote:
> >>>I converted the code to find the population within a radius of a zip
> >>>code.
> >>>
> >>>
> >>
> >>Hi John,
> >>What does your VBA code look like?
> >>
> >>I am using a code that will find a subset of records based on their 
> >>geocode within a near enough square,
> >>
> >>...and querying the recordset like this
> >>
> >>....find me all record instances where Lat of record is between 
> >>"northernmost Lat" and "southernmost Lat" and Long of record is
> >>between "most western Long" and "most eastern Long"
> >>
> >>Interested to see your code based on a circle construct.....
> >>
> >>Regards
> >>borge
> >>
> >>
> >>
> >
> > -- 
> > Marty Connelly
> > Victoria, B.C.
> > Canada
> >
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > 
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

-- 
Stuart





More information about the AccessD mailing list