A Survey of Spark-Based High-Performance Parallel and Distributed Geospatial Big Data Processing Technologies and Platforms
Original Chinese title: 基于Spark的高性能并行及分布式地理空间大数据处理技术和平台综述
Introduction:
We are living in an era of rapid data growth.
The ways we acquire data, the frequency of collection, storage volumes, data types, and storage formats are all growing at an unprecedented pace, while our methods for processing, understanding, and utilizing that data have lagged behind—leaving us stuck in the dilemma of “information explosion” and “information anxiety.” In the geospatial domain, anyone with a smartphone can now collect location data at any time along with location-tagged video, images, audio, temperature, humidity, speed, orientation, and more. Spatial imagery from satellites and drones is growing even faster, and all kinds of IoT sensors are streaming massive volumes of data every second. There is an urgent need for new IT approaches to process, analyze, and leverage this data so it can provide effective, timely, and accurate support for resource management, environmental protection, urban development, and disaster response.
— GISpark
Traditional GIS software has focused primarily on acquiring, storing, and managing data (of known schemas), supplemented by thematic map displays across spatial and temporal dimensions, along with spatial analysis methods such as spatial statistics, geographic zoning, path analysis, and site-selection optimization. These capabilities have played a vital role in urban construction, transportation, weather forecasting, regional development, and decision support.
Overall, however, traditional GIS still centers on moving data around and displaying it directly, lacking deep data understanding and multi-dimensional analytical methods. Moreover, existing data management and analysis algorithms are difficult to scale onto large-scale distributed parallel computing systems. They cannot meet the demands of exploratory analysis on unstructured, unknown data, fast processing of massive datasets and complex spatiotemporal relationships, large-scale data mining and advanced complex modeling, nor can they easily bring more people in to collaborate smoothly on cross-disciplinary research.
Challenges
- System Scalability: Petabyte-scale spatial data storage systems that allow applications to read data efficiently whenever needed.
- Interactive Performance: High-efficiency spatial data processing systems must respond within a timeframe users can tolerate.
Focusing on these two challenges, this post surveys the published literature on Spark-based cluster systems for large-scale spatial data, summarized below.
0. What Is Spark
Spark is an Apache project billed as “lightning-fast cluster computing.” It has a thriving open-source community and is currently the most active Apache project.
[Archived image unavailable in 2013–2019 mirror: /images/1.jpg]
Spark technology framework diagram
Spark introduces a concept called a Resilient Distributed Dataset (RDD), an immutable, fault-tolerant, distributed collection of objects that can be operated on in parallel. An RDD can hold any type of object and is created by loading an external dataset or distributing a collection from the driver application.
RDDs support two types of operations:
- Transformations are operations (such as map, filter, join, union, etc.) performed on an RDD that create a new RDD to hold the result.
- Actions are operations (such as reduce, count, first, etc.) that perform a computation on an RDD and return a value.
1. MongoDB
MongoDB enables data exchange between Hadoop and MongoDB through the MongoDB Connector, improving the efficiency of reading and computing over big data. Building on this, Niskanen integrates MongoDB with Spark using the Spark API.
2. GEOSPARK
GEOSPARK
is an in-memory cluster system for processing large-scale spatial data. Built on the Apache Spark core, it adds support for spatial data types, indexing, and operations. Key technical highlights include:
- Uses Apache Spark as the computing framework.
- Designs Spatial Resilient Distributed Datasets (SRDDs) on top of RDDs—such as Point RDD and Polygon RDD—and builds APIs around SRDDs so developers can easily write the spatial analysis programs they need.
- Organizes and partitions indexed SRDDs using a grid structure across multiple nodes for parallel computation. When building spatial indexes, it also automatically decides whether to create a local index based on the size of the SRDD on each partition, optimizing CPU and memory utilization during computation.
[Archived image unavailable in 2013–2019 mirror: /images/2.png]
GEOSPARK has a three-layer architecture:
-
Bottom layer — Apache Spark Layer: Handles data reading, writing, and persistence (interacting with HDFS and other storage systems).
-
Spatial Resilient Distributed Dataset layer, which includes three capabilities:
- Supports spatial data in various formats and converts them into SRDDs (points, lines, polygons, etc.).
- SRDD Partitioning: Partitions all loaded SRDDs by creating a global grid file, dividing the total storage space into a uniform grid with unique grid IDs and assigning all data into grid cells.
- SRDD Indexing: Supports Quad-Tree and R-Tree indexes, while also providing a local indexing mechanism for each SRDD.
-
Spatial Query Processing layer: Primarily implements spatial queries.
3. Chinese Academy of Surveying and Mapping
Jiping Liu et al. designed a distributed stream-computing-based method and system for spatial data processing, primarily targeting real-time monitoring of large-scale moving objects. It uses a Kafka messaging system to periodically ingest geospatial data and feeds it into a Spark cluster for computation and analysis.
4. State Key Laboratory of Resources and Environmental Information System, Institute of Geographic Sciences and Natural Resources Research, CAS
Xin Wen et al. designed a distributed spatial data analysis framework based on Shark/Spark, consisting of two parts:
- Distributed computing layer: Uses the high-performance Spark engine for computation. Unlike other distributed frameworks, Spark introduces Resilient Distributed Datasets (RDDs) for in-memory computation, saving substantial disk input/output (I/O) compared to MapReduce, and uses Shark (Hive on Spark) as the data warehouse to translate queries into RDD operations on Spark.
- Data management layer: Uses a hybrid storage approach combining spatial databases with HDFS. By reusing Hive’s StorageHandler mechanism in Shark, it accesses databases or files beyond HDFS. While this enables spatial data loading and distributed spatial querying, it lacks spatial indexing, resulting in modest efficiency.
[Archived image unavailable in 2013–2019 mirror: /images/3.png]
5. GISpark
GISpark is a distributed computing platform provided by SuperMap for large-scale geospatial information processing, modeling, and analysis.
Its foundation is built on OpenStack cloud computing and Docker containerization, with storage backed by large-scale virtualized storage systems such as HDFS, Ceph, and MongoDB for spatiotemporal data. It can handle massive vector, imagery, and streaming datasets while remaining compatible with existing GIS systems.
Using Spark as its distributed parallel computing framework, it integrates the GIScript geospatial scripting engine and various open-source GIS model libraries, alongside the Anaconda scientific computing environment and the Jupyter Notebook interactive web interface. Packed with classic algorithms and model libraries, it provides a continuously evolving modeling system for spatiotemporal big data processing and integrated spatiotemporal analysis.
On the machine learning side, it integrates multiple ML libraries such as TensorFlow and Orange, covering deep learning, object recognition, network analysis, unsupervised classification, dimensionality reduction, random forests, support vector machines, and more. Naturally, it also supports integrating SuperMap GIS’s powerful capabilities in geospatial data processing, cartography, visualization, map publishing, and spatial analysis services, as well as various other commercial software modules.
Users can either consume SuperMap’s services directly or deploy the entire platform themselves. Currently, cloud infrastructure and spatial data loading/processing are already in place, with ongoing development targeting cartography, spatial visualization, advanced spatial analysis, and real-time geospatial network stream processing.
6. GeoMesa Spark
GeoMesa is an open-source distributed cloud computing system developed under the Apache license for large-scale spatial analysis, primarily used to manage and analyze massive spatiotemporal datasets (IoT data, social media, trajectories, and mobile phone data).
GeoMesa Spark provides APIs built on Spark and GeoMesa storage technology for spatial computation, enabling users to create and write RDDs and store and manage them in GeoMesa.
7. Magellan
Magellan is an open-source Spark-based geospatial analytics system that leverages Catalyst for spatial data joins and SparkSQL for spatial queries, with PySpark integration for Python applications. It supports spatial data in ESRI formats, spatial querying, and basic spatial operations (Union, Distance, Intersection, Symmetric Difference, Convex Hull, Envelope, Buffer, Simplify, Valid, Area, Length), providing both Scala and Python APIs.
8. SpatialSpark
SpatialSpark is an open-source project from my lab. Starting in the spring of 2014, our lab shifted its research focus from single-machine computing to distributed geospatial data processing. A major driver was the widespread research and application interest sparked by Hadoop-based distributed geospatial systems—most notably the early work by Mohamed Mokbel’s group at the University of Minnesota (UMN) (SpatialHadoop) and Fusheng Wang’s group at Emory University (later moved to Stony Brook University) (HadoopGIS).
After carefully analyzing their source code, my advisor, Prof. Jianting Zhang, noted that despite Hadoop’s large user base, its architecture suffers from significant drawbacks. One key issue is that to simplify parallelization and support fault tolerance, it relies heavily on unnecessary disk reads and writes. Meanwhile, SpatialHadoop uses JTS and HadoopGIS uses GEOS—open-source libraries—as their underlying geometry engines (for evaluating spatial relationships). Both JTS and its C++ counterpart GEOS were largely designed nearly twenty years ago. Although long-term maintenance has proven their reliability to a degree, algorithms and implementations engineered for computer architectures of two decades ago can hardly achieve optimal performance on modern hardware.
[Archived image unavailable in 2013–2019 mirror: /images/4.png]
Our team pursued distributed geospatial data processing along two tracks: first, integrating single-node parallel spatial indexing, filtering, and refinement algorithms with modern big data systems (such as Spark and Impala); second, building a lightweight distributed execution engine from the ground up to support spatial data processing more natively and efficiently.
We first chose the open-source Cloudera Impala for our first research track, largely because Impala’s backend is written in C++ and had begun supporting SSE4-based SIMD vector operations (mainly for string processing) as well as LLVM-based Just-In-Time (JIT) compilation optimizations. These and other advanced features were very attractive for building a high-performance spatial big data engine.
After spending over six months thoroughly studying Impala’s design and implementation, the team successfully achieved our goal and built the ISP prototype system. It operates at the granularity of Impala row batches, extracting spatial data and building spatial indexes on the fly to support spatial queries (across both multi-core CPUs and GPUs). Even though Impala did not support multi-core CPUs within a single instance, we overcame numerous technical hurdles to design and implement multi-threaded concurrency using OpenMP and Intel TBB. Alongside that, the team built SpatialSpark, a Spark-based prototype system for geospatial big data processing. Unlike Impala—which is an end-user query engine—Spark is designed as a development environment for parallel data processing, making it much easier to extend applications on Spark than on Impala.
Our experimental results show that SpatialSpark achieves higher runtime efficiency than implementations based on Impala and GEOS. Because SpatialSpark relies on in-memory processing and leverages Scala and Spark’s architecture to express and execute parallelism in spatial operations (currently focused on queries) more effectively, it tends to deliver superior performance whenever cluster memory is sufficient.
Summary
As we can see, most teams are still focused on building foundational infrastructure. On the geospatial information service platform side, the current priority across the board is ingesting heterogeneous spatial data and managing and reading it efficiently. Some leading teams have also begun tackling spatial data processing and analysis, yet advanced spatial analysis, cartography, and spatial visualization remain largely unexplored—while multi-dimensional spatiotemporal analytics and machine learning frameworks represent the clear direction ahead and the goal everyone is striving toward.
My Next Steps
- Extend SpatialSpark to build a practical, Spark-based big data processing system.
- Integrate visualization technologies with geospatial big data processing systems.
- Apply high-performance spatial big data processing systems to the seed industry. Given my heavy demand for advanced spatial analytics in the seed sector, a central focus over the next two years will be developing and integrating domain models and algorithms on top of high-performance spatial processing technologies. As an initial entry point, I plan to focus on high-temperature heat stress in maize—combining remote sensing and weather station data to extract high-density usable temperature fields, constructing fine-scale planting environment units, and using in-memory computing for high-performance remote sensing temperature retrieval, spatial interpolation, overlay analysis, correlation analysis, zonal statistics, and spatial clustering. This will support multi-source, comprehensive, real-time spatiotemporal data fusion and modeling for major meteorological disasters in promoting new maize varieties.
引言:
我们正面临一个数据快速增长的时代。
数据获取的手段、获取的频度、数据的存储量、数据的类型、存储的方式都以前所未有的速度快速增加,而数据处理的手段和数据理解、利用的方法却相对落后,以至于陷入“信息爆炸”和“信息焦虑”的困境。对于地理空间信息领域来说,现在拥有智能手机的每个人都可以随时获取位置信息,以及位置相关的视频、图像、声音、温湿度、速度、姿态等各种信息,而卫星和无人机等设备获取的空间图像数据更是快速增长,各种物联网传感器也在每时每刻发送大量数据,迫切需要新的信息技术方法来对数据进行处理、分析和利用,为资源利用、环境保护、城市发展、灾难应急等提供有效、及时、准确的支持。
—GISpark
传统的GIS软件以(已知结构的)数据获取、存储、管理功能为主,并添加了各种时间维度和空间维度的专题图展示功能,具有空间统计、地理分区、路径分析、选址优化等空间分析方法,在城市建设、交通运输、气象预测、区域发展、决策支持等方面发挥了非常重要的作用。
但总体上来说,仍然以数据的搬运和直接展示为主,缺乏对数据的深度理解和多维度的分析方法。而且,现有的数据管理和分析算法也难以扩展到大规模的分布式并行计算系统之上,无法满足对非结构化的未知数据的探索性分析的需要,无法满足大规模数据快速处理和复杂时空关系的分析需要,无法满足大规模的数据挖掘和高级复杂模型的研究需要,也无法让更多的人参与进来,顺利开展跨领域的交叉性研究工作。
面临的挑战
- System Scalability 系统可扩展性:PB级空间数据存储系统使得各种应用程序在需要的时候高效读取。
- Interactive Performance 交互表现良好:高效的空间数据处理系统必须在用户可容忍的范围之内作出相应。
围绕以上两个挑战,本文对目前已经公布的基于Spark技术大规律空间数据的集群系统进行了文献综述,总结如下。
0.什么是SPARK
Spark是一个Apache项目,它被标榜为“快如闪电的集群计算”。它拥有一个繁荣的开源社区,并且是目前最活跃的Apache项目。
[Archived image unavailable in 2013–2019 mirror: /images/1.jpg]
Spark技术框架图
Spark引入了一个称为弹性分布式数据集(RDD,Resilient Distributed Dataset)的概念,它是一个不可变的、容错的、分布式对象集合,我们可以并行的操作这个集合。RDD可以包含任何类型的对象,它在加载外部数据集或者从驱动应用程序分发集合时创建。
RDD支持两种操作类型:
- 转换是一种操作(例如映射、过滤、联接、联合等等),它在一个RDD上执行操作,然后创建一个新的RDD来保存结果。
- 行动是一种操作(例如归并、计数、第一等等),它在一个RDD上执行某种计算,然后将结果返回。
1.MongoDB
MongoDB 通过MongoDB Connector实现Hadoop与MongoDB的数据交换, 提高了读取运算大数据的效率。在此基础之上, 结合Spark API Niskanen实现MongoDB与Spark的结合。
2.GEOSPARK
GEOSPARK
是用于处理大规律空间数据的内存集群系统。基于Apache Spark内核,使其可以支持空间数据类型,索引和操作。关键技术点如下
- 计算框架采用 Apache Spark
- 设计基于RDD的spatial Resilient distributed Dataset(SRDD)空间数据集。例如点RDD(Point RDD)和 面RDD(Polygon) 基于SRDD开发API, 让开发者可以容易开发所需要的空间分析程序。
- 将采用网格结构组织索引SRDD 分发到多台数据实现并行计算。同时在建立空间索引时,能根据分区上SRDD的大小自动决定是否创建本地索引,从而起到优化计算时CPU/内存的利用率。
[Archived image unavailable in 2013–2019 mirror: /images/2.png]
GEOSPARK为三层架构。
1.底层为Apache Spark Layer:用于数据的读写,持久化(和HDFS等其他存储的交互)
- Spatial Resilient Distributed Dataset 本层包括三个功能
- 支持各种格式的空间数据,转化为SRDD(点,线,面,多边形等)
- SRDD Partitioning 将所有载入的SRDDs 通过创建一个全局网格文件来分区,将总存储空间按统一网格划分并创立单一网格ID,将所有数据落入网格。
- SRDD Indexing 支持采用Quad-Tree和R-Tree 索引,同时对于每个SRDD都提供本地索引机制。
- Spatial Query Processing layer 主要实现空间查询。
3. 中科院测绘科学院
刘纪平等人设计一种基于分布式流式计算的空间数据处理方法与系统,主要应对大规模移动物体的事实监控,通过使用Kafka消息系统定时获取地理空间数据,转入Spark集群计算计算分析。
4. 中国科学院地理科学与资源研究所资源与环境信息系统国家重点实验室
温馨等设计了基于Shark/Spark的分布式空间数据分析框架
由2部分组成:
- 分布式计算层, 以计算性能良好的Spark作为计算引擎, 其引入了与其他分布式计算不同的弹性分布式数据集(Resilient Distributed Datasets, RDD)进行内存运算, 与MapReduce相比节省了大量的磁盘输入、输出(input/output, I/O)操作,并以Shark(Hive on Spark)作为数据仓库, 将查询语句转换为Spark上的RDD操作。
- 数据管理层, 采用空间数据库与HDFS混合的方式进行数据存储。通过在Shark中沿用Hive的StorageHandler方法, 访问除HDFS文件以外的其他数据库或文件。实现了空间数据加载,分布式空间查询,但并没有建立空间索引,效率不高。
[Archived image unavailable in 2013–2019 mirror: /images/3.png]
5. GISpark
GISpark 是超图提供用于大规模地理空间信息处理与建模分析的分布式计算平台。
底层基于OpenStack云计算环境和Docker容器技术进行开发,存储采用HDFS/Ceph/MongoDB等大规模虚拟化存储系统进行时空信息的存储,能够处理大规模的矢量、影像和流式数据,能够兼容已有的GIS系统。
Spark 为其分布式并行计算框架,融合GIScript地理空间信息脚本引擎和多种开源的GIS模型库,同时集成Anaconda科学计算环境和Jupyter notebook交互计算Web界面,包含大量的经典算法和模型库,可以为时空大数据处理和时空一体化分析提供持续发展的模型系统。
在机器学习方面,集成TensorFlow和Orange等多种机器学习算法库,包含深度学习、对象识别、网络分析、自主分类、降维分析、随机森林、支持向量机等多种算法,当然也支持集成SuperMap GIS的强大地理空间数据处理和制图、可视化与地图发布服务、空间分析服务等重要能力,并能集成其它各种商业软件模块。
用户可以直接使用SUPERMAP的服务,也可以自己搭建整套平台,目前已经实现了云计算基础设备,空间数据处理载入等功能,正在开发为地理制图,空间可视化,高级空间分析和地理空间网络实时流处理等方面发展。
6. GeoMesa Spark
GeoMesa 是遵守Apache开源规则所开发的针对大规律空间分析的分布式云计算系统,主要用于管理和分析海量时空数据(物联网数据,社交媒体,轨迹和手机数据)。
GeoMesa Spark 提供了基于Spark和GeoMesa存储技术的APIs 用于空间计算,可以创建和写入RDDs。将RDD在GeoMesa中存储管理。
7. Magellan
Magellan 基于Spark 开源地理空间分析系统,利用Catalyst实现空间数据链接,基于SparkSQL实现空间查询。Pyspark 集成Python应用。支持ESRI格式的空间数据,对空间数据查询,简单空间操作(Union, Distance, Intersection, Symmetric Difference, Convex Hull, Envelope, Buffer, Simplify, Valid, Area, Length),提供Scala 和 Python API
8. SpatialSpark
SpatialSpark为我所在实验室开源项目。2014年春天开始,实验室将研究重点从单机计算转移到分布式地理空间数据的 研究上来。一个重要的原因是基于Hadoop的分布式地理空间数据引起了广泛的研究和应用兴趣。University of Minnesota (UMN) Mohamed Mokbel 研究组 (SpatialHadoop) 和Emory University Fusheng Wang 研究组(HadoopGIS,后 转入Stony Brook University)在这方面取得了很好的先期研究结果。
在仔细分析他们的源码后我的导师张健挺教授认为尽管Hadoop有较大的用户群,该系统在体系设计方面存在较大缺陷。主要问题之一是为了简化并行化的复杂度并支持容错,该系统大量使用不必要的硬盘读写。同时SpatialHadoop使用JTS,HadoopGIS使用GEOS开源软件包作为底层几何计算引擎(以判断空间关系)。JTS及其C++版本的GEOS距离其主要设计开发时期已近二十年。尽管长时间的维护在一定程度上 证了他们的可靠性,为二十年前计算机体系结构设计的算法和实现已很难在当前体系结构下获得最优化。
[Archived image unavailable in 2013–2019 mirror: /images/4.png]
团队在两个方面进行了分布式地理空间数据处理研究的尝试,一是将单机并行空间索引(indexing),空间过滤 (filtering)和空间提炼(refinement)算法设计与最新大数据处理系统(如Spark和Impala)集成,另一个是从底层开发轻量级分布式执行引擎以更高效内在(native)地支持空间数据处理。
团队首先选择了Cloudera Impala开源软件作为第一个研究方向的尝试。 这主要是由于Impala的后端基于C++并开始支持基于SSE4的SIMD矢量操作(主要应用于字符串处理)和基于开源编译器LLVM的即时(Just In Time –JIT) 编译优化。这些及其它先进的特性对于我们研发一个高性能空间大数据处理引擎非常有吸引力。
在经过超过6个月全力理解Impala设计及实现后,团队终于成功地实现了预期目标并开发了ISP原型系统。实现以Impala行组(row batch)为单位,抽取其中的空间数据并实时建立空间索引以支持空间查询(包括多核CPU和GPU)。尽管Impala在一个安装实例(instance)内并不支持多核CPU,在克服了许多技术困难后我们设计并实现了基于OpenMP和Intel TBB的多线程并发实现。团队实现了一个基于Spark的地理空间大数据的处理原型系统SpatialSpark。与作为一个终端应用系统的Impala不同,Spark被设计成一个并行数据处理的开发环境。这使得基于Spark 的开发较基于Impala的扩展容易得多。
团队实验结果表明,SpatialSpark较基于Impala和GEOS的实现具有较高的运行效率。由于SpatialSpark采用基于内存的处理,基于Scala编程语言和Spark框架结构更有效地表达和执行空间操作(目前以查询为主)中的并行性,因而当集群系统内存充足的情况下,它往往具有更高的效率。
总结
可以看出,目前各个团队主要实现的均为基础设备的构建,在地理信息空间服务平台实现上,现阶段主要是对接各类空间数据,高效管理和读取是大家的重点,同时也有一些领先的团队已经着手开始空间数据的处理和分析,但是高级空间分析,地理制图空间可视化等方面仍旧是空白,而多维时空分析,机器学习框架更是今后发展的趋势。也是各个团队奋斗的目标。
我的下一步工作
- 扩展SpatialSpark以开发基于Spark的实用大数据处理系统。
- 可视化技术与地理空间大数据处理的系统集成。
- 高性能空间大数据处理系统在种业中的应用。结合本人种业大量的高级空间分析功能的需求,如何在以后的高性能空间处理技术上开发集成所需要的模型算法将是这两年的重点,初步的方向将以玉米高温热害为切入点,结合遥感和气象站点数据提取高密度可用温度数据,构建小尺度种植环境单元,利用内存计算实现高性能遥感温度反演、空间插值、叠加分析、相关分析、区域统计、空间聚类等。支撑面向玉米新品种推广的重大气象灾害多元、全方位、实时时空数据融合和模型实现。