Skip to content

Sample Code that shows how to use Google S2 Library to create GeoSpatial application in MapR-DB

License

Notifications You must be signed in to change notification settings

mapr-demos/mapr-geospatial-with-s2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MapR-geospatial-with-S2

About cells

S2 cells have a level ranging from 30 ~0.7cm² to 0 ~85,000,000km². Each cell has a long id which easy to store

The main advantage is the region coverer algorithm, give it a region and the maximum number of cells you want, S2 will return some cells at different levels that cover the region you asked for, remember one cell corresponds to a range lookup you’ll have to perform in your database.

More info about S2 lib you can find in this blog post.

Prerequisites

Setting up MapR Container For Developers

MapR Container For Developers is a docker image that enables you to quickly deploy a MapR environment on your developer machine.

Installation, Setup and further information can be found here.

Creating JSON Table in MapR

  • Create Airports table
$ maprcli table create -path /apps/airports -tabletype json
$ maprcli table cf edit -path /apps/airports -cfname default -readperm p -writeperm p
  • Create Index for a airports table
maprcli table index add -path /apps/airports -index cellID -indexedfields cellId
  • Create States table
$ maprcli table create -path /apps/states -tabletype json
$ maprcli table cf edit -path /apps/states -cfname default -readperm p -writeperm p

About

Sample Code that shows how to use Google S2 Library to create GeoSpatial application in MapR-DB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages