#!/usr/bin/perl
# Flip coordinates for antipodes (of Paraguay / Argentina border section)
# Copyright : https://www.fsf.org/copyleft/gpl.html
# Author : Dan Jacobson -- https://www.jidanni.org/geo/antipodes/programs/
# Created On : Mon Oct 12 15:36:42 2020
# Last Modified On: Thu Oct 15 07:51:29 2020
# Update Count : 25
use strict;
use warnings FATAL => q(all);
## First using the tip in
## https://help.openstreetmap.org/questions/56810/overpass-turbo-bbox-reducing-amount-of-data-for-a-relation-with-many-ways?
## I used this to get the data, and saved it into KML
## [out:json][timeout:25];
## relation(389884)->.interestingrelations;
## way(r.interestingrelations)->.alltheirways;
## way.alltheirways(-25.2,-59.5,-24.2,-58)->.waysinside;
## .waysinside out geom;
## OR just
## http://overpass-turbo.eu/s/Z1J relation(389884); way(r)(-25.2,-59.5,-24.2,-58); out geom;
while (<>) {
s!Copyright!DATA FLIPPED FOR ANTIPODES by Dan Jacobson.\nhttps://www.jidanni.org/geo/antipodes/programs/\n$&!;
s/(-\d+\.\d+),(-\d+\.\d+)/$1+180 . "," . -$2/eg;
print;
}
## And this is what I put in Google MyMaps:
## 台灣對蹠巴拉圭、阿根廷國界
## Paraguay (south of Miaoli) / Argentina border antipode overlayed on Taiwan. © OpenStreetMap contributors.]]>