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

Table "ways" has "gid" as id #276

Closed
Doev opened this issue Jun 26, 2020 · 2 comments
Closed

Table "ways" has "gid" as id #276

Doev opened this issue Jun 26, 2020 · 2 comments

Comments

@Doev
Copy link

Doev commented Jun 26, 2020

The table "ways" has "gid" as id, but pgrouting set a default to "id". It is not really a problem, but as a beginner you have to find out first.

For example:

select pgr_analyzegraph('ways', 0.000001); -> Fail
select pgr_analyzegraph('ways', 0.000001, 'the_geom', 'gid', 'source', 'target', 'true'); -> OK

@dkastl
Copy link
Member

dkastl commented Jun 30, 2020

gid is frequently used with spatial data in PostgreSQL/PostGIS and so it has been for long time used as default in pgRouting functions and documentation. It's similar to name the geometry colum the_geom and not geom.

id isn't a default term either. Some may name it uid, rid or vid. If you are not happy with the extra function parameters, you can easily create a VIEW of your table to match with the defaults.

Because changing something like this would be confusing for many, probably will break backwards compatibility and just causes extra work with (in my opinion) no real benefit, pgRouting is not planning to change the status quo.

@dkastl dkastl closed this as completed Jun 30, 2020
@Doev
Copy link
Author

Doev commented Jul 7, 2020

I agree, but the table "ways_vertices_pgr" is using "id" and not "gid" as primary key.

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