주소 유효성 검사를 어떻게 수행합니까?
주소 (전자 메일이 아닌 물리적) 유효성 검사를 수행 할 수도 있습니까? 미국에서만 주소 형식이 너무 많아서 상당히 어려운 작업이 될 것 같습니다. 반면에 여러 비즈니스 요구 사항에 필요한 작업처럼 보입니다.
여기에 그것을 할 수있는 자유롭고 일종의 "상자 밖"방법이 있습니다. 100 % 완벽하지는 않지만 존재하지 않는 주소는 거부해야합니다.
전체 주소를 Google의 지오 코딩 웹 서비스에 제출합니다 . 이 서비스는 입력 한 위치의 정확한 좌표, 즉 위도와 경도를 반환하려고 시도합니다.
내 경험상 주소가 유효하지 않으면 서비스에서 602의 결과를 얻을 수 있습니다. 오탐 또는 오탐의 가능성이 분명히 있지만 다른 일관성 검사와 함께 사용하면 유용 할 수 있습니다.
( 반면에 야후의 지오 코딩 웹 서비스 는 마을이 존재하지만 주소의 나머지 부분이 가짜 인 경우 마을 중심의 좌표를 반환합니다. "정밀도"필드에주의를 기울이면 유용 할 수 있습니다. 결과).
여기에는 여러 가지 좋은 답변이 있지만 대부분은 사용자가 타사 서비스에 연결하기 위해 코드를 작성하거나 USPS를 스크래핑해야하는 "API"솔루션을 원한다고 가정합니다. 이것은 모두 훌륭하고 좋지만 구현과 관련된 비즈니스 요구 사항 및 비용을 고려한 다음 원하는 이점과 비교하여 평가해야합니다.
비즈니스 요구 사항과 데이터가 시스템에 수신되는 방식에 따라 실시간 주소 처리 솔루션이 최선의 선택 일 수 있습니다. 실시간 솔루션이 필요한 경우 Google Maps / Bing / Yahoo API의 라이선스 계약 및 기술 제한을 고려하는 것이 좋습니다. 일반적으로 매일 걸 수있는 전화 수를 제한합니다. USPS 웹 도구 API는 시스템을 사용할 수있는 방법 / 이유 및 이후에 데이터를 사용할 수있는 방법을 제한한다는 점에서 동일합니다.
동시에 정적 주소 목록을 쉽게 처리 할 수있는 훌륭한 서비스 제공 업체가 많이 있습니다. 기본적으로 서비스 제공 업체에 CSV 파일 또는 Excel 파일을 제공하고이를 정리 한 다음 다시 가져옵니다. 일반적으로 장기적인 약속이나 의무가없는 일회성 거래입니다.
전체 공개 : 저는 SmartyStreets의 창립자입니다. 미국 내 주소에 대한 주소 확인을 수행합니다. CASS는 목록 을 쉽게 인증 할 수 있으며 주소 확인 웹 서비스 API 도 제공합니다 . 숨겨진 수수료, 계약 등이 없습니다. 더 이상 필요하지 않을 때까지 서비스를 사용하고 자리를 떠날 수 있습니다. (계약이 필요한 휴대폰 회사와는 다릅니다.)
USPS는 온라인 주소 클리너를 가지고 있는데, 누군가가 가난한 사람의 웹 서비스로 화면을 긁어 냈습니다. 그러나이 작업을 충분히 자주 수행하는 경우 USPS 계정 을 신청 하고 자체 웹 서비스에 전화 하는 것이 더 좋습니다 .
내 블로그 게시물- 주소 저장에 대한 강의 , 주소 유효성 검사 과정에서 사용되는 몇 가지 기술과 알고리즘에 대해 설명하겠습니다. 제 핵심 생각은 "주소 저장에 게으르지 마십시오. 앞으로는 골칫거리 일뿐입니다!"
또한이 질문을 묻는 또 다른 StackOverflow 질문이 있습니다. 이라는 제목의 국제 지리적 주소가 관계형 데이터베이스에 저장하는 방법 .
독일 회사에서 사내 주소 확인 서비스를 개발하는 과정에서 저는이 문제를 해결하는 여러 가지 방법을 발견했습니다. 아래에서 찾은 결과를 요약하기 위해 최선을 다하겠습니다.
무료 오픈 소스 소프트웨어
분명히 누구나 취할 수있는 첫 번째 접근 방식은 오픈 소스 접근 방식 (예 : openstreetmap.org )이며 결코 나쁜 생각이 아닙니다. 그러나 이것을 훌륭하고 신뢰할 수있는 용도로 사용할 수 있는지 여부는 결과에 얼마나 의존해야하는지에 따라 크게 달라집니다.
주소는 엄청나게 가변적 인 것입니다. 미국 주소를 확인하는 것은 쉬운 일이 아니지만 견딜 만하지 만 광범위한 우편 번호 시스템을 사용하여 유럽, 특히 영국으로 이동하면 오픈 소스 접근 방식에는 데이터가 부족합니다.
웹 서비스 / API
엔터프라이즈 급 소프트웨어
돈은 분명히 해낼 수 있습니다. 그러나 모든 비즈니스 또는 개발자가 주소 조회 당 0.15 달러 (API 요청 1,000 건당 150 달러)를 지출 할 수있는 것은 아닙니다. 이는 대부분의 주소 유효성 검사 API가 구현 한 매우 비싼 비즈니스 모델입니다.
내가 통합 한 것 : streetlayer API
주소 데이터를 수동으로 확인하는 프로그래밍 방식의 접근 방식을 기꺼이 받아들이지 않았기 때문에 마침내 상사가 나를 해고하지 않고 여전히 견고하고 신뢰할 수있는 가격표가있는 API가 필요하다는 결론에 도달했습니다. 국제 검증 결과.
간단히 말해서 저는 "streetlayer API"라고하는 apilayer가 구축 한 API를 통합했습니다. 저는 간단한 JSON 통합, 놀랍도록 정확한 유효성 검사 결과 및 개발자 친화적 인 가격으로 쉽게 확신했습니다. 또한 월 100 건의 요청은 완전히 무료입니다.
도움이 되었기를 바랍니다!
우리는 Perfect Address로 성공했습니다 .
그들의 데이터베이스에는 모든 미국 거리 이름과 거리 번호 범위가 있습니다. 또한 그러한 종류의 데이터를 가질만큼 운이 좋다면 자유 형식 주소 필드에 대한 꽤 괜찮은 파서 역할을합니다.
나는 http://www.melissadata.com 의 서비스를 사용했습니다 . 그들의 "주소 객체"는 아주 잘 작동합니다. 예, 비싸요. 그러나 자체 솔루션을 작성하는 비용, 애플리케이션의 더티 데이터 비용, 반송 메일러 (판매 손실 등)를 고려하면 비용이 정당화 될 수 있습니다.
For us-based address data my company has used GeoStan. It has bindings for C and Java (and we created a Perl binding). Note that it is a commercial product and isn't cheap. It is quite fast though (~300 addresses per second) and offers features like CASS certification (USPS bulk mail discount), DPV (Delivery point verification) flagging, and LON/LAT geocoding.
There is a Perl module Geo::PostalAddress, but it uses heuristics and doesn't have the other features mentioned for GeoStan.
Edit: some have mentioned 'doing it yourself', if you do decide to do this, a good source of information to start with is the US Census Tiger Data Set, which contains a lot of information about the US including address information.
You could also try SAP's Data Quality solutions which are available in both a server platform is processing a large number of requests or as an embeddable SDK if you wanted to run it in process with your application. We use it in our application and it's very robust and scalable.
As seen on reddit:
$address = urlencode('1600 Pennsylvania Avenue, Washington, DC');
$json = json_decode(file_get_contents("http://where.yahooapis.com/geocode?q=$address&flags=J"));
print_r($json);
You can try Pitney Bowes “IdentifyAddress” Api available at - https://identify.pitneybowes.com/
The service analyses and compares the input addresses against the known address databases around the world to output a standardized detail. It corrects addresses, adds missing postal information and formats it using the format preferred by the applicable postal authority. I also uses additional address databases so it can provide enhanced detail, including address quality, type of address, transliteration (such as from Chinese Kanji to Latin characters) and whether an address is validated to the premise/house number, street, or city level of reference information.
You will find a lot of samples and sdk available on the site and i found it extremely easy to integrate.
There are companies that provide this service. Service bureaus that deal with mass mailing will scrub an entire mailing list to that it's in the proper format, which results in a discount on postage. The USPS sells databases of address information that can be used to develop custom solutions. They also have lists of approved vendors who provide this kind of software and service.
There are some (but not many) packages that have APIs for hooking address validation into your software.
However, you're right that its a pretty nasty problem.
http://www.usps.com/ncsc/ziplookup/vendorslicensees.htm
As mentioned there are many services out there, if you are looking to truly validate the entire address then I highly recommend going with a Web Service type service to ensure that changes can quickly be recognized by your application.
In addition to the services listed above, webservice.net has this US Address Validation service. http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=24
Validating it is a valid address is one thing.
But if you're trying to validate a given person lives at a given address, your only almost-guarantee would be a test mail to the address, and even that is not certain if the person is organised or knows somebody at that address.
Otherwise people could just specify an arbitrary random address which they know exists and it would mean nothing to you.
The best you can do for immediate results is request the user send a photographed / scanned copy of the head of their bank statement or some other proof-of-recent-residence, because at least then they have to work harder to forget it, and forging said things show up easily with a basic level of image forensic analysis.
There is no global solution. For any given country it is at best rather tricky.
In the UK, the PostOffice controlls postal addresses, and can provide (at a cost) address information for validation purposes.
Government agencies also keep an extensive list of addresses, and these are centrally collated in the NLPG (National Land and Property Gazetteer).
Actually validating against these lists is very difficult. Most people don't even know exactly how their address as it is held by the PostOffice. Some businesses don't even know what number they are on a particular street.
Your best bet is to approach a company that specialises in this kind of thing.
Yahoo has also a Placemaker API. It is good only for locations but it has an universal id for all world locations.
It look that there is no standard in ISO list.
NAICS.com is coming out with an API that will add all kinds of key business data including street address. This would happen on the fly as your site's forms are processed. https://www.naics.com/business-intelligence-api/
Fixaddress.com service is available that provides following services,
1) Address Validation.
2) Address Correction.
3) Address spell correcting.
4) Correct addresses phonetic mistakes.
Fixaddress.com uses USPS and Tiger data as reference data.
For more detail visit below link,
One area where address lookups have to be performed reliably is for VOIP E911 services. I know companies reliably using the following services for this:
Bandwidth.com 9-1-1 Access API MSAG Address Validation
MSAG = Master Street Address Guide
https://www.bandwidth.com/9-1-1/
SmartyStreet US Street Address API
https://smartystreets.com/docs/cloud/us-street-api
For US addresses you can require a valid state, and verify that the zip is valid. You could even check that the zip code is in the right state, but beyond that I don't think there are many tests you could run that wouldn't provide a lot of false negatives.
What are you trying to do -- prevent simple mistakes or enforcing some kind of identity check?
참고URL : https://stackoverflow.com/questions/134956/how-do-you-perform-address-validation
'program story' 카테고리의 다른 글
액터는 스레드와 비교하여 어떻게 작동합니까? (0) | 2020.09.17 |
---|---|
git push.default = current와 push.default = upstream의 차이점은 무엇입니까? (0) | 2020.09.17 |
varchar (max) 변수의 최대 크기 (0) | 2020.09.17 |
.NET 데스크톱 앱의 Settings.settings 대 app.config (0) | 2020.09.17 |
PHP 5.4.0 이전의 익명 함수에서`$ this` 사용 (0) | 2020.09.17 |