How do I find a zip code for a place?
I have a database, I'm trying to add a new field that stores the zip code for the address, when entering a city or state I would want to have a drop down where they would be able to select a zip code. I already have the states and some of the big cities like Chicago.
So how do I connect to a zip code database? I'm not too familiar with databases, would this be a good way to go? This is more about a spatial question. So you need to know two things: Where is the zip code, ie latitude/longitude. What is the range of zip codes of the given location? Step 1 is straightforward - you can load GeoJSON coordinates from google or OpenStreetMap into the database and keep your zip codes in a Geography column. The database will then query a spatial index, which has the lat/long values stored inside the polygon covering the area, and thus find the closest match.
The ranges of zip codes are harder, you need to do a spatial join from your data with the list of ranges in the zip code database. But before you do this, you need to find the exact lat/long for each city. For this use reverse geocoding, which also stores the latitude/longitude of the given location in a database. After that, it is a trivial spatial join.
You'll need to start by taking the latitude and longitude for each city. For that you should get the latitude/longitude from the postal code, which seems to be stored somewhere inside the address. If the postal code is stored in the form of a country code, then reverse geocoding is probably enough. If the postcode is something like "11111-1111", then you'll need to store this as an integer (or small integer?) which matches to a table in your database with two columns, city and latitude/longitude.
I would suggest doing this for all the places you are tracking with the database, as you don't seem to be planning on adding any kind of geographic filtering to the database after this. You may want to create an index table that would store the lat/longs of all the place names for the world. You can then load the latitude/longitudes of the place names into the data and save the geographical details into your database.
What is the billing address in the US?
Does that determine if an application is approved or not? If I'm located in the US and I have a billing address in the UK, does that make it harder for me to get the card approved? If I'm based overseas and submit an app, do you just go through with it?
Can you just fill in the application and say your billing address is something in the UK? Yeah, you can put what ever address you want, but the best advice is to use a location where you regularly spend money. You need to prove out of the ordinary (expensive) activity, if you are submitting app, you need a business address and you need it to be for profit, a business address is a place where you do a business, a "home office" is for personal use only. Thanks for the info, I will go back and update my application once I am back on American soil. Also if you fill in your business address and it doesn't work, what happens? Do they notify you to resubmit with different address or do they send you another one free? Or do they send you one out of the UK which is also very expensive? Hey All, It's the end of the year and i'm not sure if anyone is following this thread anymore, just thought i'd say thanks for the great info everyone, I have a bit of experience with the US credit card, but i'll put some thoughts down here. Firstly I tried making purchases online with this card but as they have now changed the expiry date on all existing credit card, I had no luck with it, after looking into it a bit more I found out I can use it for any purchase in the usa if I use a payment method that accepts us debit/credit cards, as I have a US Bank card with a US address, I tried using my debit card to spend using the web and when you submit the payment they should show you what methods they accept with their services. My thoughts is that to be approved for the prepaid method a valid, issued US Address is required and as I said before this card has an expiry date it can't be over 18 months from the current day at the moment (i checked the usa terms).
What is an example of a city address?
(I am trying to create a model that uses the address from an object as the primary key in a model, but I am unsure how to generate it).
There are a number of ways to do this. If you have the address object, you can just use its .City attribute.
Class Address(models.Model): addressnumber = models.CharField() streetname = models.CharField() city = models.CharField() class Meta: dbtable = "address". def str(self): return "Address ".format(self.addressnumber, self.streetname)
However, you might want to save the city in a separate model. Class City(models.Model): name = models.CharField() class Address(models.Model): city = models.ForeignKey(City) def str(self): return " ".format(self.city, self.streetname)
The advantage of this approach is that the city doesn't need to be saved, but only referenced. You can also save cities and addresses without having to save an entire Address object.
Addresses can reference any city that exists. Class Address(models.Model): city = models.ForeignKey(City) def str(self): return " ".format(self.name, self.streetname)
Then, you would create an Address like so: Address.objects.create(city=City.
Related Answers
What are the cryptography types symmetric and asymmetric?
Symmetric: Symmetric encryption is encryption whe...
Is Hotspot Shield malware?
Hotspot Shield is a VPN service that allows you to browse the internet s...