Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st. We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here. Need help or have questions? Drop us a line at [email protected]
Create GeoMesa SimpleFeatureType (sft) configuration file as below in ais_data_conf.sft
geomesa.sfts.ais-data = {
attributes = [
{ name = "arkposid", type = "Long", index = true }
{ name = "mmsi", type = "Integer", index = false }
{ name = "navigationalstatus", type = "Integer", index = false }
{ name = "coords", type = "Point", index = true, srid = 4326, default = true }
{ name = "sog", type = "Double", index = false }
{ name = "cog", type = "Double", index = false }
{ name = "rot", type = "Double", index = false }
{ name = "heading", type = "Integer", index = false }
{ name = "acquisitiontime", type = "String", index = false }
{ name = "iptype", type = "Integer", index = false }
]
}
Create GeoMesa converter configuration file as below in ais_data_feature_conf.convert
geomesa.converters.ais-data = {
type = "delimited-text",
format = "CSV",
id-field = "toString($arkposid)",
fields = [
{ name = "arkposid", transform = "$1::long" }
{ name = "mmsi", transform = "$2::int" }
{ name = "navigationalstatus", transform = "$3::int" }
{ name = "lon", transform = "$4::double" }
{ name = "lat", transform = "$5::double" }
{ name = "coords", transform = "point($lon, $lat)" }
{ name = "sog", transform = "$6::double" }
{ name = "cog", transform = "$7::double" }
{ name = "rot", transform = "$8::double" }
{ name = "heading", transform = "$9::int" }
{ name = "acquisitiontime", transform = "toString($10)" }
{ name = "iptype", transform = "$11::int" }
]
}
Run the geomesa-hbase command to insert the CSV data into HBase
<code>INFO Creating schema 'ais-data'
INFO Running ingestion in local mode
INFO Ingesting 1 file with 1 thread
[============================================================] 100% complete 4 ingested 0 failed in 00:00:01
INFO Local ingestion complete in 00:00:01
INFO Ingested 4 features and failed to ingest 0 feature.