Opened 14 years ago

Closed 14 years ago

#2092 closed bug (worksforme)

fTools export/add geometry tool should use source dataset CRS as target dataset CRS

Reported by: marisn Owned by: cfarmer
Priority: major: does not work as expected Milestone: Version 1.4.0
Component: Projection Support Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: Gentoo
Platform Version: Awaiting user input: no

Description

Start new project (project CRS is set to WGS84);
Add some vector data source with different CRS (e.g. EPSG:25884);
Launch Vector (fTools)-> Geometry-> Export/Add geometry colums;
Select added vector as input, specify output and press OK.

Resulting shapefile has correct coordinate data in database columns, still shapefiles CRS is defined as WGS84 but data (vector point coordinates) still have same values as in input data source (i.e. EPSG:25884). Thus anyone who forgets to enable "CRS change on fly" option gets bogous shapefile as result. Using source CRS for destination when "on the fly" reprojection is not enabled is a safe fail-back mechanism in such cases.

Tested on QGIS 1.4.0 r12103M with fTools 0.5.10.

Change History (5)

comment:1 by borysiasty, 14 years ago

Owner: changed from borysiasty to cfarmer

in reply to:  description ; comment:2 by cfarmer, 14 years ago

Replying to marisn:

All fTools functions should use the input dataset CRS for all output datasets. However, this means that, for example, shapefiles with no .prj file will automatically default to the project default CRS (often WGS84). In other words, the fTools functions ignore any manually specified CRS info. Is it possible that this is the cause for the misspecified shapefile? 'On the fly' option should *not* affect any fTools functions...

in reply to:  2 ; comment:3 by marisn, 14 years ago

Replying to cfarmer:

Replying to marisn:

All fTools functions should use the input dataset CRS for all output datasets. However, this means that, for example, shapefiles with no .prj file will automatically default to the project default CRS (often WGS84). In other words, the fTools functions ignore any manually specified CRS info. Is it possible that this is the cause for the misspecified shapefile? 'On the fly' option should *not* affect any fTools functions...

fTools doesn't use input CRS for output. Target CRS is determined by settings in "Settings" -> "Options" -> "CRS". By default (?) it will use WGS84 as target CRS and there is no such option as "input CRS".

I have created more generic enhancement ticket #2093 about project CRS handling in QGIS might solve also this issue, still if fTools result generation is not affected by OTFR, there still is a room for bogus results as described per this bug. Thus input CRS as target CRS is the safest option.

in reply to:  3 comment:4 by cfarmer, 14 years ago

Component: Python plugins and bindingsProjection Support

fTools doesn't use input CRS for output. Target CRS is determined by settings in "Settings" -> "Options" -> "CRS". By default (?) it will use WGS84 as target CRS and there is no such option as "input CRS".

In actual fact, fTools does indeed use the input CRS for all outputs, so it is possible that the issue reported here is a more generic CRS issue. Perhaps QGIS is not properly recognizing the input CRS, and is therefore unable to output it correctly? Would it be possible to attach the problem shapefile to this ticket (or a more generic CRS ticket)?

Regards,

Carson

comment:5 by marisn, 14 years ago

Resolution: worksforme
Status: newclosed

Hm. I upgraded and recompiled trunk to version r12169M and also can not reproduce problem anymore. Output layers get correct CRS. Seems to be some minor glitch fixed by some commit between 12103 and 12169 (or it's a Heisenbug).

Note: See TracTickets for help on using tickets.