This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH avpn-extract v2] Fix coordinates order for maps.google links

Message ID
DKIM signature
Download raw message
Patch: +4 -4
GeoJSON uses [lng, lat] order. Coincidentally this worked for
/maps/embed links because the extraction was inverted too.

This fixes maps.google links POIs being shown in the wrong location.
 main.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/main.go b/main.go
index 3666174..8f6e1e2 100644
--- a/main.go
+++ b/main.go
@@ -111,9 +111,9 @@ func fetchMember(pageURL string) (*geojsonFeature, error) {
		if len(l) <= 6 {
			return nil, fmt.Errorf("invalid map URL <%v>: missing lat/lng fields", mapRawURL)
		rawLat := l[5]
		rawLng := l[6]
		if !strings.HasPrefix(rawLat, "2d") || !strings.HasPrefix(rawLng, "3d") {
		rawLat := l[6]
		rawLng := l[5]
		if !strings.HasPrefix(rawLat, "3d") || !strings.HasPrefix(rawLng, "2d") {
			return nil, fmt.Errorf("invalid map URL <%v>: unsupported Google Maps link", mapRawURL)

@@ -158,7 +158,7 @@ func fetchMember(pageURL string) (*geojsonFeature, error) {
		Geometry: geojsonPoint{
			Type:        "Point",
			Coordinates: [2]float64{lat, lng},
			Coordinates: [2]float64{lng, lat},
	}, nil

base-commit: bef9a0be18ba1ed00fc72da95116a982643dd895
Message ID
<20220523173201.2476-1-delthas@dille.cc> (view parent)
DKIM signature
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)