Determining coordinates by photo, solving geo-informational puzzles

21 November 2024 11 minutes Author: Cyber Witcher

Geoinformation intelligence (GEOINT) is an important tool for terrain analysis using satellite images, photographs, and maps. In this article, we will show how to determine the coordinates of the shooting location, based on the analysis of the photo.

Let’s start

We determine the coordinates of the place according to this photo:

In the foreground is a three-story multi-apartment building covered with rather unusual tiles. The intersection is probably T-shaped. Numerous wires stretched in the air are visible. An unknown white object can be seen behind the house.

The sign is an analogue of the commonly accepted hexagonal STOP sign, which indicates a secondary road and the need to stop to give way to vehicles on the main road. The “No parking” sign repeats the rule of no parking at a distance of 5 meters from the intersection. In Japan, the effect of such a sign extends in all directions, not just by the sign.

The pedestrian crossing sign has a special purpose — it is installed near children’s educational institutions within a radius of approximately 300 meters. There is a possibility that the colors in the picture are distorted. The Auto Color function in Photoshop was used to restore the original colors.

That’s much better

At this point, even if the QR code in the upper left corner was invisible before, it is now simply impossible to ignore. However, it is not possible to recognize it directly, so it is necessary to restore it manually. Astute contributor @Soulxwner found a hidden link in the quest to download the original in PNG format: https://ibb.co/y47zRmT. The metadata is unfortunately missing, but the image itself is identical, except for a less damaged QR code, which should make the recovery process easier. A bit of contrast has been added for better visibility.

A tool is used to recover QR codes Qrazybox.

Thanks to redundant Reed-Solomon coding, which provides error protection, the recovery does not require perfect accuracy—some errors are acceptable. The size of the QR code is set as 29×29. The type of mask and the level of error correction are determined by the markers located around the upper left landmark.

We draw according to the sample as accurately as possible.

And we get a QR code that is decoded into a link https://postiimag.com/8Fygy3c9

For the sake of interest, the number of errors was checked – they turned out to be 10, which is quite a good result.

The search does not complete, because the link does not open due to a non-existent domain. Consulting search engines such as Google can help you find possible alternative domains or patches that will allow you to access the information you need.

The search engine offered several possible options. After checking different domains, postimg.cc was found to be suitable instead of postiimag.com. Thus, the link became: https://postimg.cc/8Fygy3c9. Another picture was found on the specified link, which causes real surprise.

We process images to make it easier to search.

A car modification service is registered under phone number 025-276-3395. His website: https://www.42tism.com/. Service address: 新潟県新潟市東区大形本町193 (193 Ogatahonmachi, Higashi-ku, Niigata City, Niigata Prefecture).

The Yumehouse company specializes in the construction of wooden houses. Her website: https://www.yume-h.com/. The official resource states:
“Natural materials, massive wooden houses all over the country! Over 400 participating stores!”

The blue ad contains a link to the original document: https://www.jcp.or.jp/web_download/2202_kurashi.pdf.

This poster is the 2022 election campaign from the Communist Party of Japan, promising a strong yet stable economy.

Another poster shows Kazuo Shii, the head of the same party who ran in the 2021 elections. Details can be found at the link: https://www.jcp.or.jp/akahata/aik21/2021-08-31/2021083101_04_0.html.

It can be assumed that these posters are collected in one place not by chance. Presumably, they are located close to each other, perhaps even close to the desired object. This hypothesis was later confirmed by @blacktiesz, who pointed out that all the QR code elements are in the same city.

Of all the posters, only the car repair shop located in the city of Niigata has a precise geographical reference. However, its advertising may also be present in neighboring cities of Niigata Prefecture. Yumehouse advertising is more like a sign of a separate sales department. Its analysis will help to narrow down the search area, if applied to the map.

Therefore, there are numerous landmarks in the area. The next step is to use Overpass for analysis. First of all, you need to check the three-story houses in Niigata city. For this, a corresponding request is made.

area["name:en"="Niigata"][admin_level=7]->.a;
nwr[building]["building:levels"=3](area.a);
out geom;

We understand that there are very few houses in such a city.

