[FREE] Extension: WGS84 to Gauss-Krueger converter

Converts WGS84 coordinates into the Gauss-Krueger coordinate system and vice versa. By Django2025
Note: This extension code only works precisely in Germany (and adjacent areas).


:package: Package: com.django.gps2gk
:floppy_disk: Size: 6,55 KB
:iphone: Minimum API Level: 7
:date: Updated On: 2025-12-17T23:00:00Z
:computer: Built & documented using: FAST-CLI v2.6.0

ConvertedToGK_Event

Returns converted Gauss-Krueger coordinates.

Parameter Type
northing number
easting number

ConvertedToWgs84_Event

Returns converted WGS84 coordinates.

Parameter Type
latitude number
longitude number

ConvertToGK_Method

Converts WGS84 to Gauss-Krueger coordinates.

Parameter Type
latitude number
longitude number

ConvertToWgs84_Method

Converts Gauss-Krueger to WGS84 coordinates.

Parameter Type
northing number
easting number

*** Update ***

  • math fixes

com.django.gps2gk.aix (8.2 KB)
GkTest.aia (11.8 KB)

2 Likes

For the uninitiated (which included me :wink: )

1 Like

There is no aix uploaded.

2 Likes

Date calculations are incorrect; I am approximately 30 km away from my actual location.

What about showing us some relevant blocks?
Which method are you using? ConvertToGK or ConvertToWgs84?
Does it work the other way around for you?

Taifun

1 Like


I'll get back to you this evening regarding the coordinate discrepancy. Here's an excerpt from Gemini: "1. The "Bessel Ellipsoid" & Datum Shift (Potsdam Datum)

WGS84 uses the GRS80 ellipsoid, while the German Gauss-Krüger system is based on the Bessel ellipsoid.

The error: If the GPS coordinates are directly applied to the GK projection formula without first performing a 7-parameter transformation (Helmert transformation) from WGS84 to DHDN (Potsdam Datum), offsets occur.

The 30 km: A simple datum shift usually only causes errors of about 150–200 m. 30 km is more indicative of the nearest point.

  1. Dynamic Meridian Strip Calculation

Gauss-Krüger is divided into 3° strips. Each strip has a central meridian." (3°, 6°, 9°, 12°, 15° East).

The question for him: Does the extension automatically calculate the central meridian based on the longitude?

The formula: Meridian = round(3 longitude) ⋅ 3.

The problem: If it's hard-coded and always calculates with 9° (Zone 3), but you're at 10.5° or 12°, the distortion at the edge of the projection becomes massive. A 30 km deviation is typical for a "zone jump" when calculating in the wrong zone.

  1. False Easting (The 500,000 m Offset)

In the GK projection, 500,000 is always added to the easting value to prevent negative values. Additionally, the number of the meridian zone is often prepended.

Example Zone 4 (12°): The easting value It then starts with a "4" (e.g., 4,567,000).

Possible source of error: Perhaps he's adding the zone code incorrectly or using a US "false easting" (different values) that isn't compatible with German coordinate systems.

would you please give this aia a try, if it works better for you?
GkTest.aia (9.8 KB)

Sorry, your GKTest.aia link does not link Django. :disappointed:

uploaded again

1 Like

My GPS: lat=51.56115 lon=10.82711
according to Koordinaten-umrechner.de, it is:
GK: easting=4418772.708 northing=5714723.829
with your extension
GK: easting=4449441.093 northing=5714180.866
calculated back with your extension
lat=51.56342 lon=11.27089

ok, I did several checks and you are right! Thx for reporting!
I will take a look into it.

** Update first post ***

Are you a surveyor, or how did you come up with the idea of ​​programming an extension for Gauß-Krüger? I'm currently programming an app for an RTK rover and am doing all the transformations with a wep api. Your extension would be good for a current value display

Years ago, I often went metal detecting and logged finds for the heritage preservation authority. They required me to log Gauss-Krueger coordinates for my founds.
** Note:This extension code only works precisely in Germany (and adjacent areas).**

It's significantly better, but I think the conversion to the Potsdam format is missing. I calculated everything in Kodular back then, but unfortunately I can't find the calculation anymore.

In the forward and reverse calculations, both markers (green location sensor) are almost identical, but when calculating only according to the coordinate system, there is a difference of 104m.

No, that's integrated. Of course, you need to use the full coordinate resolution and not reduce it to decimal places (but I think you already know that).

Unfortunately, I can't be more specific. I asked Gemini, and it claims the code delivers true and precise Gauss-Krüger coordinates, as used in German cadastral maps.