Ticket #1465 (reopened defect)

Opened 1 year ago

Last modified 5 months ago

Better error report when src and dst datasets are the same

Reported by: mloskot Assigned to: mloskot
Priority: normal Milestone: 1.6.0
Component: Utilities Version: 1.4.0
Severity: minor Keywords: ogr2ogr
Cc: warmerdam, rouault

Description (Last modified by mloskot)

Here is example of ogr2ogr use case in which a user specifies the same data set for both: source and destination:

ogr2ogr -s_srs EPSG:2180 -t_srs EPSG:2173 D:\OCK_region.shp D:\OCK_region.shp
ERROR 1: D:\OCK_region.shp is not a directory.
ESRI Shapefile driver failed to create D:\OCK_region.shp

The error message is unclear and user may be confused because it's hard to find out what is the actual reason of the problem.

Enhancement proposal is to make this error message more meaningful.

Change History

04/03/07 12:40:26 changed by hobu

  • priority changed from highest to normal.
  • version changed from unspecified to 1.4.0.
  • component changed from default to OGR_SF.
  • description changed.
  • milestone set to 1.5.0.

04/17/07 23:05:38 changed by mloskot

  • status changed from new to assigned.
  • description changed.

10/29/07 01:33:51 changed by mloskot

  • keywords set to Shapefile.

12/11/07 09:16:33 changed by warmerdam

  • milestone changed from 1.5.0 to 1.6.0.

01/27/08 12:15:18 changed by rouault

  • keywords changed from Shapefile to ogr2ogr.
  • component changed from OGR_SF to Utilities.
  • status changed from assigned to closed.
  • resolution set to fixed.

Fix commited in trunk in r13605

01/27/08 13:12:57 changed by warmerdam

  • status changed from closed to reopened.
  • type changed from enhancement to defect.
  • resolution deleted.
  • cc set to warmerdam, rouault.

Even,

I don't think the change applied is appropriate. It is perfectly reasonable, for instance, to do an ogr2ogr command from and to the same postgres database instance. I think the change needs to be backed out and some additional consideration given to cases where these is appropriate and not appropriate.

For one thing, the source and destination should only be allowed to be the same when we are operating in -update mode (updating an existing datasource instead of opening a new one).

I'm tempted to suggest that if the source and destination are the same we ought to only open one datasource for both roles, but in fact some datasources may not operate well in that situation (reading from one layer at the same time we are writing to another layer) so I hesitate to push that idea.

01/27/08 13:18:49 changed by rouault

Hum, I didn't think that it could be that complex. Change reverted in r13606.