Ticket #1465 (new defect)

Opened 6 years ago

Last modified 3 years ago

Better error report when src and dst datasets are the same

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

Description (last modified by mloskot) (diff)

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

Changed 6 years ago by hobu

  • priority changed from highest to normal
  • version changed from unspecified to 1.4.0
  • component changed from default to OGR_SF
  • description modified (diff)
  • milestone set to 1.5.0

Changed 6 years ago by mloskot

  • status changed from new to assigned
  • description modified (diff)

Changed 6 years ago by mloskot

  • keywords Shapefile added

Changed 5 years ago by warmerdam

  • milestone changed from 1.5.0 to 1.6.0

Changed 5 years ago by rouault

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

Fix commited in trunk in r13605

Changed 5 years ago by warmerdam

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

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.

Changed 5 years ago by rouault

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

Changed 3 years ago by warmerdam

  • owner changed from mloskot to warmerdam
  • status changed from reopened to new
  • milestone 1.6.4 deleted

I'll take this back to account for it being effectively unassigned. I don't think the issue is pressing, so no milestone.

Note: See TracTickets for help on using tickets.