Last month Njål Stabell, SAP Mentor and Co-Founder at Neptune Software, told he had learned from me that “Wrocław is the central of the Universe”. It was not exactly what I had said, but that triggered another interesting discussion about the center of …no, not the whole Universe, but… Europe.
Did you know that the first ever center of Europe was calculated in 1775 by the royal cartographer Szymon Antoni Sobiekrajski? As the first person in history he calculated the exact geographic center of Europe as the equal distances from the extreme points of Europe: in Portugal vs. Central Ural, in Norway vs. Southern Greece. Islands were not taken into consideration. According to his computation, it was 53°34′39″N 23°06′22″E. There is a monument commemorating that fact in Suchowola, a town in the north-eastern corner of Poland.
By Krzysztof Kundzicz – CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=24706639
It was the first, but not the last “center of Europe”. Many other – in Lithuania, Belarus, Slovakia, Hungary, and Ukraine – appeared since then, claiming to be “the one and only”, building monuments, giving certificates to visitors, and even citing the Guinness Book of World Records as the proof!
And if some could not be the middle point of the European continent, they were trying at least to be the center of European Union. The only problem here though is the constantly moving midpoint thanks to the EU growing, and more recently shrinking. Small town of Gädheim in Germany already has been announced to be the new center of EU after the Brexit.
But could we use SAP HANA’s geospatial capabilities to tell where the center of Europe continent is, and finally close this dispute once and for all? Sounds like a good idea! [If you haven’t tried SAP HANA geospatial yet, it is very easy to get basics with tutorials: https://www.sap.com/developer/tutorials/hana-spatial-intro1-point.html]
After some research, I found the shapefile with Europe and other continents here: http://techcenter.jefferson.kctcs.edu/gis/data/default.html –> Continents. The downloaded zip file contained the shapefile that could be loaded into SAP HANA with Spatial Reference ID =
I used the schema
TESTGEO and the target table name was
continent when loading shapefile. Quick check of the table content…
select "CONTINENT", "SHAPE".ST_asEWKT(), "SHAPE".ST_asSVG() from "TESTGEO"."continent"
… and the shape of Europe exported as SVG into the web browser (I modified SVG slightly to add yellow fill color):
Looks good, so let’s calculate the midpoint of this shape using ST_Centroid() method in SAP HANA db.
select "CONTINENT", "SHAPE".ST_Centroid().ST_asWKT() from "TESTGEO"."continent"
Let’s now map the
POINT (28.249040348 55.854069296), which is 55°51’14.7″N 28°14’56.5″E somewhere in the northern part of Belarus:
Are we done? Can we update Wikipedia and publish the real “one and only” midpoint of the European continent?! Not, really :-/
The calculated point was the mathematical centroid of the multipoligon shape. Here I used the specific shape found on the Internet. And this shape is one of many possible ways to project spherical 3-dimensional Earth shape on 2D. Should I choose another projection, like the azimuthal equidistant projection from my previous blog, and the multipolygon representing the shape of Europe would be different, and so the centroid would be different as well.
But as well we were not that much off, as the point calculated here by SAP HANA is close to one of many European midpoints – the one calculated by Belorussian scientists in 2000, and then recalculated in 2008: 55°30′0″N 28°48′0″E, i.e.
POINT (28.8 55.5). And where by the way you can get a certificate of visiting the Center of Europe as well. It is only 72.8km away from what we just calculated with SAP HANA!
select "CONTINENT", "SHAPE".ST_Centroid().ST_Distance(new ST_POINT ('POINT (28.8 55.5)',1000004326),'kilometer') as DistanceFrom from "TESTGEO"."continent" where "CONTINENT"='Europe'
Now, it is your turn to find some other projections of the European continent (or any other continent of your choice) and check what its mathematical center is. Have fun!
PS. And if you are interested to learn more about spatial processing with SAP HANA, then do not miss openSAP course https://open.sap.com/courses/hsgs1 starting on April 25th!