zipcode

geolocation without requesting permission

喜你入骨 提交于 2019-11-30 05:00:14
问题 Ive noticed that modern html5 based geolocation always asks the user "do you want to share your location with this website?". Which is fine, but I know there are other routes of trying to determine a ballpark geolocation without having to request this permission. If I recall, these services uses ip databases to try to track geolocaiton info and provide it to a web app. So, in my website I would like to get a "best guess" at the user's zip code, without the geolocation permission being

Zip Code to City/State and vice-versa in a database?

有些话、适合烂在心里 提交于 2019-11-30 04:06:12
I'm new to SQL and relational databases and I have what I would imagine is a common problem. I'm making a website and when each user submits a post they have to provide a location in either a zip code or a City/State. What is the best practice for handling this? Do I simply create a Zip Code and City and State table and query against them or are there ready made solutions for handling this? I'm using SQL Server 2005 if it makes a difference. I need to be able to retrieve a zip code given a city/state or I need to be able to spit out the city state given a zip code. You have a couple options.

Best Zip Code Plugin for Ruby [closed]

…衆ロ難τιáo~ 提交于 2019-11-30 02:01:58
I need to find the city and state from a zip code. Does anyone know a good plugin/API that I can use to do this? gem install geokit In IRB: require 'geokit' geo = GeoKit::Geocoders::MultiGeocoder.multi_geocoder('90210') if geo.success geo.state # => CA geo.city # => Beverly Hills end A more lightweight option is the Area gem . require 'area' '11211'.to_region #=> "Brooklyn, NY" See Jason's answer. It works nicely. The problem is that the USPS doesn't allow bulk downloads of their zip-code lists unless you pay for it. Google's API, which is used in the gem mentioned by Splashlin, no longer

Plotting color map with zip codes in R or Python

别等时光非礼了梦想. 提交于 2019-11-29 19:33:59
I have some US demographic and firmographic data. I would like to plot zipcode areas in a state or a smaller region (e.g. city). Each area would be annotated by color and/or text specific to that area. The output would be similar to http://maps.huge.info/ but a) with annotated text; b) pdf output; c) scriptable in R or Python. Is there any package and code that allows me to do this? Eduardo Leoni I am assuming you want static maps. (source: eduardoleoni.com ) 1) Get the shapefiles of the zip boundaries and state boundaries at census.gov: 2) Use the plot.heat function I posted in this SO

Nearest Zip Code Search using asp.net

允我心安 提交于 2019-11-29 16:29:30
I want to inplement functionallity that will search zip codes, if user enter any zip code than all the zip codes close to entered zip code will be shown. Please let us know if there is any free api for it like Google API or any other solutions. Ed Bayiates First, grab a free zip code database like this one . This will allow you to convert from an entered zip code to a latitude and longitude. As long as you make latitude and longitude database keys also, you can now look up all the nearby latitudes and longitudes (by moving up and down in the sorted values) and get all ZIP codes within a

数据量太大的情况下,如何优化查询速度?

十年热恋 提交于 2019-11-29 05:37:13
1.合理使用索引 索引是数据库中重要的数据结构,它的根本目的就是为了提高查询效率。现在大多数的数据库产品都采用IBM最先提出的ISAM索引结构。索引的使用要恰到好处,其使用原则如下: ●在经常进行连接,但是没有指定为外键的列上建立索引,而不经常连接的字段则由优化器自动生成索引。 ●在频繁进行排序或分组(即进行group by或order by操作)的列上建立索引。 ●在条件表达式中经常用到的不同值较多的列上建立检索,在不同值少的列上不要建立索引。比如在雇员表的“性别”列上只有“男”与“女”两个不同值,因此就无必要建立索引。如果建立索引不但不会提高查询效率,反而会严重降低更新速度。 ●如果待排序的列有多个,可以在这些列上建立复合索引(compound index)。 ●使用系统工具。如Informix数据库有一个tbcheck工具,可以在可疑的索引上进行检查。在一些数据库服务器上,索引可能失效或者因为频繁操作而使得读取效率降低,如果一个使用索引的查询不明不白地慢下来,可以试着用tbcheck工具检查索引的完整性,必要时进行修复。另外,当数据库表更新大量数据后,删除并重建索引可以提高查询速度。 2.避免或简化排序 应当简化或避免对大型表进行重复的排序。当能够利用索引自动以适当的次序产生输出时,优化器就避免了排序的步骤。以下是一些影响因素: ●索引中不包括一个或几个待排序的列;

mySQL select zipcodes within x km/miles within range of y

岁酱吖の 提交于 2019-11-29 05:17:38
Note: Although I use a zipcode database with Dutch zipcodes, this question is country independent. I have a database with every zipcode in the Netherlands + its x and y coordinate (lat/long). I have for example zipcode: $baseZipCode = 1044; with the following coordinates: x coordinate = 4,808855 y coordinate = 52,406332 Now, I want to find all other zipcodes with $range from $baseZipCode . For example: SELECT zipcode FROM zipcodes WHERE ????? // Need help here The problem is that the earth is not completely round. I find a lot of tutorials with from a to b calculations but that's not what I

Zip Code Lookup API? [closed]

拜拜、爱过 提交于 2019-11-28 23:22:59
I need an API to give me the zip code of a location when someone enters a location like Los Angeles, California. I have seen many APIs that give you the details by the zip code, but I need the reverse. USPS has an address information api . You give it an address and it gives you the zip code. And as the commenters said, you need to provide an address, because many cities have multiple zip codes. Check out the API from SmartyStreets . As with the USPS address information API (mentioned above), you provide an address, the API provides the verified, standardized address along with the complete

Plotting color map with zip codes in R or Python

半世苍凉 提交于 2019-11-28 15:09:18
问题 I have some US demographic and firmographic data. I would like to plot zipcode areas in a state or a smaller region (e.g. city). Each area would be annotated by color and/or text specific to that area. The output would be similar to http://maps.huge.info/ but a) with annotated text; b) pdf output; c) scriptable in R or Python. Is there any package and code that allows me to do this? 回答1: I am assuming you want static maps. (source: eduardoleoni.com) 1) Get the shapefiles of the zip boundaries

Nearest Zip Code Search using asp.net

老子叫甜甜 提交于 2019-11-28 10:55:46
问题 I want to inplement functionallity that will search zip codes, if user enter any zip code than all the zip codes close to entered zip code will be shown. Please let us know if there is any free api for it like Google API or any other solutions. 回答1: First, grab a free zip code database like this one. This will allow you to convert from an entered zip code to a latitude and longitude. As long as you make latitude and longitude database keys also, you can now look up all the nearby latitudes