OUTLINE

GIS(Geographic Information System),地理信息系统,意在处理空间坐标信息。在GIS开源项目中比较有名的当属用于数据存储的GeoServer和数据检索的GeoMesa,其都是apache下的开源项目,用于处理大数据的时空实时数据,其配合分布式数据库Hbase,accumulo,redis等来处理分布式或配合kafka,spark来处理实时流数据。这里配合redis来对geomesa进行二次开发来完成GB级数据下对时空数据的自定义检索,并使用geoServer来对数据进行可视化显示。

安装GeoMesa

先直观体验下GeoMesa的演示效果,在官网文档中直接下载:

1
2
$ git clone https://github.com/geomesa/geomesa-tutorials.git
$ cd geomesa-tutorials

然后用idea打开redis-tutorial:

idea

在打开redis-server后配合运行参数
--redis.url localhost --redis.catalog mesa即可quickstart:

可以看到直观的时空数据检索demo:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Loading datastore

Creating schema: GLOBALEVENTID:String,Actor1Name:String,Actor1CountryCode:String,Actor2Name:String,Actor2CountryCode:String,EventCode:String,NumMentions:Integer,NumSources:Integer,NumArticles:Integer,ActionGeo_Type:Integer,ActionGeo_FullName:String,ActionGeo_CountryCode:String,dtg:Date,geom:Point:srid=4326

Generating test data

Writing test data
Wrote 2356 features

Running query BBOX(geom, -120.0,30.0,-75.0,55.0) AND dtg DURING 2017-12-31T00:00:00+00:00/2018-01-02T00:00:00+00:00
01 719026369=719026369|MEXICO|MEX|AMERICAN|USA|193|6|1|6|4|Playas De Tijuana, Baja California, Mexico|MX|2018-01-01T00:00:00.000Z|POINT (-117.133 32.55)
02 719026370=719026370|MEXICO|MEX|UNITED STATES|USA|193|4|1|4|3|Imperial Beach, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.113 32.5839)
03 719025493=719025493|CIVILIAN||||013|5|1|5|3|San Diego, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.157 32.7153)
04 719025742=719025742|KING||||051|22|3|22|3|San Diego, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.157 32.7153)
05 719025915=719025915|PRESIDENT||UNITED STATES|USA|018|1|1|1|3|San Diego, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.157 32.7153)
06 719027017=719027017|UNITED STATES|USA|||190|2|1|2|3|San Diego, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.157 32.7153)
07 719027116=719027116|UNITED STATES|USA|KING||051|8|1|8|3|San Diego, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.157 32.7153)
08 719025124=719025124|||SACRAMENTO|USA|1823|8|1|8|3|Camp Pendleton, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.393 33.2103)
09 719025400=719025400|POLICE||||111|5|1|5|3|Camp Pendleton, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.393 33.2103)
10 719025402=719025402|POLICE||||112|5|1|5|3|Camp Pendleton, California, United States|US|2018-01-01T00:00:00.000Z|POINT (-117.393 33.2103)

Returned 669 total features

Comments

2020-06-10

⬆︎TOP