Under Chinese law, the use of geographic information in the People's Republic of China is restricted to entities that have special authorization from the administrative department for surveying and mapping under the State Council. Consequences of the restriction include fines for unauthorized surveys, lack of geotagging information on many cameras when the GPS chip detects a location within China, incorrect alignment of street maps with satellite maps in various applications, and the criminalization of crowdsourced mapping efforts such as OpenStreetMap.[non-primary source needed]
Chinese lawmakers said that these restrictions are to "safeguard the security of China's geographic information". Song Chaozhi, an official of the State Bureau of Surveying and Mapping, said "foreign organizations who wish to carry out mapping or surveying work within China must make clear that they will not touch upon state secrets or endanger state security". Critics outside of China point out that the laws close critical sectors of the Chinese economy to foreign companies, and assist with cracking down on dissent.
According to articles 7, 26, 40 and 42 of the Surveying and Mapping Law of the People's Republic of China, private surveying and mapping activities have been illegal in mainland China since 2002. The law prohibits
publishing, without authorization, significant geographic information and data concerning the territorial air, land and waters, as well as other sea areas under the jurisdiction of the People's Republic of China.— The National Administration of Surveying, Mapping and Geoinformation of China, Surveying and Mapping Law of the People's Republic of China
Article 1 says:
This Law is enacted to strengthen the administration of the surveying and mapping undertaking, promote its development and ensure that it renders service to development of the national economy, the building up of national defence, and progress of the society.
Between 2006 and 2011, the authorities pursued around 40 illegal cases of mapping and surveying. The media has reported on other cases of unlawful surveys:
- March 7, 2007 - Japanese and Korean scholars fined; joint-venture Weihai hired foreign surveyors without approval from the government
- March 25, 2008 - China's State Bureau of Surveying and Mapping cracks down on some of the 10,000 websites that publish maps in China, most without authorization.
- January 6, 2009 - Chinese authorities fine UK students for “illegal map-making activities”.
- 2010 - Chinese authorities to crack down on the unregistered or illegal among 42,000 online map providers, targeting incorrect information and leaks of sensitive information involving state secrets. New standards require all Internet map providers to keep servers storing map data inside China.
- March 14, 2014 - Coca-Cola is accused of illegal mapping.
As a consequence, major digital camera manufacturers including Panasonic, Leica, FujiFilm, Nikon and Samsung restrict location information within China.
Chinese law and regulations also rule on the contents of any published map:
- The 公开地图内容表示若干规定 ("some rules on the content presentation of public maps") of 2003 by the Bureau of Surveying and Mapping (BSM) prohibits the representation of sensitive information such as airports (except those specially listed), military bases, and waterway depths. It also describes the handling and naming of disputed territories and former Qing territories ceded to Russia.
- The 公开地图内容表示补充规定（试行）("supplementary rules on the content presentation of public maps, trial version") of 2009 from the BSM additionally prohibits, among other things:
- Locations having a precision of finer than 50 meters and the use of grids finer than 100 meters for elevation data.
- Showing the locations of key infrastructure (power, dams, weather stations) and public safety installations (prisons, mandatory drug rehab facilities).
- Showing the internal structures of airports and ferry ports.
- Showing the weight and height limits of bridges, roads, and tunnels; showing the material of roads.
- The 地图管理条例 ("map management regulation") of 2015 from the State Council mandates that all Internet maps must be stored in mainland China, among other rules about national security. The law also details punishments, some of which criminal, for violations.
In 2016, a large-scale search by Chinese law enforcement found 253 types of problematic paper maps and 1000 problematic online map websites, most pertaining to the depiction of Taiwan and 9-dash line.
Technical spatial processing must be applied to electronic navigational maps prior to publication, sales, redistribution, and usage.— GB 20263―2006 "Basic security processes for electronic navigational maps", 4.1
Chinese regulations require that approved map service providers in China use a specific coordinate system, called GCJ-02 (colloquially Mars Coordinates). Baidu Maps uses yet another coordinate system - BD-09, which seems to be based on GCJ-02.
GCJ-02 (officially Chinese: 地形图非线性保密处理算法; lit. 'Topographic map non-linear confidentiality algorithm') is a geodetic datum used by the Chinese State Bureau of Surveying and Mapping (Chinese: 国测局; pinyin: guó-cè-jú), and based on WGS-84. It uses an obfuscation algorithm which adds apparently random offsets to both the latitude and longitude, with the alleged goal of improving national security. There is a licence fee associated with using this mandatory algorithm in China.
A marker with GCJ-02 coordinates will be displayed at the correct location on a GCJ-02 map. However, the offsets can result in a 100–700 meter error from the actual location if a WGS-84 marker (such as a GPS location) is placed on a GCJ-02 map, or vice versa. The Google Maps street map is offset by 50–500 meters from its satellite imagery. Yahoo! Maps also displayed the street map without major errors when compared to the satellite imagery. MapQuest overlays OpenStreetMap data perfectly as well.
From the leaked code, GCJ-02 uses parameters from the SK-42 reference system. The parameters were used to calculate lengths of one degree of latitude and longitude, so that offsets in meters previously calculated can be converted to degrees for the WGS-84 input coordinates.
BD-09 is a geographic coordinate system used by Baidu Maps, adding further obfuscation to GCJ-02 "to better protect users' privacy". Baidu provides an API call to convert from Google or GPS (WGS-84), GCJ-02, BD-09, MapBar or 51ditu coordinates into Baidu or GCJ-02 coordinates. As required by local law, there is no API to convert into WGS-84, but open source implementations in R and various other languages exist.
As the actual algorithm is now available in open source form (see above), the text below is obsolete.
GCJ-02 appears to use multiple high-frequency noises of the form , effectively generating a transcendental equation and thus eliminating analytical solutions.[original research?] However, the open-source "reverse" transformations make use of the properties of GCJ-02 that the transformed coordinates are not too far from WGS-84 and are mostly monotonic related to corresponding WGS-84 coordinates:
from typing import Callable # Represent coordinates with complex numbers for simplicity coords = complex # Coords-to-coords function C2C = Callable[[coords], coords] def rev_transform_rough(bad: coords, worsen: C2C) -> coords: """Roughly reverse the ``worsen`` transformation. Since ``bad = worsen(good)`` is close to ``good``, ``worsen(bad) - bad`` can be used to approximate ``bad - good``. First seen in eviltransform. """ return bad - (worsen(bad) - bad) def rev_transform(bad: coords, worsen: C2C) -> coords: """More precisely reverse the ``worsen`` transformation. Similar to ``rev_transform_rough``, ``worsen(a) - worsen(b)`` can be used to approximate ``a - b``. First seen in geoChina/R/cst.R (caijun 2014). Iteration-only version (without rough initialization) has been known since fengzee-me/ChinaMapShift (November 2013). """ eps = 1e-6 wgs = bad improvement = 99 + 99j # dummy value while abs(improvement) > eps: improvement = worsen(wgs) - bad wgs = wgs - improvement return wgs
The rough method is reported to give some 1~2 meter accuracy for wgs2gcj, while the exact (fixed point iteration) method is able to get "centimeter accuracy" in two calls to the forward function.[note 1] Since the two properties ensure some basic functionality of the coordinate system, it is unlikely that the methods will change with new coordinate systems.[original research?] The BD-to-GCJ code works in a manner much like the rough method, except that it removes the explicitly-applied constant shift of ~20 seconds of arc on both coordinates first and works in polar coordinates like the forward function does.
The establishment of working conversion methods both ways largely renders obsolete datasets for deviations mentioned below.
GPS shift problem
The China GPS shift (or offset) problem is a class of issues stemming from the difference between the GCJ-02 and WGS-84 datums. Global Positioning System coordinates are expressed using the WGS-84 standard and when plotted on street maps of China that follow the GCJ-02 coordinates, they appear off by a large and variable amount (often over 500 meters). Authorized providers of location-based services and digital maps (such as AutoNavi or NavInfo or Apple Maps) must purchase a "shift correction" algorithm that enables plotting GPS locations correctly on the map. Satellite imagery and user-contributed street map data sets, such as those from OpenStreetMap also display correctly because they have been collected using GPS devices (albeit technically illegally – see Legislation).
Google has worked with Chinese location-based service provider AutoNavi since 2006 to source its maps in China. Google uses GCJ-02 data for the street map, but does not shift the satellite imagery layer, which continues to use WGS-84 coordinates, with the benefit that WGS-84 positions can still be overlaid correctly on the satellite image (but not the street map). Google Earth also uses WGS-84 to display the satellite imagery.
Overlaying GPS tracks on Google Maps and any street maps sourced from Google.com via its API, will lead to a similar display offset problem, because GPS tracks use WGS-84, and Google Maps uses GCJ-02. The issue has been reported numerous times on the Google Product Forums since 2009, with 3rd party applications emerging to fix it. Data sets with offsets for large lists of Chinese cities existed for sale. The problem was observed as early as 2008, and the causes were unclear, with (misguided) speculation that imported GPS chips were tampered with code that caused incorrect reporting of coordinates.
Hong Kong and Macau
Under One Country Two Systems, legislation in mainland China does not apply in Hong Kong and Macau SARs and there are no similar restrictions in the SARs. Therefore, the GPS shift problem does not apply. However, at the border between the SARs and mainland China, the data shown by online maps such as Google Maps are broken where the shifted data and correct data overlap. This poses problems to users travelling across the border,[clarification needed] especially visitors not aware of the issue.
wgs -= worsen(wgs) - baddone twice, with
badso that the first iteration is equivalent to a rough pass.
- "Surveying and Mapping Law of the People's Republic of China". National Administration of Surveying, Mapping and Geoinformation of China. Archived from the original on 25 May 2017. Retrieved 7 April 2015.
- Rabaza Bergua, Carlos S.; López-de-Larrínzar-Galdámez, Juan; Salvador Suárez, Iván; Usón Montesinos, Miguel; Muro Medrano, Pedro R. (13 November 2013). Restricciones al trabajo con información geográfica online en China (PDF). IV Jornadas Ibéricas de Infraestructuras de Datos Espaciales. Universidad de Castilla-La Mancha, Campus Tecnológico Fábrica de Armas, Toledo: JIIDE 2013.
- "Surveying and Mapping Law of the People's Republic of China— National Administration of Surveying, Mapping and Geoinformation". en.nasg.gov.cn. Archived from the original on 25 May 2017. Retrieved 27 February 2018.
Articles 7, 26, 40 and 42
- "China revises mapping law to bolster territorial claims". Reuters. 27 April 2017. Retrieved 14 February 2021.
- Wikisource. (in Chinese) – via
- Hvistendahl, M. (24 January 2013). "Foreigners Run Afoul of China's Tightening Secrecy Rules". Science. 339 (6118): 384–385. Bibcode:2013Sci...339..384H. doi:10.1126/science.339.6118.384. PMID 23349263.
- Dingding, Xin (7 March 2007). "Unlawful surveys to be dealt severely". China Daily.
- Liang, Yan (25 March 2008). "China cracks down on illegal online map services to protect state security". Beijing. Xinhua News Agency. Archived from the original on 30 March 2008.
- "China fines UK students for 'illegal map-making'". AFP. 6 January 2009. Archived from the original on 16 June 2010.
- Wang, Guanqun (19 May 2010). "China issues new rules on Internet map publishing". Xinhua News Agency. Archived from the original on 23 May 2010.
- Pasternack, Alex (14 March 2013). "If You're a Foreigner Using GPS in China, You Could Be a Spy". Vice.
- Doctorow, Cory (23 May 2015). "Why your camera's GPS won't work in China (maybe)". Boing Boing. Archived from the original on 25 May 2015. Alt URL
- "Legality". Project China. OpenStreetMap. Retrieved 7 April 2015.
- Wikisource. (in Chinese) – via
- Wikisource. (in Chinese) – via
- Wikisource. (in Chinese) – via
- ""问题地图"会带来哪些问题？" [What problems do "problematic maps" bring?]. 新华网 (in Chinese).
- "Coordinate conversion" (in Chinese). Baidu Maps. Retrieved 7 April 2015.
- "坐标转换API" [Coordinate Conversion API]. developer.baidu.com/map (in Chinese). Baidu. Archived from the original on 28 March 2017.
- "A package for geocoding, reverse geocoding and coordinate transformations between WGS-84, GCJ-02 and BD-09 coordinate systems". GitHub. 15 February 2014.
- "科研要为祖国和人民服务――记中国测绘科学研究院地图学与地理信息系统研究所党支部书记、所长李成名" [Scientific Research Should Serve the Motherland and the People: On Li Chengming, Secretary of the Party Branch and Director of the Institute of Cartography and Geographic Information System, China Academy of Surveying and Mapping Sciences]. 中国共产党新闻网 (in Chinese (China)). 人民网（创先争优）. Archived from the original on 4 August 2011. Retrieved 30 March 2017.
李成名怀着"要为国家做点什么，要为百姓做点什么"的信念，带领团队研制出地形图非线性保密处理算法，开发出"新地图"系列软件，有效解决了测绘成果保密与民用的两难问题。[LCM believed that he had to "do something for the state and the people". He led his team in the R&D of a topographic map non-linear confidentiality algorithm and a "new map" software suite, thereby effectively solving the conflict of confidentiality and civilian use of survey results.] [...] 然而，李成名及其团队作出决定：将"新地图"软件以只收取成本费用甚至免费的方式提供给各个城市。[However, Li Chengwan and his team decided to provide the "new map" software to cities at cost or even for free.]
- "Quickstart". Google Maps for AngularJS. Retrieved 7 April 2015.
- "手机地理轨迹取证步骤大解密". IT168.
- "国内常见的电子地图坐标介绍". 鲲鹏Web数据抓取.
- "Google.com hybrid map of The Bund". Retrieved 7 April 2015.
- "Yahoo! Map of The Bund". Retrieved 7 April 2015.
- "MapQuest map of The Bund". Retrieved 7 April 2015.[permanent dead link]
- "EvilTransform.cs". 2 February 2013.
- Lee, Googol (14 October 2021). "Transform coordinates between Earth (WGS-84) and Mars in China (GCJ-02)". GitHub.
- "China GPS offset problem". SnapDragon Blog.
- "MarsGeo". Omniref. Archived from the original on 16 April 2015.
- "EvilTransform Ruby gem".
- FENG, Zili (6 April 2015). "ChinaMapDeviation". GitHub. Archived from the original on 7 April 2015.
- Guilbot, Maxime (28 May 2013). "ChinaMapDeviation". GitHub.
- Wu, Yongzheng. "The Deviation of China Map as a Regression Problem". GitHub Pages. Retrieved 1 February 2016.
- "Baidu LBS Open Platform FAQ". Baidu Developer. Retrieved 19 December 2016.
- "WEB 服务 API – 坐标转换服务" (in Chinese). 百度地图开放平台. 6 March 2014. Retrieved 23 March 2019.
- "中国地图偏移算法" (in Chinese). Archived from the original on 24 March 2020. Alt URL
- bewantbe. "make gcj2wgs_exact() much faster, by using fixed…". GitHub. Retrieved 29 February 2016.
- Feng, Zili (7 April 2015). "The government charges Chinese companies for the "shift correction" feature". GitHub.
- Monument to the People's Heroes. "Nokia Here street map and satellite map both use GCJ-02 coordinates". Retrieved 8 April 2015.
- Lee, Mark (6 July 2012). "Apple Shares Google China Map Partner in Win for AutoNavi: Tech". Bloomberg.com. Bloomberg.
- Monument to the People's Heroes. "Google.com satellite imagery uses WGS-84 coordinates". Retrieved 8 April 2015.
- "Could you please correct the offset in China due to GCJ-02 coordinate?". Google Earth. Google Product Forums. 6 April 2014.
- "OFFSET MAPPING ISSUE IN CHINA". Google Product Forums. 5 March 2012.
- "ABCMaps application to fix the China GPS offset". 24 July 2010.
- Pasden, John (23 December 2014). "A More Complete iOS Solution to the China GPS Offset Problem".
- Wang, Jian Shuo. "All Maps in China are Transformed". Archived from the original on 16 January 2014.
- "Google Maps near Hong Kong-Shenzhen border". Google Maps. Retrieved 19 December 2016.