-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Change 'gid' column in 'ways' table to id' #290
Comments
Yes, you are right. Some time ago the field name was Documentation should be changed in pgRouting docs. You could propose the change opening a PR. Thanks @skyNacho |
It's correct that sometimes you see |
Understood. In that case I will close this issue and will improve the documentation to avoid confusion for new users. |
I am opening again.
More long time ago was On the rewrite I changed it to
I made that commit, the problems were that osm2pgrouting users were using with The default on pgRouting's inner query is But back to the
if
Maybe have a configuration file with column names. As new users might want |
Well, I don't know that well about the But somehow I like in our documentation that we always write like
Because it shows in a very simple example, that the column names in a network table can actually have different names, and to make them fit you just need to use So I don't think it's possible to find a common default anymore, neither for |
We dont use
|
To me it was confusing to follow the installation documentation and hitting an error when pgr_dijsktra could not find the 'id' column. So, either all documentation is reviewed and updated to ensure examples work out-of-the-box, or the naming convention in osm2pgrouting is modified so that tables work out-of-the-box (this would require reviewing all documentation anyway). I understand @dkastl 's point to showcase the flexibility of pgRouting with regards to column names. However, forcing all queries to use alias seems an over complication. My instinct would be to adopt PostGIS's naming as the standard. But I am unable to evaluate the implications in terms of documentation review, updates in production deployments, modifications in third-party software and so on. |
@skyNacho What about to make it configurable? |
From my perspective making it configurable, the pgRouting user opts to use names that are not by default on pgRouting |
That could be a suitable solution. It could have a default that simplifies operation but provide flexibility for cases where the naming conventions are different for whatever reason. Do you have an example of how the configuration would be like? |
Currently we have xml for configuration but following the xml format, to something like this
So an old style user of som2pgrouting would change to
maybe a spanish would create
|
I think it makes sense. So, the github repository would provide different xml options and one can decide which one to choose or even to adapt it if needed. I guess this change would not affect existing deployments of pgRouting, but only new OSM->pgRouting data imports with a new version of osm2pgrouting, right? Regarding the question on json vs xml, although I tend to favor json, if xml is already in use for configuration I would stick to that. |
Yes, it would require a new major version. because it would break code, |
Ok, so we should still review the documentation anyway to make sure |
I just sent a pull request with minimal changes to pgRouting concepts section. I believe that should be enough for new users to understand the use of aliases in pgRouting queries. |
Problem
After importing OSM data using osm2pgrouting, path calculations with pgRouting give an error: column "id" not found. Need to change by hand from "gid" in table "ways" to "id" to make it work.
To Reproduce
Just follow the instructions in the documentation (https://github.com/pgRouting/osm2pgrouting -> "how to use it" and https://docs.pgrouting.org/latest/en/pgRouting-concepts.html#getting-started)
Expectation
Following the instructions step by step, the process should work out of the box, without undocumented errors.
Sample Data
Platform/versions
PostgreSQL 11.11
PostGIS 3.1.1
pgRouting 3.1.0
The text was updated successfully, but these errors were encountered: