Skip to content
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

Returning coordinates at the correct side of the street #1605

Open
lucas-abbate opened this issue Feb 22, 2022 · 7 comments
Open

Returning coordinates at the correct side of the street #1605

lucas-abbate opened this issue Feb 22, 2022 · 7 comments

Comments

@lucas-abbate
Copy link

Use-cases

Our team wants to categorize houses according to their census tract, based on the people's address. Most census tracts (at least in Argentina's big cities) are defined by 2 o 3 squares and use streets as delimiters. Therefore, being able to determine on which side of the street a house is is key.

Proposal

I don't even know if it is possible to return the side of the road based on the address, but in Argentina (and I think in some other countries too), one side of a street is even while the other is odd. Also, other geocoders like Nominatim (or Google Maps), returns the coordinates on the correct side of the street.

Captura de pantalla 2022-02-22 171615

(the yellow dots are extracted from Nominatim, the red ones from Pelias, and the green lines are the census tracts. There are fewer because we are still running our queries, but by checking their info, some should be on a side and the rest on the other).

Thanks for the attention and sorry for the poor english :)

@missinglink
Copy link
Member

@lucas-abbate
Copy link
Author

Isn't that what I've done when installing Pelias??

@missinglink
Copy link
Member

missinglink commented Feb 24, 2022

Pelias is composed of several smaller components, the interpolation service is a SQLite database which is built independently of the elasticsearch index.

So while the interpolation database preserves the side of the street (what is called 'parity' in the SQLite database) it's not exposed to other services as this requirement has never been requested before.

If you have installed Pelias using the pelias/docker utility then you will find the address.db and street.db SQLite databases in your configured DATA_DIR.

I recommend you have a look in the address.db as it likely has the information you require.

@missinglink
Copy link
Member

Out of curiosity; how do you define 'left' and 'right'?
We base it on the bearing from the start point to the end point of the linestring, but this can obviously be reversed and therefore return the opposite classification, do you have a suggestion of how best to normalize this?

@lucas-abbate
Copy link
Author

I've seen the parity thing. Is there a way to find out on whick side the linestring starts and then define left or right?
Maybe the linestrings could be arbitrarily defaulted to start always on the same side (i.e, the southern dot of the linestring is always the start). Then, all left or right side could be normalized (but I don't know if it is possible to arbitrarily define the starting point of the linestring).
Anyways. Thanks for the help!

@missinglink
Copy link
Member

No problem, please close this issue if you found a solution.

@missinglink
Copy link
Member

missinglink commented Feb 24, 2022

Like you mentioned, you could (for instance) select the most southerly point as the starting point, it would make the calculation deterministic but I don't think that would guarantee that Argentine addresses are given the correct parity.

I was wondering if the Argentinian authority has some sort of official policy in this regard about which is the start and the end of a street?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants