<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Sarah,<br>
<br>
I tried to follow your instructions. The importing of the relation
seemed to go fine. When I attempted to verify that I could find the
state with the a search query, I believe the original node for PA
came back and not the imported relation. Does this mean that my OSM
data is broken?<br>
<br>
request:
<a class="moz-txt-link-freetext" href="http://myserver/nominatim/search.php?q=Pennsylvania&format=xml&addressdetails=1">http://myserver/nominatim/search.php?q=Pennsylvania&format=xml&addressdetails=1</a><br>
<br>
response:<span class="html-tag"> <br>
<br>
<?xml version="1.0" encoding="UTF-8" ?><br>
<searchresults timestamp='Sun, 11 Jan 15 08:49:40 -0500'
attribution='Data © OpenStreetMap contributors, ODbL 1.0.
<a class="moz-txt-link-freetext" href="http://www.openstreetmap.org/copyright">http://www.openstreetmap.org/copyright</a>' querystring='Pennsylvania'
polygon='false' exclude_place_ids='112071'
more_url='<a class="moz-txt-link-freetext" href="http://10.5.1.100/nominatim/search?format=xml&exclude_place_ids=112071&accept-language=en-US,en;q=0.8,nl;q=0.6&addressdetails=1&q=Pennsylvania">http://10.5.1.100/nominatim/search?format=xml&exclude_place_ids=112071&accept-language=en-US,en;q=0.8,nl;q=0.6&addressdetails=1&q=Pennsylvania</a>'><br>
<place place_id='112071' osm_type='node' osm_id='316987717'
place_rank='8'
boundingbox="38.4099889,43.5299889,-80.2878831,-75.1678831"
lat='40.9699889' lon='-77.7278831' display_name='Pennsylvania,
United States of America' class='place' type='state'
importance='0.66'
icon='<a class="moz-txt-link-freetext" href="http://10.5.1.100/nominatim/images/mapicons/poi_boundary_administrative.p.20.png">http://10.5.1.100/nominatim/images/mapicons/poi_boundary_administrative.p.20.png</a>'><br>
<state>Pennsylvania</state><country>United
States of
America</country><country_code>us</country_code></place></searchresults><br>
<br>
I also attempted a solution by expanding my import scope by using
a North America (complete US and Canada) file from
<a class="moz-txt-link-freetext" href="http://download.geofabrik.de/">http://download.geofabrik.de/</a>, and the results were the same. It
seems like at least for the US, these extracts are not very well
suited for Nominatim import. My next attempt will be to load from
a complete planet file.<br>
<br>
Thanks,<br>
John <br>
<br>
</span>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<div class="moz-cite-prefix">On 01/09/2015 01:48 PM, Sarah Hoffmann
wrote:<br>
</div>
<blockquote cite="mid:20150109184825.GA31010@denofr.de" type="cite">
<pre wrap="">Hi John,
On Fri, Jan 09, 2015 at 12:02:18PM -0500, John Shimer wrote:at
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I have a local Nominatim instance with a US/Pennsylvania extract
loaded. When a make reverse geocode requests, I never get a state
back unless the coordinates are close to the centroid of the state.
</pre>
</blockquote>
<pre wrap="">
It's most likely that the extract was cut a bit tight and didn't include
the full state boundary. You can add it to your database after the import
like this:
* Find the relation of Pennsylvania on the osm website and note the ID
(it's that <a class="moz-txt-link-freetext" href="http://www.openstreetmap.org/relation/162109">http://www.openstreetmap.org/relation/162109</a>)
* Import the relation to your database like that:
./utils/update.php --import-relation 162109 --index
* Verify that you can find the state now and it will give you back the
relation. Sometimes OSM data gets broken and then this part will fail.
* When all is well, you have to reindex everything.
Mark for indexing:
psql -d nominatim -c "select place_force_update(place_id) from placex where osm_type = 'R' and osm_id = 162109"
And reindex:
./utils/update.php --index --index-instances 2
The last part is really slow, I' m afraid. You can also simply reimport
the database with an extract that is a bit larger than the state you need.
Sarah
</pre>
<blockquote type="cite">
<pre wrap="">
I am aware that the openstreetmap version of Nominatim always
returns valid results for my test coordinates, so what am I doing
wrong?
for example... <a class="moz-txt-link-freetext" href="http://myserver/nominatim/reverse.php?format=xml&lat=40.658773&lon=-75.295520">http://myserver/nominatim/reverse.php?format=xml&lat=40.658773&lon=-75.295520</a>
returns
<reversegeocodetimestamp="Fri, 09 Jan 15 11:40:46
-0500"attribution="Data © OpenStreetMap contributors, ODbL 1.0. <a class="moz-txt-link-freetext" href="http://www.openstreetmap.org/copyright">http://www.openstreetmap.org/copyright</a>"querystring="format=xml&lat=40.658773&lon=-75.295520">
<resultplace_id="637091"osm_type="way"osm_id="19996066"ref="Baglyos
Circle"lat="40.6608768"lon="-75.2980609">
Baglyos Circle, Farmersville, Northampton, 18020, United States of America
</result>
<addressparts>
<road>Baglyos Circle</road>
<hamlet>Farmersville</hamlet>
<county>Northampton</county>
<postcode>18020</postcode>
<country>United States of America</country>
<country_code>us</country_code>
</addressparts>
</reversegeocode>
while
<a class="moz-txt-link-freetext" href="http://myserver/nominatim/reverse.php?format=xml&lat=40.736505&lon=-77.884580">http://myserver/nominatim/reverse.php?format=xml&lat=40.736505&lon=-77.884580</a>
returns
<reversegeocodetimestamp="Fri, 09 Jan 15 11:45:27
-0500"attribution="Data © OpenStreetMap contributors, ODbL 1.0. <a class="moz-txt-link-freetext" href="http://www.openstreetmap.org/copyright">http://www.openstreetmap.org/copyright</a>"querystring="format=xml&lat=40.736505&lon=-77.884580">
<resultplace_id="320232"osm_type="way"osm_id="11842937"ref="Ward
Alley"lat="40.735668"lon="-77.8842848">
Ward Alley, Pine Grove Mills, Centre, Pennsylvania, 16801, United
States of America
</result>
<addressparts>
<road>Ward Alley</road>
<hamlet>Pine Grove Mills</hamlet>
<county>Centre</county>
<state>Pennsylvania</state>
<postcode>16801</postcode>
<country>United States of America</country>
<country_code>us</country_code>
</addressparts>
</reversegeocode>
Thanks,
John
</pre>
</blockquote>
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">_______________________________________________
Geocoding mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Geocoding@openstreetmap.org">Geocoding@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/geocoding">https://lists.openstreetmap.org/listinfo/geocoding</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>