Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

House address not returning after setting style service tag to always. The driveways around this area are labled as service roads. #3402

Closed
dmurtha opened this issue Apr 26, 2024 · 6 comments

Comments

@dmurtha
Copy link

dmurtha commented Apr 26, 2024

What did you search for?

localhost/reverse.php?lat=36.04682&lon=-79.02518&zoom=18&format=jsonv2

What result did you get?

Local server returns just the State.

//House call local should return the house that is close by. The point is the service road that I would have called it a driveway.
FROM placex
WHERE ST_DWithin(placex.geometry, ST_GeomFromText(POINT(- 79.02518 36.04682), 4326), 0.001)
AND placex.parent_place_id = 54760332::BIGINT
AND (
placex.rank_address = 30
AND (
placex.housenumber IS NOT NULL
OR placex.name ? 'addr:housename'
)
)
AND placex.indexed_status = 0::SMALLINT
AND placex.linked_place_id IS NULL
ORDER BY distance LIMIT 1::INTEGER

https://nominatim.openstreetmap.org/reverse.php?format=jsonv2&addressdetails=1&lat=38.9616587&lon=-94.69911872009547&zoom=16&extratags=1
Returns what I want from getting the main road and than finding the house number, but if you had set turn style service tag to named it pulls the driveway and the second find house call does not return a result from the service street.

What result did you expect?

I would expect it to find the house number from the driveway/service road just as it does from the main street.

Like this returns
//Returns what I had expected above.
FROM placex
WHERE ST_DWithin(placex.geometry, ST_GeomFromText(POINT(- 79.02518 36.04682), 4326), 0.001)
AND placex.parent_place_id = 3359285::BIGINT
AND (
placex.rank_address = 30
AND (
placex.housenumber IS NOT NULL
OR placex.name ? 'addr:housename'
)
)
AND placex.indexed_status = 0::SMALLINT
AND placex.linked_place_id IS NULL
ORDER BY distance LIMIT 1::INTEGER

When the result in the right place and just named wrongly:

When the result missing completely:

Further details

Thanks for your service.

@mtmail
Copy link
Collaborator

mtmail commented Apr 26, 2024

https://nominatim.openstreetmap.org/ui/reverse.html?lat=36.04682&lon=-79.02518&zoom=18

If 36.04682,-79.02518 returns only the state then I'd say something is wrong with your import. Did the import finish without errors? Can you give us more information on Nominatim version, when it was imported and what was imported?

Nominatim only imports named features. Driveway vs service roads makes no difference here because both have no names in OSM data.

https://nominatim.openstreetmap.org/ui/reverse.html?lat=38.9616587&lon=-94.69911872009547&zoom=18

The house with house number at 38.9616587, -94.69911872009547 is in OSM data so it should also return the house number in your local installation.

but if you had set turn style service tag to named it pulls the driveway and the second find house call

Nominatim has no turn style feature. Are you talking about a different software?

@mtmail
Copy link
Collaborator

mtmail commented Apr 26, 2024

Ah sorry, in the title you said you changed the style file. Can you post the changes (only the relevant lines). Were the changes made before or after the import?

@dmurtha
Copy link
Author

dmurtha commented Apr 26, 2024

From file import-extratags.lua
under highway
original
service = 'named',
updated
service = 'always',

Import works fine worked to completion, database check lists OK for all aspects and test lookup values work and all other aspects of the site runs as expected.

@dmurtha
Copy link
Author

dmurtha commented Apr 26, 2024

Version nominatim 4.4 postgres 14 ubuntu 22 new UI website 3.5.2. Imported North America from 4/21/2024, using the python web process with apach2. No additional software is installed and it's a fresh install.

@mtmail
Copy link
Collaborator

mtmail commented Apr 28, 2024

Satelliate imagery suggests there's a house at https://nominatim.openstreetmap.org/ui/reverse.html?lat=36.04682&lon=-79.02518&zoom=18 but the address is not in OpenStreetMap data yet.

With default installation Nominatim returns the house with number 4301 about 40m away. When you set service = 'always', in the import style then it returns the unnamed service road.

I can't reproduce that only the state is returned. I see "display_name": "Orange County, 27705, United States", but that's because I only imported the nearby area, not the whole state.

An address with house number is a better result than an unnamed road but that road happens to be closer to the search point. Are you suggesting the road should be ignored in this case?


Local test import:

cd ~/Nominatim
git checkout v4.4.0

cd ~/nominatim-project
nominatim --version
Nominatim version 4.4.0-0 (e5a5f026)

wget https://download.geofabrik.de/north-america/us/north-carolina-latest.osm.pbf
# https://www.openstreetmap.org/relation/2528730
osmium getid  --add-referenced --output orange-county-boundary.osm north-carolina-latest.osm.pbf r2528730
cp ~/Nominatim/settings/import-extratags.lua ~/nominatim-project/import-extratags2.lua 
vi import-extratags2.lua 
# now change service = 'named', to  service = 'always', and save file
cat .env
NOMINATIM_DATABASE_DSN='pgsql:dbname=nominatim_orange_county'
NOMINATIM_IMPORT_STYLE=import-extratags2.lua
nominatim import --osm-file orange-county.osm.pbf --no-partitions --reverse-only --no-updates
nominatim reverse --lat 36.04682 --lon -79.02518 --format jsonv2
{
    "place_id": 180710,
    "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
    "osm_type": "way",
    "osm_id": 844934264,
    "lat": "36.046770492246075",
    "lon": "-79.02509969760324",
    "category": "highway",
    "type": "service",
    "place_rank": 27,
    "importance": 0.04000999999999999,
    "addresstype": "road",
    "name": "",
    "display_name": "Orange County, 27705, United States",
    "boundingbox": [
        "36.0466405",
        "36.0470292",
        "-79.0251487",
        "-79.0249402"
    ]
}

@dmurtha
Copy link
Author

dmurtha commented Apr 29, 2024

The starting point lat\lon is the service road not the main road. The live version snaps to the main road than the house. The service "always" version searches from the original point of the service road (as it should) looking for a house number and returns no results. I felt it should return the house number as it's so close to the house. I have a lot of other service points that are doing this action in the area.

//second House search call local should return the house that is close by. The point is from the service road that I would have called a driveway.
FROM placex
WHERE ST_DWithin(placex.geometry, ST_GeomFromText(POINT(- 79.02518 36.04682), 4326), 0.001)
AND placex.parent_place_id = 54760332::BIGINT
AND (
placex.rank_address = 30
AND (
placex.housenumber IS NOT NULL
OR placex.name ? 'addr:housename'
)
)
AND placex.indexed_status = 0::SMALLINT
AND placex.linked_place_id IS NULL
ORDER BY distance LIMIT 1::INTEGER

@osm-search osm-search locked and limited conversation to collaborators May 1, 2024
@lonvia lonvia converted this issue into discussion #3406 May 1, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants