<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jiang Wang</title>
    <description>The latest articles on DEV Community by jiang Wang (@sinostay).</description>
    <link>https://dev.to/sinostay</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4225614%2F81d88d67-5c70-4ddd-aac8-d8a063c91f84.png</url>
      <title>DEV Community: jiang Wang</title>
      <link>https://dev.to/sinostay</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sinostay"/>
    <language>en</language>
    <item>
      <title>Booking a Chinese train ticket is easy. Finding your train is not.</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Mon, 16 Nov 2026 09:05:45 +0000</pubDate>
      <link>https://dev.to/sinostay/booking-a-chinese-train-ticket-is-easy-finding-your-train-is-not-44ne</link>
      <guid>https://dev.to/sinostay/booking-a-chinese-train-ticket-is-easy-finding-your-train-is-not-44ne</guid>
      <description>&lt;p&gt;There are three or four ways to buy a China rail ticket as a foreigner, and every guide covers them competently. Trip.com takes foreign cards and adds a fee. The official 12306 app now has an English interface and takes foreign passports. A hostel front desk will do it for you.&lt;/p&gt;

&lt;p&gt;None of that is where people get stuck.&lt;/p&gt;

&lt;p&gt;People get stuck at the station, holding a valid ticket for a train that leaves from a building they are not standing in.&lt;/p&gt;

&lt;h2&gt;
  
  
  The station is not one station
&lt;/h2&gt;

&lt;p&gt;Beijing has Beijing, Beijing South, Beijing West, Beijing North, Beijing Chaoyang and Beijing Fengtai. Shanghai has Shanghai, Shanghai Hongqiao and Shanghai South. Xi'an and Xi'an North sit on opposite sides of the same city.&lt;/p&gt;

&lt;p&gt;The English names differ by a single word. The Chinese names differ by a single character, and the character is the part that tells a driver where to go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;北京站    Beijing Railway Station
北京南站  Beijing South
北京西站  Beijing West
北京朝阳站 Beijing Chaoyang
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your ticket says one of these. The app says one of these. If you have been telling people "Beijing station", you have been giving them a category, not a destination.&lt;/p&gt;

&lt;p&gt;Two things follow. First, check which station on the booking screen — not on the day. Second, have the Chinese name, not the English one, because that is what appears on signs, on tickets and in the driver's navigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The passport is the ticket, until it isn't
&lt;/h2&gt;

&lt;p&gt;Since the switch to e-tickets, your passport is your ticket at the gate: you scan it, the gate opens. That works at most large stations.&lt;/p&gt;

&lt;p&gt;The exceptions are the ones that catch people out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Some smaller stations and some legacy counters&lt;/strong&gt; still want a paper ticket, collected in person with the passport used to book.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A name mismatch between booking and passport&lt;/strong&gt; stops you at the gate, and fixing it means a counter queue, not an app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The gate closes before the train does.&lt;/strong&gt; Boarding typically cuts off a few minutes before departure; security and the walk to the platform at a big station can take fifteen minutes on their own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The generic advice — arrive 40 minutes early — is right, and it is right for exactly this reason: the queue you did not expect is the ticket counter, not security.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the platform actually looks like
&lt;/h2&gt;

&lt;p&gt;Worth knowing before you are standing in it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security first, then the waiting hall, then the gate.&lt;/strong&gt; You cannot go straight to the platform. Bags through an X-ray, then you find your waiting area by train number on the departure board.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seat classes are named, not lettered.&lt;/strong&gt; 二等座 second class, 一等座 first, 商务座 business. Second class is fine and is what most people book; the difference on a 4-hour run is legroom, not speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your carriage number is on the ticket&lt;/strong&gt; and the platform is marked in carriages, not just positions. Stand at your carriage marker; the train stops for two minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that is genuinely ours to say
&lt;/h2&gt;

&lt;p&gt;We keep the Chinese name of all 1,269 railway stations in the dataset, next to the English one, because the mismatch between them is the single most common way a journey starts badly — you booked correctly, you arrived correctly, and the driver took you to the wrong building.&lt;/p&gt;

&lt;p&gt;The same problem has a second half: getting from the station to where you are sleeping. That is what the taxi card is for — type the hotel, get the destination in large characters plus a QR that opens the exact spot. Free, no account: &lt;a href="https://sinostay.com/tools/taxi-card/" rel="noopener noreferrer"&gt;sinostay.com/tools/taxi-card&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Station names and city-by-city rail notes live here: &lt;a href="https://sinostay.com/traffic/railways/" rel="noopener noreferrer"&gt;sinostay.com/traffic/railways&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;p&gt;Book on Trip.com or 12306, both work with a foreign passport. Then do the thing the confirmation email does not do for you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write down &lt;strong&gt;which&lt;/strong&gt; station, in characters.&lt;/li&gt;
&lt;li&gt;Check whether your station still needs a paper ticket.&lt;/li&gt;
&lt;li&gt;Give yourself 40 minutes, because the counter queue is real.&lt;/li&gt;
&lt;li&gt;Have the destination address ready in Chinese for the other end.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of this sits on &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;, alongside the hotel and payment details that took longer to work out than they should have.&lt;/p&gt;

</description>
      <category>travel</category>
      <category>writing</category>
    </item>
    <item>
      <title>Beijing gets half of Xiamen's rain, and one month of it can ruin your trip</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Mon, 16 Nov 2026 09:05:12 +0000</pubDate>
      <link>https://dev.to/sinostay/beijing-gets-half-of-xiamens-rain-and-one-month-of-it-can-ruin-your-trip-535b</link>
      <guid>https://dev.to/sinostay/beijing-gets-half-of-xiamens-rain-and-one-month-of-it-can-ruin-your-trip-535b</guid>
      <description>&lt;p&gt;Annual rainfall is the wrong number for planning a trip. I pulled five years of monthly precipitation for 311 Chinese cities and asked a different question: how much of the year falls in the two wettest months?&lt;/p&gt;

&lt;p&gt;The answer inverts the obvious ranking.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Beijing: 796 mm per year. Xiamen, on the Fujian coast: 1,572 mm — almost exactly double.&lt;/p&gt;

&lt;p&gt;By annual total, Beijing looks safe and Xiamen looks risky. But Beijing takes &lt;strong&gt;35% of its entire annual rain in July alone&lt;/strong&gt; (280 mm), and 62% across July and August. Xiamen's wettest month is 242 mm, and its two wettest months are only 29% of its year.&lt;/p&gt;

&lt;p&gt;One city has a rainy season you can avoid. The other has rain as a standing condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured it
&lt;/h2&gt;

&lt;p&gt;Data: Open-Meteo monthly precipitation, 2021–2025, aggregated per city. Filter: cities with at least 500 mm of annual rain — 311 survived.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- per city: share of annual rain in the two wettest months&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rain_mm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rain_mm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;rain_mm&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;city_climate&lt;/span&gt; &lt;span class="n"&gt;c2&lt;/span&gt;
          &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;c2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt;
          &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;rain_mm&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
       &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;top2&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;city_climate&lt;/span&gt; &lt;span class="n"&gt;c1&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt;
&lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then &lt;code&gt;top2 / year&lt;/code&gt; ranks the cities by concentration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What came out
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;City&lt;/th&gt;
&lt;th&gt;Rain / year&lt;/th&gt;
&lt;th&gt;Wettest month&lt;/th&gt;
&lt;th&gt;Share of year&lt;/th&gt;
&lt;th&gt;Two wettest months&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Baoding&lt;/td&gt;
&lt;td&gt;863 mm&lt;/td&gt;
&lt;td&gt;309 mm (Jul)&lt;/td&gt;
&lt;td&gt;36%&lt;/td&gt;
&lt;td&gt;64%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Langfang&lt;/td&gt;
&lt;td&gt;868 mm&lt;/td&gt;
&lt;td&gt;308 mm (Jul)&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;63%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Beijing&lt;/td&gt;
&lt;td&gt;796 mm&lt;/td&gt;
&lt;td&gt;280 mm (Jul)&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;62%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tangshan&lt;/td&gt;
&lt;td&gt;895 mm&lt;/td&gt;
&lt;td&gt;273 mm (Jul)&lt;/td&gt;
&lt;td&gt;31%&lt;/td&gt;
&lt;td&gt;60%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Xiamen&lt;/td&gt;
&lt;td&gt;1,572 mm&lt;/td&gt;
&lt;td&gt;242 mm (Jun)&lt;/td&gt;
&lt;td&gt;15%&lt;/td&gt;
&lt;td&gt;29%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guangzhou&lt;/td&gt;
&lt;td&gt;1,955 mm&lt;/td&gt;
&lt;td&gt;403 mm (May)&lt;/td&gt;
&lt;td&gt;21%&lt;/td&gt;
&lt;td&gt;38%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Five of 311 cities put more than 60% of their annual rain into two months. Eighteen clear 55%. Seventy-five stay under 35%.&lt;/p&gt;

&lt;p&gt;The top five are all on the north China plain, and all concentrate into July–August. The evenly-rained cities are all southern coastal.&lt;/p&gt;

&lt;h2&gt;
  
  
  The month count that actually predicts your trip
&lt;/h2&gt;

&lt;p&gt;Count months where rainfall passes 100 mm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Beijing: &lt;strong&gt;2&lt;/strong&gt; (July, August). Outside those, the city is genuinely dry.&lt;/li&gt;
&lt;li&gt;Shanghai: 6&lt;/li&gt;
&lt;li&gt;Xiamen: 7&lt;/li&gt;
&lt;li&gt;Guangzhou: 7&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are booking a two-week trip, a city with 7 wet months gives you a reasonable chance of dry weather in almost any month you pick. A city with 2 wet months gives you a binary choice: book July–August and get wet, or book anything else and get dry.&lt;/p&gt;

&lt;p&gt;That is actionable. "1,572 mm per year" is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed as a result
&lt;/h2&gt;

&lt;p&gt;For the north China plain — Beijing, Tianjin, Hebei — I now treat July and August as a closed season for anything outdoors. Not because the city is wet, but because the fourteen days you would book are drawn from the 62%.&lt;/p&gt;

&lt;p&gt;For the south, the rain is not a reason to avoid a month. It is a reason to plan around afternoons: Guangzhou and Xiamen rain hard and briefly, then clear.&lt;/p&gt;

&lt;p&gt;The month-by-month table for all 359 cities is free to browse at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt; — the same dataset behind the &lt;a href="https://sinostay.com/when-to-go/" rel="noopener noreferrer"&gt;when-to-go scoring&lt;/a&gt; and the &lt;a href="https://sinostay.com/hotel/" rel="noopener noreferrer"&gt;hotel index&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;When you aggregate climate (or any real-world series) into a single annual number, you throw away the only thing a traveller can act on: variance. A mean is a summary, and summaries are where products go to die. Publish the distribution, or publish the concentration — but publishing the total is close to publishing nothing.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>data</category>
      <category>datascience</category>
      <category>travel</category>
    </item>
    <item>
      <title>A name is not an identifier: what 1,269 Chinese railway stations taught me about labelling</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Mon, 16 Nov 2026 09:04:29 +0000</pubDate>
      <link>https://dev.to/sinostay/a-name-is-not-an-identifier-what-1269-chinese-railway-stations-taught-me-about-labelling-2ocm</link>
      <guid>https://dev.to/sinostay/a-name-is-not-an-identifier-what-1269-chinese-railway-stations-taught-me-about-labelling-2ocm</guid>
      <description>&lt;p&gt;I spent a week loading Chinese railway stations into a database, and the interesting part turned out to be a modelling problem rather than a scraping one.&lt;/p&gt;

&lt;p&gt;The symptom, in one sentence: the label a user sees and the key you store are different things, and in this dataset they diverge in a way that ruins an afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  The set
&lt;/h2&gt;

&lt;p&gt;1,269 published railway stations across 340 cities. 262 airports across 212 cities. Every row carries a Chinese name, an English name, a city, coordinates.&lt;/p&gt;

&lt;p&gt;The distribution is not what I expected. Beijing leads with 50 stations. Harbin has 40. Chengde — a small city most people only pass through on the way to the Qing tombs — has 26. Then Chengdu 30, Guiyang 24, Hulunbuir 21. 205 of the 340 cities have more than one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 1: the Chinese name is unique, the English name is not useful
&lt;/h2&gt;

&lt;p&gt;The first query I ran was a duplicate check, expecting a mess:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="cm"&gt;(*) AS n
FROM railways
GROUP BY name
HAVING COUNT(*)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero rows. All 1,269 published station names are distinct across the entire country. That is a stronger guarantee than most geographic datasets offer — usually you find at least a handful of collisions, and you need an administrative prefix to disambiguate.&lt;/p&gt;

&lt;p&gt;So the Chinese string is a legitimate natural key. Good.&lt;/p&gt;

&lt;p&gt;But the English name fails for a different reason. It is not duplicated — it is &lt;em&gt;unactionable&lt;/em&gt;. Consider 北京南站. The romanisation is &lt;code&gt;Beijingnan&lt;/code&gt;. That is what appears on the ticket, on the departure board, and in every app. What a person says at a taxi rank is "Beijing South". What the driver reads is neither: the driver reads 北京南站 off a sign, or nothing at all.&lt;/p&gt;

&lt;p&gt;You end up with three representations of one station, and only one of them can be compared against a physical sign in the street. The English one, which is what a foreign visitor instinctively reaches for, is the least useful of the three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 2: a third of the set is a compass direction
&lt;/h2&gt;

&lt;p&gt;Counting the suffix patterns:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Suffix&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;南 (south)&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;北 (north)&lt;/td&gt;
&lt;td&gt;123&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;东 (east)&lt;/td&gt;
&lt;td&gt;103&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;西 (west)&lt;/td&gt;
&lt;td&gt;102&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;452 of 1,269 — 35.6% — are a city name plus a compass point. The remaining two-thirds are district names, town names, or standalone names that happen to be a station. And 301 stations are exactly the bare &lt;code&gt;city + 站&lt;/code&gt; form, which is the historical central terminus: 北京站, 天津站, 广州站.&lt;/p&gt;

