[Qgis-user] Transform some records in an SQL Server table

Johannes Kröger (WhereGroup) johannes.kroeger at wheregroup.com
Tue Jan 24 00:58:12 PST 2023


Moin Michael,

yay for the zone prefix "32" for the easting because you use those huge 
numbers to determine which of the two CRS they belong to. If the easting 
(x) value is > 30000000, then you have to transform the coordinates to 
EPSG:25832, otherwise you don't.

Some untested pseudocode:

if(
   (x(@geometry) > 30000000),transform($geometry, 'EPSG:4647', 
'EPSG:25832'), $geometry)

Grüße an die Nordsee
Hannes

PS: For older QGIS use $geometry


Am 24.01.23 um 09:02 schrieb Reetz, Michael (NLPVW) via QGIS-User:
>
> Hello list,
>
> I have an SQL Server table with a geometry attribute. Most of the 
> records are in EPSG 25832 but some are in EPSG 4647. Is it possible to 
> transform these records to EPSG 25832? I’ve tried to do this with 
> „geom_to_wkt(transform($geometry, 'EPSG:4647', 'EPSG:25832'))“ in the 
> field calculator. But since QGIS assumes that all coordinates are 
> already in this crs, this doesn’t work. Any other idea?
>
> Best regards
>
> Michael
>
> *****************************************
>
> Michael Reetz
>
> Datenbanken und Anwendungsentwicklung
> Nationalpark-Verwaltung Niedersächsisches Wattenmeer
> Virchowstr. 1 | 26382 Wilhelmshaven
> Tel.: +49 (0) 4421 911 291
> e-mail: michael.reetz at nlpvw.niedersachsen.de 
> <mailto:michael.reetz at nlpv-wattenmeer.niedersachsen.de>
> Web: https://www. <https://www./>_nationalpark-wattenmeer.de_
>
>
> _______________________________________________
> 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

-- 
Johannes Kröger / GIS-Entwickler/-Berater

---------------------------------------------
Schon gewusst?


In unserem Blog geben wir Tipps & Tricks zu
Open-Source-GIS-Software und berichten aus
unserem Experten-Alltag:
https://wheregroup.com/blog/
---------------------------------------------

WhereGroup GmbH
Grevenweg 89
20537 Hamburg
Germany

Tel: +49 (0)228 / 90 90 38 - 36
Fax: +49 (0)228 / 90 90 38 - 11

johannes.kroeger at wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
-------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230124/825d18b6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 6513 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230124/825d18b6/attachment.png>


More information about the QGIS-User mailing list