These objects are marked extremely rarely, so their further use for analysis does not make sense. The next step will be to search for educational institutions, because the pedestrian crossing is in the immediate vicinity of one of them.

area["name:en"="Niigata"][admin_level=7]->.a;
nwr[amenity~"(school|kindergarten|college|university)$"](area.a);
out geom;

So better, the schools are well marked.

It remains to check pedestrian crossings.

area["name:en"="Niigata"][admin_level=7]->.a;
nwr[highway=crossing](area.a);
out geom;

There are certainly not many of them, but there is currently no other way for further analysis. Next, the method of searching for T-intersections is presented.

// шукаємо тільки дороги для машин
way[highway~"(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|service)$
"]->.ways;

// перебираємо по одній
foreach.ways->.this_way {
 // цей оператор дозволяє витягти тільки кінцеві вузли колії
 (
   node(w.this_way:1,1);
   node(w.this_way:1,-1);
 )->.this_ways_ends;

 // Знаходимо всі дороги для машин, які містять ці точки
 way(bn.this_ways_ends)[highway~"(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|service)$
"]->.linked_ways;

 // Віднімаємо поточний шлях із циклу
 (
   way.linked_ways;
   -
   way.this_way;
 )->.linked_ways_only;

 // Отримуємо вузли цих шляхів
 node(w.linked_ways_only)->.linked_ways_only_nodes;

 // Знаходимо перетин кінцевих вузлів поточного шляху та вузлів інших шляхів
 node.linked_ways_only_nodes.this_ways_ends;
 out;
}

In short, the method allows you to find road intersections, where one road ends, abutting another, forming a T-intersection.

It should be taken into account that the road can consist of several segments (ways), due to which false positives are possible. Conditions are added to the code: intersections must be located near schools, have unregulated pedestrian crossings. Motorway, trunk, primary, secondary, tertiary tags for the adjacent road are also excluded, as it is unlikely to belong to these categories.

area["name:en"="Niigata"][admin_level=7]->.a;
nwr[amenity~"(school|kindergarten|college|university)$"](area.a)->.schools;
way[highway~"(unclassified|residential|living_street|service)$"](around.schools:300)->.ways;
nwr[highway=crossing][crossing!=traffic_signals](around.schools:300)->.crossings;

foreach.ways->.this_way{
 (
   node(w.this_way:1,1);
   node(w.this_way:1,-1);
 )->.this_ways_ends;
 way(bn.this_ways_ends)[highway~"(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|service)$
"]->.linked_ways;
 (
   way.linked_ways;
   -
   way.this_way;
 )->.linked_ways_only;

 node(w.linked_ways_only)->.linked_ways_only_nodes;

 node.linked_ways_only_nodes.this_ways_ends(around.crossings:20);
 out;
}

As a result, it turns out like this: it is quite possible to bypass all the points. Looking through them, you can find houses with similar tiles and similar construction.

We put them on the map, maybe they are in the same area.

As a result, the desired house could not be found, and similar buildings were scattered throughout the city of Niigata. Perhaps they were built by the same developer, but no information about this could be found.

We continue

It was determined that the house is located in Niigata city or nearby prefecture cities. There are quite a lot of similar buildings in the city, and they are scattered in different districts. At the same time, information about the number of floors of buildings is not specified in OpenStreetMap. Low-rise buildings in Niigata are mostly two stories and belong to the private sector, while three-story apartment buildings are rare.

Almost every such house has not only an address, but also a name. By searching for this name, you can find real estate aggregator sites for rent and sale. However, the search on such resources is less universal than, for example, on TsIAN. Real estate, so it will not work to filter houses by the number of floors. To do this, you need to download data from these sites and process them yourself.

These resources include:

  • mansion-review.jp

  • suumo.jp

  • homes.co.jp

  • athome.co.jp

  • lifullhomes-index.jp

They probably have a common base, but the data does not always match. During the analysis, data was downloaded from mansion-review.jp, homes.co.jp and lifullhomes-index.jp. However, the first two could not find the right house, so the focus was on the last one.

For convenience, it was decided to download information for the entire Niigata prefecture. The page https://lifullhomes-index.jp/building-list/niigata-pref/ states that the site has data on 32,794 houses. There is an option to limit the sample to only houses with apartments for rent, but this filter was not used because a complete database was required.

The following information is available on the home page:

But if you look into the code, you can find the geolocation:

{
   "@context": "https://schema.org",
   "@type": [
       "Residence",
       "apartment"
   ],
   "image": "https://archive-image.lifullhomes-index.jp/v2/original/139342/24fa15dff6dc1ff208d8e42621b63189.jpg",
   "url": "https://lifullhomes-index.jp/buildings/b-7500240/",
   "name": "ライオンズマンション長岡",
   "description": [
       "長岡市の標準的な物件の価格は直近の3年間で3.10%程度上昇しています。",
       "これは長岡市のある新潟県の変動の1.01%に比べてやや高めの水準です。",
       "この3年間の価格上昇率を内訳でみると、初年度が-0.87%、2年目が1.88%、3年目が2.09%となっています。",
       "長岡市の標準的な物件の賃料は直近の3年間で4.19%程度上昇しています。",
       "これは長岡市のある新潟県の変動の3.82%に比べて同程度の水準です。",
       "この3年間の価格上昇率を内訳でみると、初年度が4.50%、2年目が0.59%、3年目が-0.90%となっています。"
   ],
   "address": {
       "@type": "PostalAddress",
       "name": "新潟県長岡市南町1丁目5-17",
       "streetAddress": "1丁目5-17",
       "addressLocality": "長岡市",
       "addressRegion": "新潟県",
       "postalCode": "940-0081",
       "addressCountry": "JP"
   },
   "geo": {
       "@type": "GeoCoordinates",
       "latitude": 37.4413033,
       "longitude": 138.8509603
   }
}

And other information in convenient json format:

{
   "login_status": "guest",
   "tealium_event": "web_buildings_view",
   "page_type": "building_public",
   "service_type": "sumaiindex",
   "prefecture_id": [
       "15"
   ],
   "city_id": [
       "15202"
   ],
   "house_age": [
       33
   ],
   "station_id": [
       "00060",
       "00060"
   ],
   "house_area": [
       73.71,
       73.71
   ],
   "item_id": [
       "7500240"
   ],
   "item_type": [
       "building"
   ],
   "item_name": [
       "ライオンズマンション長岡"
   ],
   "realestate_type_id": [
       "Condominium"
   ],
   "town_id": [
       "14CED04F12"
   ],
   "house_walk_minute": [
       10,
       10
   ],
   "floor_count": 14,
   "unit_count": 42,
   "contractor": "小柳建設株式会社",
   "year_built": 199107,
   "land_youto": 6
}

So, a simple code is created that forms a convenient table for analysis. It is presented as-is for those who may be interested. To access the materials, a password is used — the MD5 hash of the introduction to this section.

Files:

The result is a structured table with all the necessary information.

Checking the data downloaded from other sites, it was noticed that similar houses started to be built from around 2002 and they are made of reinforced concrete. Therefore, it is advisable to set the filter only on reinforced concrete buildings within Niigata City since 1999 for greater accuracy.

We get a small table of 259 houses:

Most houses have links to images. To avoid viewing points manually, all photos are loaded. In cases where there are no images, you will have to view the locations yourself. For this, a simple parallel download script is created. Although there are many ready-made solutions, it was decided to create our own version.

Script file: dl_parallel.py, available under the same conditions. After that, you can start looking for the right house.

The picture of the house is not taken from the best angle. However, after viewing hundreds of similar buildings, the white object immediately catches the eye (remembering the same unknown white element). The two rows of balconies are also a prominent feature that cannot be ignored.

All that remains is to go to Street View to specify the exact coordinates of the shooting location.

  • 37.913431, 139.095253

Now you have to wonder why Overpass couldn’t find the object it wanted. When checking in OpenStreetMap, it turned out that there is no pedestrian crossing marked at the given intersection, but only two roads.

If we remove the restriction on the presence of a pedestrian crossing from the request, it becomes clear that the desired intersection is a little more than 300 meters away, and the number of corresponding points increases significantly.

So, contrary to popular belief, Overpass does not perform miracles. It is only a useful tool, the possibilities of which are limited, and it does not always give the desired result.

Other related articles
Found an error?
If you find an error, take a screenshot and send it to the bot.