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

Werner Macho werner.macho at gmail.com
Wed Dec 15 05:18:25 PST 2021


PS: I maybe falsely assumed you are self compiling.
If you want I can try that today evening and maybe create a pull request
for master.

regards
Werner

On Wed, Dec 15, 2021 at 2:13 PM Werner Macho <werner.macho at gmail.com> wrote:

> 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/79915332/attachment.html>


More information about the Qgis-user mailing list