[Qgis-user] Change auto-selected column headers behaviour at delimited text import

Werner Macho werner.macho at gmail.com
Wed Dec 15 05:13:43 PST 2021


Hi Roland,

without trying it my first guess would be that the file

QGIS/src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
line number 587 has something to do with it ..

(trySetXYField( fieldList, isValidCoordinate, QStringLiteral( "longitude"
), QStringLiteral( "latitude" ) );
  trySetXYField( fieldList, isValidCoordinate, QStringLiteral( "lon" ),
QStringLiteral( "lat" ) );
  trySetXYField( fieldList, isValidCoordinate, QStringLiteral( "east" ),
QStringLiteral( "north" ) );
  trySetXYField( fieldList, isValidCoordinate, QStringLiteral( "x" ),
QStringLiteral( "y" ) );
  trySetXYField( fieldList, isValidCoordinate, QStringLiteral( "e" ),
QStringLiteral( "n" ) );)

maybe give it a try.

regards
Werner

On Wed, Dec 15, 2021 at 2:00 PM Roland Spielhofer <rspiel at gmx.net> wrote:

> Hi,
> when importing delimted text using the data source manager, QGIS
> automagically detects possible column headers that may hold geometry
> information - in the "Geometry definition" panel.
>
> In my experience, if column names like "lat", "lon", "x" or "y" exist,
> QGIS automagically selects them for "X fIeld" and "Y field"
> See also
> https://imgur.com/a/CRKRKtT
> where this part is highlighted.
>
> I often have column names like "RW" (="Rechtswert") that hold the x
> coordinate and "HW" ("Hochwert") for the y cordinate. German speaking
> surveyors may be familiar with the terms...
>
> Anyway, what I am looking for is how to extend the list of lat, lon, x, y,
> ... to make QGIS also senitive to my RW and HW column headers. Is there a
> way to customize that?
>
>
> Regards,
> Roland
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20211215/d31af2ef/attachment.html>


More information about the Qgis-user mailing list