<div dir="ltr">Thanks! I total understand the complexity of these special cases, so I think I'll just ignore the other type of special cases.<br>As for the NYC address, I tried these variations:<br><br>DROP TABLE IF EXISTS addresses_to_geocode;<br>CREATE TABLE addresses_to_geocode(address text);<br>INSERT INTO addresses_to_geocode(address)<br>VALUES     ('40-12 28 AVE , New York City, NY 11103'),<br>        ('40 28 AVE , New York City, NY 11103');<br><br>select     g.address as input_address, <br>        pprint_addy(normalize_address(g.address)) as normal_input,<br>        pprint_addy((g.geo).addy) as normal_output, <br>        (g.geo).rating <br>from (select address, (geocode(address,1)) as geo<br>        from addresses_to_geocode<br>     ) as g;<br><br>Results:<br><img src="cid:autoGeneratedInlineImage1" alt=""><br><br>So the block number 40 is not recognized anyway. I think the normalize function is doing the right thing to just ignore the part "-12", but the block number is not a street number so cannot be geocoded?<br><br>Thanks a lot for the help!<br><br>On Monday, November 30, 2015 at 9:51:55 PM UTC-5, Paragon Corporation wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Steve's comments are right.<p>I have to double-check how I do the address range thing.  As I might be stripping off the - which would be the wrong thing to do and might be why your 40 is not being kept.</p><p>I think the address_standardizer just keeps them together and then when it get's to my casting function, it might just strip off the minus.</p><p>Anyway give the address_standardizer a try.  The work Steve and I will be doing is focusing on making that better so it can be used in future geocoders.</p><p>Thanks,<br>Regina</p><p>-----Original Message-----<br>From: postgis-users [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="13uZx-YkCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgis-us...@<wbr>lists.osgeo.org</a>] On Behalf Of Stephen Woodbridge<br>Sent: Monday, November 30, 2015 4:21 PM<br>To: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="13uZx-YkCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgi...@lists.osgeo.org</a><br>Subject: Re: [postgis-users] Can geocode() deal with NYC Hyphenated address numbers and other special types?</p><p>I do not believe it is able to deal with  milepost, grid-style, or hyphenated house numbers other than the fact that it can pull off the first number and might use that to interpolate.</p><p>First understand that it only do linear interpolation between two number in a range. These complex numbers do not lead themselves to simple linear interpolation. I did an analysis of these address number in the past in Tiger data. Specifically, I compared the address ranges, to look at which components of the number were constant between the start and end of the range and which parts varied over the range.<br>It was not obvious in many cases which numbers to use for the interpolation and in some cases it was totally impossible to interpolate because the numbers collected did not make sense (block number at start and single number at end) either through a typographical error in the data or based on who collected the numbers at the end of the segments or how numbers were reassigned when a segment got divided into multiple segments.</p><p><br>Also remember you are working with Tiger data which fuzzes the address ranges because of Title 13 concerns.</p><p>I'll let others respond to the specifics of the postgis geocoder.</p><p>-Steve</p><p>On 11/30/2015 3:56 PM, draco doc wrote:<br>> Hi,<br>><br>> I found there are many special format of addresses that valid in their <br>> local area, but could be quite difficult for geocode() in Tiger Geocoder.<br>><br>> Here is a US street address standard document <br>> <<a href="https://www.fgdc.gov/standards/projects/FGDC-standards-projects/street-address/index_html" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fwww.fgdc.gov%2Fstandards%2Fprojects%2FFGDC-standards-projects%2Fstreet-address%2Findex_html\46sa\75D\46sntz\0751\46usg\75AFQjCNGa0Sykve5ehVdJ3v9KhXYLJ7gx1Q';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fwww.fgdc.gov%2Fstandards%2Fprojects%2FFGDC-standards-projects%2Fstreet-address%2Findex_html\46sa\75D\46sntz\0751\46usg\75AFQjCNGa0Sykve5ehVdJ3v9KhXYLJ7gx1Q';return true;">https://www.fgdc.gov/<wbr>standards/projects/FGDC-<wbr>standards-projects/street-<wbr>address/index_html</a>>.<br>> Started from page 36 of the final draft, several special cases were listed:<br>><br>> 4. Milepost Complete Address Numbers (Example: "Milepost 240").<br>><br>> 5. Grid-style Complete Address Numbers (Example:<br>> "N89W16758"). In certain communities in and around southern Wisconsin, <br>> Complete Address Numbers include a map grid cell reference preceding <br>> the Address Number.<br>><br>> 6. Hyphenated Complete Address Numbers (Example: "5- 5415"). In some <br>> areas (notably certain parts of New York City, southern California, <br>> and Hawaii), Complete Address Numbers often include hyphens.<br>><br>> I have 18 million address to geocode, and all these special cases can <br>> be found in my data. From my test, geocode() seemed not be able to <br>> recognize these cases which is totally understandable for me.<br>><br>> My questions is, is it possible to modify input a little bit to get a <br>> better than nothing result?<br>><br>> For example, if the NYC hyphenated address cannot be recognized, can <br>> we at least remove some part and get a rough location? I have address <br>> like this "40-12 28 AVE , New York City, NY 11103", where 40 is block, <br>> 12 is house number in block. I tried to just remove the 12 and keep <br>> the 40 which is block number, but all I can get is still just the 28 ave.<br>><br>> Thanks!<br>><br>><br>> ______________________________<wbr>_________________<br>> postgis-users mailing list<br>> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="13uZx-YkCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgi...@lists.osgeo.org</a><br>> <a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNE5MnSU134H4CJw8HWbVRzj9jZBFg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNE5MnSU134H4CJw8HWbVRzj9jZBFg';return true;">http://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br>></p><p>______________________________<wbr>_________________<br>postgis-users mailing list<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="13uZx-YkCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgi...@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNE5MnSU134H4CJw8HWbVRzj9jZBFg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNE5MnSU134H4CJw8HWbVRzj9jZBFg';return true;">http://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a></p><p><br>______________________________<wbr>_________________<br>postgis-users mailing list<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="13uZx-YkCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">postgi...@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNE5MnSU134H4CJw8HWbVRzj9jZBFg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpostgis-users\46sa\75D\46sntz\0751\46usg\75AFQjCNE5MnSU134H4CJw8HWbVRzj9jZBFg';return true;">http://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote></div>