Ticket #10 (closed bug report: wontfix)

Opened 3 years ago

Last modified 3 years ago

geometry and unique ID columns hardwired into scripts

Reported by: kyngchaos Owned by: anton
Priority: major Milestone: Version 1.1
Component: pgRouting package Version:
Keywords: Cc:

Description

In the pgrouting scripts, the geometry column is hardwired to "the_geom" and the unique feature ID column is hardwired to "fid". These appear to be the defaults created with the shp2psql utility. But other utilities may use other column names - the defaults for GDAL with ogr2ogr are "wkb_geometry" and "ogc_fid".

The geometry column is stored in the "geometry_columns" table, so it should be looked up there.

The feature ID column isn't saved in a table, but it shouldn't be too hard to check for the obvious - "fid", "ogc_fid", and/or the first primary key or unique indexed column that is an integer type.

Change History

Changed 3 years ago by anton

  • owner set to anton
  • status changed from new to assigned
  • version 1.0.0a deleted
  • milestone set to Version 1.0

Thanks William,

Yes, it is be important issue. We will fix it until the final release of version 1.0.

Changed 3 years ago by anton

  • milestone changed from Version 1.0 to Version 1.1

Changed 3 years ago by anton

  • status changed from assigned to closed
  • resolution set to wontfix

Actually all core and wrapper functions need certain column names. It is much more easy to rename columns.

Changed 3 years ago by kyngchaos

Well, it may be simple to rename the fid column to match pgrouting. But then the geometry column must be renamed in two places: the data table and the postgis geometry_columns table. So I still think that at least the geometry column should be looked up, the info is there.

Another option for the fid column would be to have a parameter in the functions. You could do this on a couple levels:

dijkstra_sp(geom_table, fid, source, target)

contains the core of the function, and:

dijkstra_sp(geom_table, source, target)

would behave as the current function does and pass "gid" to the first function.

Note: See TracTickets for help on using tickets.