&lt;p&gt;That last figure is the trap. If a city has a bare-name station &lt;em&gt;and&lt;/em&gt; compass variants, the bare name is the one a visitor will guess, and it is frequently not the one their train departs from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 3: 36 cities have more than one airport
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="cm"&gt;(*) FROM (
  SELECT city_slug FROM airports GROUP BY city_slug HAVING COUNT(*)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- 36&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shanghai's two airports are 45 km apart. Chengdu's are on opposite sides of the metro area. The failure mode is identical to the station one, and it is worse because the English names (Pudong, Hongqiao) look like proper nouns rather than positions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed in the schema
&lt;/h2&gt;

&lt;p&gt;Three decisions, all boring, all consequential:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Chinese string is the display value and the natural key.&lt;/strong&gt; It is the only representation that survives contact with a taxi rank.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The English name is retained for full-text search only.&lt;/strong&gt; It never appears as the sole label anywhere in the UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coordinates are mandatory, not optional.&lt;/strong&gt; A station page without a map pin is a page that cannot resolve the ambiguity it exists to resolve.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That third rule removed 0 rows, because the upstream source had coordinates for everything — but writing it down as a constraint is what stopped me from ever building a station page without one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;If your dataset's user-facing label is also your join key, you will at some point join two different things that read the same. Here the Chinese name happens to be both unique and unambiguous, which is lucky. The English name is unique too, and still manages to be the wrong thing to show someone standing at a kerb.&lt;/p&gt;

&lt;p&gt;Uniqueness and usefulness are separate properties. Only one of them is visible in a &lt;code&gt;GROUP BY&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The dataset and the per-station pages are browsable at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt; — the station list itself is at &lt;a href="https://sinostay.com/traffic/railways/" rel="noopener noreferrer"&gt;/traffic/railways/&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>data</category>
      <category>database</category>
    </item>
    <item>
      <title>359 cities, four without enough hotels — and why the threshold matters more than the gap</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Mon, 16 Nov 2026 09:04:28 +0000</pubDate>
      <link>https://dev.to/sinostay/359-cities-four-without-enough-hotels-and-why-the-threshold-matters-more-than-the-gap-1n73</link>
      <guid>https://dev.to/sinostay/359-cities-four-without-enough-hotels-and-why-the-threshold-matters-more-than-the-gap-1n73</guid>
      <description>&lt;p&gt;Last month we published a breakdown of every hotel in China that will actually let a foreigner check in. The number our readers kept quoting was not the total. It was the hole in it.&lt;/p&gt;

&lt;p&gt;Of the 359 cities in our database, 355 have at least eight hotels we would put in front of a stranger. Four do not: Alashankou, Beitun, Kunyu and Sansha.&lt;/p&gt;

&lt;p&gt;That reads like a data quality problem. It is not. It is a design decision that happens to produce a visible number, and the interesting part is the decision, not the four cities.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we actually measured
&lt;/h2&gt;

&lt;p&gt;For every property we track three things: whether the listing states it accepts foreign passports, whether it has a verified street address in Chinese, and whether there is a public review history behind it. A hotel with no Chinese address is not usable by the person we are writing for — a traveller standing at a front desk with a phone.&lt;/p&gt;

&lt;p&gt;So "eight hotels" does not mean eight rows. It means eight entries that survive all three filters. That is why the count per city is lower than any booking site will tell you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the four sit
&lt;/h2&gt;

&lt;p&gt;Alashankou and Beitun are border towns on the Kazakhstan and Mongolia crossings. They are transport stops, not destinations. Kunyu is the old name for a county seat in Xinjiang. Sansha is an administrative district of about 20,000 people served by a single road.&lt;/p&gt;

&lt;p&gt;None of them is missing from our data. Each has hotels. What they lack is a supply of places a foreign traveller would plausibly book — which is a different and more honest statement than "we have no data here".&lt;/p&gt;

&lt;h2&gt;
  
  
  Why eight is the floor
&lt;/h2&gt;

&lt;p&gt;This is the part worth arguing about.&lt;/p&gt;

&lt;p&gt;Below eight properties, a city page stops answering a question and starts being a list. With three options you cannot choose on district, on price, or on whether the desk will take your passport — you take whatever exists. The page becomes a dead end that looks complete.&lt;/p&gt;

&lt;p&gt;So we made a rule: cities under the floor get the nearest larger city instead of an empty page. The traveller lands somewhere useful rather than somewhere technically correct.&lt;/p&gt;

&lt;p&gt;The alternative — publish all 359 and let four of them be three-hotel pages — would have made our coverage look better and made the product worse. This is the trade every directory-style product has to make, and it is almost always made in the direction of the bigger number.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other 355
&lt;/h2&gt;

&lt;p&gt;Those are the ones worth planning around. Shanghai, Beijing and Guangzhou each carry hundreds of properties with verified addresses. The long tail is smaller cities where a handful of well-chosen hotels is still enough to decide where to base yourself for three nights.&lt;/p&gt;

&lt;p&gt;You can browse the &lt;a href="https://sinostay.com/hotel/" rel="noopener noreferrer"&gt;full list of 359 cities and their hotel counts&lt;/a&gt;, or start from a city and see the map, the Chinese name card and the taxi instructions for each property. Everything else we track — month-by-month climate, which cities are comfortable right now, the taxi cards — lives at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;If you are building anything that aggregates messy real-world data, the threshold is the product. A count that includes everything is easy to produce and useless to act on. A count that excludes things forces you to write down what "usable" means — and once you have written it down, the number that comes out is defensible even when it is smaller than the one your competitor is advertising.&lt;/p&gt;

&lt;p&gt;We publish the rule alongside the number for exactly that reason. When the rule changes, the number will change, and you will be able to see why.&lt;/p&gt;

</description>
      <category>data</category>
      <category>travel</category>
    </item>
    <item>
      <title>Booking a Chinese train ticket is easy. Finding your train is not.</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Sun, 15 Nov 2026 01:07:51 +0000</pubDate>
      <link>https://dev.to/sinostay/booking-a-chinese-train-ticket-is-easy-finding-your-train-is-not-33g4</link>
      <guid>https://dev.to/sinostay/booking-a-chinese-train-ticket-is-easy-finding-your-train-is-not-33g4</guid>
      <description>&lt;h1&gt;
  
  
  Booking a Chinese train ticket is easy. Finding your train is not.
&lt;/h1&gt;

&lt;p&gt;There are three or four ways to buy a China rail ticket as a foreigner, and every guide covers them competently. Trip.com takes foreign cards and adds a fee. The official 12306 app now has an English interface and takes foreign passports. A hostel front desk will do it for you.&lt;/p&gt;

&lt;p&gt;None of that is where people get stuck.&lt;/p&gt;

&lt;p&gt;People get stuck at the station, holding a valid ticket for a train that leaves from a building they are not standing in.&lt;/p&gt;

&lt;h2&gt;
  
  
  The station is not one station
&lt;/h2&gt;

&lt;p&gt;Beijing has Beijing, Beijing South, Beijing West, Beijing North, Beijing Chaoyang and Beijing Fengtai. Shanghai has Shanghai, Shanghai Hongqiao and Shanghai South. Xi'an and Xi'an North sit on opposite sides of the same city.&lt;/p&gt;

&lt;p&gt;The English names differ by a single word. The Chinese names differ by a single character, and the character is the part that tells a driver where to go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;北京站    Beijing Railway Station
北京南站  Beijing South
北京西站  Beijing West
北京朝阳站 Beijing Chaoyang
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your ticket says one of these. The app says one of these. If you have been telling people "Beijing station", you have been giving them a category, not a destination.&lt;/p&gt;

&lt;p&gt;Two things follow. First, check which station on the booking screen — not on the day. Second, have the Chinese name, not the English one, because that is what appears on signs, on tickets and in the driver's navigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The passport is the ticket, until it isn't
&lt;/h2&gt;

&lt;p&gt;Since the switch to e-tickets, your passport is your ticket at the gate: you scan it, the gate opens. That works at most large stations.&lt;/p&gt;

&lt;p&gt;The exceptions are the ones that catch people out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Some smaller stations and some legacy counters&lt;/strong&gt; still want a paper ticket, collected in person with the passport used to book.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A name mismatch between booking and passport&lt;/strong&gt; stops you at the gate, and fixing it means a counter queue, not an app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The gate closes before the train does.&lt;/strong&gt; Boarding typically cuts off a few minutes before departure; security and the walk to the platform at a big station can take fifteen minutes on their own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The generic advice — arrive 40 minutes early — is right, and it is right for exactly this reason: the queue you did not expect is the ticket counter, not security.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the platform actually looks like
&lt;/h2&gt;

&lt;p&gt;Worth knowing before you are standing in it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security first, then the waiting hall, then the gate.&lt;/strong&gt; You cannot go straight to the platform. Bags through an X-ray, then you find your waiting area by train number on the departure board.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seat classes are named, not lettered.&lt;/strong&gt; 二等座 second class, 一等座 first, 商务座 business. Second class is fine and is what most people book; the difference on a 4-hour run is legroom, not speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your carriage number is on the ticket&lt;/strong&gt; and the platform is marked in carriages, not just positions. Stand at your carriage marker; the train stops for two minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that is genuinely ours to say
&lt;/h2&gt;

&lt;p&gt;We keep the Chinese name of all 1,269 railway stations in the dataset, next to the English one, because the mismatch between them is the single most common way a journey starts badly — you booked correctly, you arrived correctly, and the driver took you to the wrong building.&lt;/p&gt;

&lt;p&gt;The same problem has a second half: getting from the station to where you are sleeping. That is what the taxi card is for — type the hotel, get the destination in large characters plus a QR that opens the exact spot. Free, no account: &lt;a href="https://sinostay.com/tools/taxi-card/" rel="noopener noreferrer"&gt;sinostay.com/tools/taxi-card&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Station names and city-by-city rail notes live here: &lt;a href="https://sinostay.com/traffic/railways/" rel="noopener noreferrer"&gt;sinostay.com/traffic/railways&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;p&gt;Book on Trip.com or 12306, both work with a foreign passport. Then do the thing the confirmation email does not do for you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write down &lt;strong&gt;which&lt;/strong&gt; station, in characters.&lt;/li&gt;
&lt;li&gt;Check whether your station still needs a paper ticket.&lt;/li&gt;
&lt;li&gt;Give yourself 40 minutes, because the counter queue is real.&lt;/li&gt;
&lt;li&gt;Have the destination address ready in Chinese for the other end.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of this sits on &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;, alongside the hotel and payment details that took longer to work out than they should have.&lt;/p&gt;

</description>
      <category>travel</category>
    </item>
    <item>
      <title>The best taxi app in China is not the one you think</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Thu, 12 Nov 2026 02:16:31 +0000</pubDate>
      <link>https://dev.to/sinostay/the-best-taxi-app-in-china-is-not-the-one-you-think-27fn</link>
      <guid>https://dev.to/sinostay/the-best-taxi-app-in-china-is-not-the-one-you-think-27fn</guid>
      <description>&lt;h1&gt;
  
  
  The best taxi app in China is not the one you think
&lt;/h1&gt;

&lt;p&gt;Every guide to getting around China tells you to install DiDi. That advice is not wrong, and it is also not the thing that decides whether your trip goes smoothly.&lt;/p&gt;

&lt;p&gt;The app is the easy part. The hard part is the thirty seconds when the car arrives and neither of you can confirm you have found each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the three real options are
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DiDi.&lt;/strong&gt; Has an English interface and is what most visitors end up using. It links to an international card, though whether your particular card works depends on the region your account is registered in and on the card issuer, so try it before you are standing on a kerb at midnight. The in-app chat translates, which matters more than the map.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amap (高德).&lt;/strong&gt; The map app Chinese drivers themselves use. It has an English mode now, and ride-hailing lives inside it. The advantage: the driver is using the same map as the app that dispatched them, so the pickup point is not a translation of a pickup point — it is the same one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Alipay mini-program.&lt;/strong&gt; If you already have Alipay set up with a foreign card, ride-hailing is one of its mini-programs, and it avoids installing another app. Convenient; slightly more clicks; the same underlying dispatch networks.&lt;/p&gt;

&lt;p&gt;Any of the three will call a car. Which one you pick matters far less than the next part.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part nobody warns you about
&lt;/h2&gt;

&lt;p&gt;All three apps describe your destination with a &lt;em&gt;name&lt;/em&gt;. "Grand Millennium Hotel." "West Lake scenic area." "Tianfu Square."&lt;/p&gt;

&lt;p&gt;A driver does not navigate to a name. He navigates to an address, in characters, and often to a specific entrance of a building that has four of them. When the app pins a name and you cannot read the characters under it, you are asking him to solve a puzzle at 60 km/h.&lt;/p&gt;

&lt;p&gt;Three failure modes follow, in order of how often they happen:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The pin is right and the entrance is wrong.&lt;/strong&gt; Large hotels and stations have multiple vehicle entrances. The app drops you at one; your ticket is at another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The name is local, not official.&lt;/strong&gt; Small guesthouses and restaurants are known by a name that appears nowhere on the building.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The driver calls.&lt;/strong&gt; He has one question — where exactly are you — and you cannot answer it in his language.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What actually fixes it
&lt;/h2&gt;

&lt;p&gt;A card. Paper, or a screenshot, that shows the destination in large Chinese characters, with the pinyin underneath in case he reads it aloud to a colleague, and a QR code that opens the exact spot in Amap.&lt;/p&gt;

&lt;p&gt;I built one because I got tired of passing my phone through a car window on a motorway: &lt;a href="https://sinostay.com/tools/taxi-card/" rel="noopener noreferrer"&gt;sinostay.com/tools/taxi-card&lt;/a&gt;. Type a destination, print or save the card, hand it over. No account, nothing to install, works for a hotel you have not booked yet.&lt;/p&gt;

&lt;p&gt;Two more habits worth having:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Screenshot the Chinese name of your hotel from the booking confirmation&lt;/strong&gt; before you leave the room. Not the English name. The characters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For stations, add the exit or the square.&lt;/strong&gt; "Hangzhou East Railway Station" is a building the size of an airport; the difference between the north and south drop-off is twenty minutes on foot. All 1,269 stations in the dataset carry their Chinese name for exactly this reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;p&gt;Install DiDi or Amap, link a card, and test it once in a city you know before you rely on it. Then solve the real problem: make sure that when the car pulls up, the driver can read where you are going without asking you a question.&lt;/p&gt;

&lt;p&gt;Everything else — which app, which button, which promo code — is noise.&lt;/p&gt;

&lt;p&gt;All of this sits on &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;, alongside the hotel, payment and rail details that took me longer to work out than they should have.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Chinese address is not a string you can transliterate</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Wed, 11 Nov 2026 03:06:04 +0000</pubDate>
      <link>https://dev.to/sinostay/a-chinese-address-is-not-a-string-you-can-transliterate-5c1f</link>
      <guid>https://dev.to/sinostay/a-chinese-address-is-not-a-string-you-can-transliterate-5c1f</guid>
      <description>&lt;h1&gt;
  
  
  A Chinese address is not a string you can transliterate
&lt;/h1&gt;

&lt;p&gt;The first time a taxi driver handed my phone back to me, confused, I assumed the problem was my pronunciation. It was not. The problem was that I had given him a &lt;em&gt;name&lt;/em&gt;, and he needed a &lt;em&gt;location&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That distinction sounds obvious written down. It is not obvious at 11pm outside a train station, holding a booking that says "Near West Lake, Hangzhou".&lt;/p&gt;

&lt;h2&gt;
  
  
  Three ways it goes wrong
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The address exists in two scripts and only one is useful.&lt;/strong&gt; "No. 8 Baoshi Road" means nothing to a driver. 宝石路8号 means everything. The Latin version is a label for you, not an instruction for him.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The place has a name that is not an address.&lt;/strong&gt; Guesthouses, restaurants, small hotels — known locally by a name, and the name is not where they are. You cannot navigate to a name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Your phone is the only map, and you are handing it to a stranger.&lt;/strong&gt; Underestimated, this one. Passing a phone back and forth through a language barrier is slow, and on a motorway it is not safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I wanted and could not find
&lt;/h2&gt;

&lt;p&gt;A piece of paper. Something to hand over, that says the destination in large characters, has a map behind a QR code, and needs no English from the reader.&lt;/p&gt;

&lt;p&gt;Every "translate your address" tool produced a text block — fine for a form, useless for a windscreen. So I built the thing I wanted: type a destination, get a card.&lt;/p&gt;

&lt;h2&gt;
  
  
  The constraints that actually mattered
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Characters first.&lt;/strong&gt; The largest element is the Chinese address, sized to be read from the back seat. Pinyin underneath, because drivers sometimes read it aloud to a colleague.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A QR code, not a map image.&lt;/strong&gt; A static map is a picture of a route; a QR opens a live one in Amap, which is what drivers here use. It also survives being printed badly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No account, no server round trip on render.&lt;/strong&gt; You can generate a card for a hotel you have not booked, print it on hotel wifi, and it still works in the car.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The address has to be a real address.&lt;/strong&gt; This is the easy thing to get wrong: let people type anything, generate a confident-looking card with the wrong characters on it. The card is only as good as the address in it, so the source of the address matters more than the typography.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would tell anyone building for a country they do not read
&lt;/h2&gt;

&lt;p&gt;Check the output against someone who reads it natively, not against a translation API. A transliteration can be perfectly correct and still useless, because it is not the &lt;em&gt;form&lt;/em&gt; the reader expects.&lt;/p&gt;

&lt;p&gt;The generator is at &lt;a href="https://sinostay.com/tools/taxi-card/" rel="noopener noreferrer"&gt;sinostay.com/tools/taxi-card&lt;/a&gt; — free, no account. If you are heading to China with a hotel booked, generate one and put it in your wallet. A minute of work removes one of the two or three genuinely stressful moments of the trip.&lt;/p&gt;

&lt;p&gt;The address data behind it comes from an index I maintain: &lt;a href="https://sinostay.com/hotel/" rel="noopener noreferrer"&gt;9,720 hotels that state they accept foreign guests&lt;/a&gt;, each carrying its Chinese address, because that field turned out to be the one that matters.&lt;/p&gt;

&lt;p&gt;All of it lives on &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;, alongside the visa, payment and transport answers that took me longer to find than they should have.&lt;/p&gt;

</description>
      <category>travel</category>
    </item>
    <item>
      <title>I asked Google 2,560 times: clustering 10,102 search suggestions</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Tue, 10 Nov 2026 06:45:22 +0000</pubDate>
      <link>https://dev.to/sinostay/i-asked-google-2560-times-clustering-10102-search-suggestions-543d</link>
      <guid>https://dev.to/sinostay/i-asked-google-2560-times-clustering-10102-search-suggestions-543d</guid>
      <description>&lt;p&gt;I wanted to know what people actually type before a trip to China. Not what I assumed, and not what travel blogs cover — what goes into the box.&lt;/p&gt;

&lt;p&gt;Google does not sell that data cheaply. But it does hand out its autocomplete endpoint for free, and that endpoint returns the phrases real people typed, ordered by how often they type them.&lt;/p&gt;

&lt;p&gt;So I scraped my own question into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The harvest
&lt;/h2&gt;

&lt;p&gt;Three layers, about 2,560 requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# 1. seed phrases&lt;/span&gt;
&lt;span class="no"&gt;SEEDS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'china'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'china travel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'china visa'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'china hotel'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'china sim card'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# 2. question prefixes — this is where intent lives&lt;/span&gt;
&lt;span class="no"&gt;PREFIXES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'how to'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'how much'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'can i'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'do i need'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'best'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'cheapest'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# 3. alphabet soup on the shortest results&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;top_50_shortest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s1"&gt;'abcdefghijklmnopqrstuvwxyz0123456789'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;suggest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;'https://suggestqueries.google.com/complete/search?client=firefox&amp;amp;hl=en&amp;amp;gl=us&amp;amp;q={quote(q)}'&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result: &lt;strong&gt;10,102 phrases&lt;/strong&gt;, zero API failures, nine minutes on five workers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three kinds of garbage
&lt;/h2&gt;

&lt;p&gt;Autocomplete is a firehose of homonyms. All three of these cost me a pass:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Brand collisions.&lt;/strong&gt; &lt;code&gt;china one&lt;/code&gt; returns the US restaurant chain &lt;em&gt;China One&lt;/em&gt; — cities, addresses, opening hours. Also &lt;code&gt;china wok&lt;/code&gt;, &lt;code&gt;china buffet&lt;/code&gt;, &lt;code&gt;china garden&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Echo.&lt;/strong&gt; Feed &lt;code&gt;how to china&lt;/code&gt; and the endpoint obligingly returns &lt;code&gt;how to china visa&lt;/code&gt; — a phrase nobody says, generated by my own malformed seed. Real users write &lt;code&gt;how to get a china visa&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Substring hits.&lt;/strong&gt; The worst one, because it silently corrupts your grouping. I filtered travel relevance with &lt;code&gt;rain&lt;/code&gt;, and &lt;code&gt;china approves brain implant&lt;/code&gt; sailed through: &lt;strong&gt;b&lt;/strong&gt;&lt;code&gt;rain&lt;/code&gt;. Same trick with &lt;code&gt;hot&lt;/code&gt; inside &lt;code&gt;photo&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# wrong&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;'rain|hot|bus|eat'&lt;/span&gt;

&lt;span class="c1"&gt;# right&lt;/span&gt;
&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;'\brain\b|\bhot\b|\bbus\b|\beat\b'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Word boundaries. Always.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clustering: 6,938 → 5,394
&lt;/h2&gt;

&lt;p&gt;After filtering for travel relevance: 6,938 phrases. Now group them.&lt;/p&gt;

&lt;p&gt;The naive approach — exact string dedupe — gets you nowhere, because these are the same question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;china visa cost
china visa how much
how much is china visa
how much does china visa cost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So: tokenise, drop stopwords, and cluster by Jaccard similarity on the token sets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;toks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;frozenset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s2"&gt;"[a-z0-9']+"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                     &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;STOP&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;jaccard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# union-find over pairs above threshold&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;candidate_pairs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;jaccard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;toks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;toks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.7&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;uf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;union&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Candidate generation matters: comparing all 6,938² pairs is 48 million comparisons. An inverted index on the tokens (and skipping ultra-common tokens like &lt;code&gt;visa&lt;/code&gt; that would produce enormous posting lists) cuts it to about 950,000 pairs, which runs in under a second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output: 5,394 distinct questions.&lt;/strong&gt; Average 1.29 phrasings each.&lt;/p&gt;

&lt;h2&gt;
  
  
  The distribution is the finding
&lt;/h2&gt;

&lt;p&gt;The biggest single cluster was &lt;strong&gt;80 different phrasings of "what should I do with ten days in China"&lt;/strong&gt;. Second: 65 ways of asking whether you can visit without a visa. Third: 55 ways of asking what a high-speed train costs.&lt;/p&gt;

&lt;p&gt;Then by theme:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;transport   1,183 clusters
money         693
visas         590
planning      486
connectivity  380
timing        245
food          242
hotels        232
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What is missing is the interesting part. No cluster of meaningful size for "hidden gems", "photo spots", "local secrets". The demand is overwhelmingly logistics — how to get there, how to pay, whether the hotel will take a passport.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did with it
&lt;/h2&gt;

&lt;p&gt;I stopped writing pages from intuition and started writing them from clusters. Every page now carries the list of exact phrasings it targets, printed on the page:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What this entry answers&lt;/strong&gt;&lt;br&gt;
china hotel for foreigners · china hotel not for foreigners · how to book hotel in china for foreigners&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is not keyword stuffing — it answers the reader's actual question ("does this page cover my case?") and it makes the coverage measurable. 5,394 clusters, 2,235 answered: 41%.&lt;/p&gt;

&lt;p&gt;The rest is a to-do list that writes itself.&lt;/p&gt;




&lt;p&gt;The dataset and the pages are at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt; — the answers are at &lt;a href="https://sinostay.com/wiki/" rel="noopener noreferrer"&gt;the wiki&lt;/a&gt;. The scraper is a hundred lines of Python and one regex you will get wrong the first time.&lt;/p&gt;

</description>
      <category>data</category>
      <category>python</category>
      <category>search</category>
      <category>webscraping</category>
    </item>
    <item>
      <title>Beijing gets half of Xiamen's rain, and one month of it can ruin your trip</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Mon, 09 Nov 2026 03:20:18 +0000</pubDate>
      <link>https://dev.to/sinostay/beijing-gets-half-of-xiamens-rain-and-one-month-of-it-can-ruin-your-trip-3a9l</link>
      <guid>https://dev.to/sinostay/beijing-gets-half-of-xiamens-rain-and-one-month-of-it-can-ruin-your-trip-3a9l</guid>
      <description>&lt;p&gt;Annual rainfall is the wrong number for planning a trip. I pulled five years of monthly precipitation for 311 Chinese cities and asked a different question: how much of the year falls in the two wettest months?&lt;/p&gt;

&lt;p&gt;The answer inverts the obvious ranking.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Beijing: 796 mm per year. Xiamen, on the Fujian coast: 1,572 mm — almost exactly double.&lt;/p&gt;

&lt;p&gt;By annual total, Beijing looks safe and Xiamen looks risky. But Beijing takes &lt;strong&gt;35% of its entire annual rain in July alone&lt;/strong&gt; (280 mm), and 62% across July and August. Xiamen's wettest month is 242 mm, and its two wettest months are only 29% of its year.&lt;/p&gt;

&lt;p&gt;One city has a rainy season you can avoid. The other has rain as a standing condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured it
&lt;/h2&gt;

&lt;p&gt;Data: Open-Meteo monthly precipitation, 2021–2025, aggregated per city. Filter: cities with at least 500 mm of annual rain — 311 survived.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- per city: share of annual rain in the two wettest months&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rain_mm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rain_mm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;rain_mm&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;city_climate&lt;/span&gt; &lt;span class="n"&gt;c2&lt;/span&gt;
          &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;c2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt;
          &lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;rain_mm&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt; &lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
       &lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;top2&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;city_climate&lt;/span&gt; &lt;span class="n"&gt;c1&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt;
&lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="nb"&gt;year&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then &lt;code&gt;top2 / year&lt;/code&gt; ranks the cities by concentration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What came out
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;City&lt;/th&gt;
&lt;th&gt;Rain / year&lt;/th&gt;
&lt;th&gt;Wettest month&lt;/th&gt;
&lt;th&gt;Share of year&lt;/th&gt;
&lt;th&gt;Two wettest months&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Baoding&lt;/td&gt;
&lt;td&gt;863 mm&lt;/td&gt;
&lt;td&gt;309 mm (Jul)&lt;/td&gt;
&lt;td&gt;36%&lt;/td&gt;
&lt;td&gt;64%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Langfang&lt;/td&gt;
&lt;td&gt;868 mm&lt;/td&gt;
&lt;td&gt;308 mm (Jul)&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;63%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Beijing&lt;/td&gt;
&lt;td&gt;796 mm&lt;/td&gt;
&lt;td&gt;280 mm (Jul)&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;td&gt;62%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tangshan&lt;/td&gt;
&lt;td&gt;895 mm&lt;/td&gt;
&lt;td&gt;273 mm (Jul)&lt;/td&gt;
&lt;td&gt;31%&lt;/td&gt;
&lt;td&gt;60%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Xiamen&lt;/td&gt;
&lt;td&gt;1,572 mm&lt;/td&gt;
&lt;td&gt;242 mm (Jun)&lt;/td&gt;
&lt;td&gt;15%&lt;/td&gt;
&lt;td&gt;29%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guangzhou&lt;/td&gt;
&lt;td&gt;1,955 mm&lt;/td&gt;
&lt;td&gt;403 mm (May)&lt;/td&gt;
&lt;td&gt;21%&lt;/td&gt;
&lt;td&gt;38%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Five of 311 cities put more than 60% of their annual rain into two months. Eighteen clear 55%. Seventy-five stay under 35%.&lt;/p&gt;

&lt;p&gt;The top five are all on the north China plain, and all concentrate into July–August. The evenly-rained cities are all southern coastal.&lt;/p&gt;

&lt;h2&gt;
  
  
  The month count that actually predicts your trip
&lt;/h2&gt;

&lt;p&gt;Count months where rainfall passes 100 mm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Beijing: &lt;strong&gt;2&lt;/strong&gt; (July, August). Outside those, the city is genuinely dry.&lt;/li&gt;
&lt;li&gt;Shanghai: 6&lt;/li&gt;
&lt;li&gt;Xiamen: 7&lt;/li&gt;
&lt;li&gt;Guangzhou: 7&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are booking a two-week trip, a city with 7 wet months gives you a reasonable chance of dry weather in almost any month you pick. A city with 2 wet months gives you a binary choice: book July–August and get wet, or book anything else and get dry.&lt;/p&gt;

&lt;p&gt;That is actionable. "1,572 mm per year" is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed as a result
&lt;/h2&gt;

&lt;p&gt;For the north China plain — Beijing, Tianjin, Hebei — I now treat July and August as a closed season for anything outdoors. Not because the city is wet, but because the fourteen days you would book are drawn from the 62%.&lt;/p&gt;

&lt;p&gt;For the south, the rain is not a reason to avoid a month. It is a reason to plan around afternoons: Guangzhou and Xiamen rain hard and briefly, then clear.&lt;/p&gt;

&lt;p&gt;The month-by-month table for all 359 cities is free to browse at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt; — the same dataset behind the &lt;a href="https://sinostay.com/when-to-go/" rel="noopener noreferrer"&gt;when-to-go scoring&lt;/a&gt; and the &lt;a href="https://sinostay.com/hotel/" rel="noopener noreferrer"&gt;hotel index&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;When you aggregate climate (or any real-world series) into a single annual number, you throw away the only thing a traveller can act on: variance. A mean is a summary, and summaries are where products go to die. Publish the distribution, or publish the concentration — but publishing the total is close to publishing nothing.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>data</category>
      <category>travel</category>
    </item>
    <item>
      <title>Fifteen Chinese cities have more sights than beds — and that is a feature, not a gap</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Sun, 08 Nov 2026 01:51:54 +0000</pubDate>
      <link>https://dev.to/sinostay/fifteen-chinese-cities-have-more-sights-than-beds-and-that-is-a-feature-not-a-gap-2bm4</link>
      <guid>https://dev.to/sinostay/fifteen-chinese-cities-have-more-sights-than-beds-and-that-is-a-feature-not-a-gap-2bm4</guid>
      <description>&lt;p&gt;We run a small travel dataset: hotels in China that state they accept foreign guests, attractions with English names and opening hours, both matched by city. Every city page on the site has a floor of eight verified hotels. Below eight, the city gets the nearest larger city instead of a page.&lt;/p&gt;

&lt;p&gt;Eighteen cities sit exactly on that floor. Fifteen of them have at least six attractions.&lt;/p&gt;

&lt;p&gt;That number is the whole post. Here is what it means and how we got it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The query
&lt;/h2&gt;

&lt;p&gt;Two aggregates, one join:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;spots&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;hotels&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;attractions&lt;/span&gt;
      &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;COALESCE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'live'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'live'&lt;/span&gt;
      &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt; &lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;hotels&lt;/span&gt;
      &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;COALESCE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'live'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'live'&lt;/span&gt;
      &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;city_slug&lt;/span&gt; &lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;BETWEEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;
  &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;city_slug&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fifteen rows. Zhenjiang has nineteen attractions and eight hotels. Yichun, in Heilongjiang, has twenty and eight. Laibin has seventeen and eight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the hotel count is not a row count
&lt;/h2&gt;

&lt;p&gt;A hotel only counts if it states it takes foreign guests, has a verified street address in Chinese, and has a public review history. A city with thirty listings and five verified addresses counts as five. That filter is why the numbers are lower than any booking site will tell you, and it is also why the floor exists at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we did not lower the floor
&lt;/h2&gt;

&lt;p&gt;This is the design decision worth arguing about. Below eight properties, a city page stops answering a question and starts being a list. Three options means you cannot choose on district, on price, or on whether the desk will accept your passport — you take what exists.&lt;/p&gt;

&lt;p&gt;Publishing 359 pages instead of 355 would have made our coverage look better and the product worse. A count that includes everything is easy to produce and useless to act on.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do with the gap instead
&lt;/h2&gt;

&lt;p&gt;The honest output is "come for the day, sleep somewhere else". Zhenjiang is 40 minutes from Nanjing by high-speed rail. Yichun is a flight from Harbin, which is where the beds are. Laibin is an hour from Nanning.&lt;/p&gt;

&lt;p&gt;We surface that on the city page rather than pretending the city is covered. You can see the &lt;a href="https://sinostay.com/hotel/" rel="noopener noreferrer"&gt;city list sorted by verified hotel count&lt;/a&gt;, the &lt;a href="https://sinostay.com/attraction/" rel="noopener noreferrer"&gt;attraction index&lt;/a&gt;, and the rest of the working notes at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;If you aggregate messy real-world data, the threshold is the product. Write down what "usable" means, publish the rule next to the number, and accept that the resulting figure will sometimes be smaller than the one your competitor is advertising — and defensible in a way theirs is not.&lt;/p&gt;

</description>
      <category>data</category>
      <category>database</category>
      <category>sql</category>
      <category>travel</category>
    </item>
    <item>
      <title>359 cities, four without enough hotels — and why the threshold matters more than the gap</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:47:35 +0000</pubDate>
      <link>https://dev.to/sinostay/359-cities-four-without-enough-hotels-and-why-the-threshold-matters-more-than-the-gap-2k11</link>
      <guid>https://dev.to/sinostay/359-cities-four-without-enough-hotels-and-why-the-threshold-matters-more-than-the-gap-2k11</guid>
      <description>&lt;p&gt;Last month we published a breakdown of every hotel in China that will actually let a foreigner check in. The number our readers kept quoting was not the total. It was the hole in it.&lt;/p&gt;

&lt;p&gt;Of the 359 cities in our database, 355 have at least eight hotels we would put in front of a stranger. Four do not: Alashankou, Beitun, Kunyu and Sansha.&lt;/p&gt;

&lt;p&gt;That reads like a data quality problem. It is not. It is a design decision that happens to produce a visible number, and the interesting part is the decision, not the four cities.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we actually measured
&lt;/h2&gt;

&lt;p&gt;For every property we track three things: whether the listing states it accepts foreign passports, whether it has a verified street address in Chinese, and whether there is a public review history behind it. A hotel with no Chinese address is not usable by the person we are writing for — a traveller standing at a front desk with a phone.&lt;/p&gt;

&lt;p&gt;So "eight hotels" does not mean eight rows. It means eight entries that survive all three filters. That is why the count per city is lower than any booking site will tell you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the four sit
&lt;/h2&gt;

&lt;p&gt;Alashankou and Beitun are border towns on the Kazakhstan and Mongolia crossings. They are transport stops, not destinations. Kunyu is the old name for a county seat in Xinjiang. Sansha is an administrative district of about 20,000 people served by a single road.&lt;/p&gt;

&lt;p&gt;None of them is missing from our data. Each has hotels. What they lack is a supply of places a foreign traveller would plausibly book — which is a different and more honest statement than "we have no data here".&lt;/p&gt;

&lt;h2&gt;
  
  
  Why eight is the floor
&lt;/h2&gt;

&lt;p&gt;This is the part worth arguing about.&lt;/p&gt;

&lt;p&gt;Below eight properties, a city page stops answering a question and starts being a list. With three options you cannot choose on district, on price, or on whether the desk will take your passport — you take whatever exists. The page becomes a dead end that looks complete.&lt;/p&gt;

&lt;p&gt;So we made a rule: cities under the floor get the nearest larger city instead of an empty page. The traveller lands somewhere useful rather than somewhere technically correct.&lt;/p&gt;

&lt;p&gt;The alternative — publish all 359 and let four of them be three-hotel pages — would have made our coverage look better and made the product worse. This is the trade every directory-style product has to make, and it is almost always made in the direction of the bigger number.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other 355
&lt;/h2&gt;

&lt;p&gt;Those are the ones worth planning around. Shanghai, Beijing and Guangzhou each carry hundreds of properties with verified addresses. The long tail is smaller cities where a handful of well-chosen hotels is still enough to decide where to base yourself for three nights.&lt;/p&gt;

&lt;p&gt;You can browse the &lt;a href="https://sinostay.com/hotel/" rel="noopener noreferrer"&gt;full list of 359 cities and their hotel counts&lt;/a&gt;, or start from a city and see the map, the Chinese name card and the taxi instructions for each property. Everything else we track — month-by-month climate, which cities are comfortable right now, the taxi cards — lives at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The general lesson
&lt;/h2&gt;

&lt;p&gt;If you are building anything that aggregates messy real-world data, the threshold is the product. A count that includes everything is easy to produce and useless to act on. A count that excludes things forces you to write down what "usable" means — and once you have written it down, the number that comes out is defensible even when it is smaller than the one your competitor is advertising.&lt;/p&gt;

&lt;p&gt;We publish the rule alongside the number for exactly that reason. When the rule changes, the number will change, and you will be able to see why.&lt;/p&gt;

</description>
      <category>data</category>
      <category>travel</category>
    </item>
    <item>
      <title>A trip to China is 311 trips, not 44,473 — and four of the six line items are constants</title>
      <dc:creator>jiang Wang</dc:creator>
      <pubDate>Fri, 06 Nov 2026 02:20:17 +0000</pubDate>
      <link>https://dev.to/sinostay/a-trip-to-china-is-311-trips-not-44473-and-four-of-the-six-line-items-are-constants-121g</link>
      <guid>https://dev.to/sinostay/a-trip-to-china-is-311-trips-not-44473-and-four-of-the-six-line-items-are-constants-121g</guid>
      <description>&lt;p&gt;I expected the expensive part of building a travel-cost dataset to be the flights. It turned out to be the opposite: the flights were the only part that needed real modelling, because everything else collapsed into a constant.&lt;/p&gt;

&lt;h2&gt;
  
  
  The table
&lt;/h2&gt;

&lt;p&gt;44,473 priced routes. 88 origin countries. 311 Chinese destinations. Each row itemises six things — flights, accommodation, food, local transport, attractions, fixed costs (visa, insurance, eSIM, card fees) — and the six sum exactly to the stored total.&lt;/p&gt;

&lt;p&gt;The first thing I did after loading it was check whether that "exactly" was true:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;bad&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cost_routes&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;flight_low&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;hotel_low&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;food_low&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;local_low&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;acts_low&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fixed_low&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;total_low&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- 0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good. The totals are derived, not typed in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then the interesting query
&lt;/h2&gt;

&lt;p&gt;I picked Beijing, because it has 143 origin cities — the deepest slice in the set — and asked how many distinct values each line takes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;flight_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;flight_values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;hotel_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;hotel_values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;food_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;food_values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;local_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;local_values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;acts_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;acts_values&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cost_routes&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;dest_slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'beijing'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;routes 143 | flight 126 | hotel 1 | food 1 | local 1 | acts 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four of the six take &lt;strong&gt;one&lt;/strong&gt; value. Not a tight range — one integer, shared by a route starting in Seoul and a route starting in Buenos Aires.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Distinct values across 143 origins&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Accommodation, 9 nights&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;$540&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Food and drink, 10 days&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;$430&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local transport&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;$120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attractions and activities&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;$300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fixed costs&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;$63–$203&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flights&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;126&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$183–$1,117&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That is not a coincidence of Beijing. Run the same count grouped by destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;destinations&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;hv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;fv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;lv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;av&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;all_constant&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;dest_slug&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;hotel_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;hv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;food_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="n"&gt;fv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;local_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;acts_low&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="n"&gt;av&lt;/span&gt;
  &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;cost_routes&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;dest_slug&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;-- 311 destinations, 311 all_constant&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All of them. 311 destinations, and not one has a hotel band that varies by origin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why that is the correct model, not a shortcut
&lt;/h2&gt;

&lt;p&gt;It would be easy to read this as laziness — "they just didn't compute per-origin hotel prices". The opposite is true: the on-the-ground cost genuinely belongs to the destination.&lt;/p&gt;

&lt;p&gt;Every input to those four lines is a property of the city:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accommodation&lt;/strong&gt; from the star mix and the depth of compliant supply. A city with few registered hotels has less to choose from, so the room you actually book costs more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Food&lt;/strong&gt; from restaurant density. A dense market prices lower, a thin one prices higher.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Activities&lt;/strong&gt; from the 5A/4A count, because a 5A ticket is dearer than a 4A one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local transport&lt;/strong&gt; from the size of the built-up area.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these change because your flight departed from a different continent. Storing them per-route would mean 143 copies of the same six numbers, and 143 chances to drift out of sync.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the 39% goes
&lt;/h2&gt;

&lt;p&gt;Averaged across the whole set:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Average&lt;/th&gt;
&lt;th&gt;Share&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Flights&lt;/td&gt;
&lt;td&gt;$602&lt;/td&gt;
&lt;td&gt;39%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accommodation&lt;/td&gt;
&lt;td&gt;$329&lt;/td&gt;
&lt;td&gt;21%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Food&lt;/td&gt;
&lt;td&gt;$291&lt;/td&gt;
&lt;td&gt;19%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attractions&lt;/td&gt;
&lt;td&gt;$157&lt;/td&gt;
&lt;td&gt;10%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fixed costs&lt;/td&gt;
&lt;td&gt;$90&lt;/td&gt;
&lt;td&gt;6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local transport&lt;/td&gt;
&lt;td&gt;$82&lt;/td&gt;
&lt;td&gt;5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$1,550&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The flight is the largest single line and the only one with real spread. On Beijing it runs $183 from Seoul (951 km) to $1,117 from Buenos Aires (19,266 km) — a 6.1× range on one line item, which produces the entire $934 gap between a $1,636 trip and a $2,570 one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second variable is your passport
&lt;/h2&gt;

&lt;p&gt;Fixed costs are the only other origin-dependent line, and they take 7 values: $63 for visa-free passports, tiered fees up to $163, and $203 for the United States. An American passport adds $140 against a visa-free one — the second-biggest origin effect in the model, and still under a sixth of the widest flight spread.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd carry to another dataset
&lt;/h2&gt;

&lt;p&gt;The check that paid for itself was asking &lt;strong&gt;how many distinct values&lt;/strong&gt; each field takes after grouping by the entity it should vary within. One value where you expected hundreds tells you the field belongs to a different entity than you assumed. In this case four fields belong to the destination, one to the origin, and one to the passport — three different owners inside what looked like a single flat route table.&lt;/p&gt;

&lt;p&gt;The routes are browsable at &lt;a href="https://sinostay.com/" rel="noopener noreferrer"&gt;sinostay&lt;/a&gt; — Beijing from Seoul and from Buenos Aires are &lt;a href="https://sinostay.com/cost/145.html" rel="noopener noreferrer"&gt;/cost/145.html&lt;/a&gt; and &lt;a href="https://sinostay.com/cost/3313.html" rel="noopener noreferrer"&gt;/cost/3313.html&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>data</category>
      <category>database</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
