├── geomesa-quickstart-python ├── tools │ ├── __init__.py │ ├── dbModify │ │ ├── __init__.py │ │ └── insert.py │ └── ECQL │ │ ├── __init__.py │ │ ├── filter.py │ │ └── queryFormatters.py ├── pyJavaClasses │ ├── __init__.py │ ├── javaDateTime.py │ ├── SimpleFeatureType.py │ ├── customJavaClasses.py │ ├── FeatureTypes.py │ └── datastore.py ├── utils │ ├── __init__.py │ ├── quickstart_command_line_parser.py │ ├── geomesa_command_line_parser.py │ ├── geomesa_plotting.py │ └── geomesa_jnius_setup.py ├── __init__.py └── PyMesa.e4p ├── README.md ├── geomesa-tutorials-accumulo ├── geomesa-tutorials-accumulo-authorizations │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── META-INF │ │ │ │ └── services │ │ │ │ │ └── org.locationtech.geomesa.security.AuthorizationsProvider │ │ │ ├── log4j.properties │ │ │ ├── geomesa-ldap.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── accumulo │ │ │ └── auths │ │ │ ├── EmptyAuthorizationsProvider.java │ │ │ └── LdapAuthorizationsProviderTest.java │ ├── README.md │ └── pom.xml ├── README.md ├── geomesa-tutorials-accumulo-avro │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── accumulo │ │ │ └── avro │ │ │ └── AccumuloAvroTutorial.java │ └── pom.xml ├── geomesa-tutorials-accumulo-lambda-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ └── pom.xml ├── geomesa-tutorials-accumulo-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── simplelogger.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── accumulo │ │ │ └── AccumuloQuickStart.java │ └── pom.xml ├── geomesa-tutorials-accumulo-transforms │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── accumulo │ │ │ └── transformations │ │ │ └── AccumuloQueryTutorial.java │ └── pom.xml └── geomesa-tutorials-accumulo-feature-level-vis │ ├── README.md │ ├── src │ └── main │ │ ├── resources │ │ ├── log4j.properties │ │ └── logback.xml │ │ └── java │ │ └── org │ │ └── geomesa │ │ └── example │ │ └── accumulo │ │ └── vis │ │ └── FeatureLevelVisibilityTutorial.java │ └── pom.xml ├── geomesa-tutorials-common ├── README.md ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── geomesa │ └── example │ ├── quickstart │ └── CommandLineDataStore.java │ ├── data │ ├── TutorialData.java │ └── CvilleRICData.java │ └── avro │ └── GeoMesaAvroTutorial.java ├── geomesa-tutorials-hbase ├── README.md ├── geomesa-tutorials-hbase-avro │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── hbase │ │ │ └── avro │ │ │ └── HBaseAvroTutorial.java │ └── pom.xml ├── geomesa-tutorials-hbase-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── hbase │ │ │ └── HBaseQuickStart.java │ └── pom.xml └── geomesa-tutorials-hbase-transforms │ ├── README.md │ ├── src │ └── main │ │ ├── resources │ │ ├── log4j.properties │ │ └── logback.xml │ │ └── java │ │ └── org │ │ └── geomesa │ │ └── example │ │ └── hbase │ │ └── transformations │ │ └── HBaseQueryTutorial.java │ └── pom.xml ├── geomesa-tutorials-kafka ├── README.md ├── geomesa-tutorials-kafka-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ └── pom.xml ├── geomesa-tutorials-kafka-streams-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── logback.xml │ │ │ └── log4j.properties │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── kafka │ │ │ ├── GeoPartitioner.java │ │ │ └── Proximity.java │ └── pom.xml └── pom.xml ├── geomesa-tutorials-redis ├── README.md ├── geomesa-tutorials-redis-avro │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── redis │ │ │ └── avro │ │ │ └── RedisAvroTutorial.java │ └── pom.xml ├── geomesa-tutorials-redis-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── redis │ │ │ └── RedisQuickStart.java │ └── pom.xml ├── geomesa-tutorials-redis-transforms │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── redis │ │ │ └── transformations │ │ │ └── RedisQueryTutorial.java │ └── pom.xml └── pom.xml ├── geomesa-tutorials-fsds ├── README.md ├── geomesa-tutorials-fsds-avro │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── fsds │ │ │ └── avro │ │ │ └── FileSystemAvroTutorial.java │ └── pom.xml ├── geomesa-tutorials-fsds-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── fsds │ │ │ └── FileSystemQuickStart.java │ └── pom.xml ├── geomesa-tutorials-fsds-transforms │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── fsds │ │ │ └── transformations │ │ │ └── FileSystemQueryTutorial.java │ └── pom.xml └── pom.xml ├── geomesa-tutorials-cassandra ├── README.md ├── geomesa-tutorials-cassandra-avro │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── cassandra │ │ │ └── avro │ │ │ └── CassandraAvroTutorial.java │ └── pom.xml ├── geomesa-tutorials-cassandra-quickstart │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── cassandra │ │ │ └── CassandraQuickStart.java │ └── pom.xml ├── geomesa-tutorials-cassandra-transforms │ ├── README.md │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── org │ │ │ └── geomesa │ │ │ └── example │ │ │ └── cassandra │ │ │ └── transformations │ │ │ └── CassandraQueryTutorial.java │ └── pom.xml └── pom.xml ├── geomesa-quickstart-storm ├── README.md ├── src │ └── main │ │ └── java │ │ └── com │ │ └── example │ │ └── geomesa │ │ └── storm │ │ ├── OSMKafkaSpout.java │ │ ├── OSMIngestProducer.java │ │ └── OSMKafkaBolt.java └── pom.xml ├── geomesa-examples-spark ├── README.md ├── src │ └── main │ │ └── scala │ │ └── com │ │ └── example │ │ └── geomesa │ │ └── spark │ │ └── CountByDay.scala └── pom.xml ├── .gitignore └── .github └── workflows └── build-and-test.yml /geomesa-quickstart-python/tools/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | __all__ = ["dbModify", "ECQL"] 4 | #from . import * 5 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/tools/dbModify/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | __all__ = ["insert"] 4 | from . import * 5 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/tools/ECQL/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | __all__ = ["filter", "queryFormatters"] 4 | from . import * 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Tutorials and Examples 2 | ============================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/pyJavaClasses/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | __all__ = ["customJavaClasses", "datastore", "FeatureTypes", "javaDateTime", "SimpleFeatureType"] 4 | from . import * 5 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/utils/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | __all__ = ["geomesa_command_line_parser", "geomesa_jnius_setup", "geomesa_plotting", "quickstart_command_line_parser"] 4 | #from . import * 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/src/main/resources/META-INF/services/org.locationtech.geomesa.security.AuthorizationsProvider: -------------------------------------------------------------------------------- 1 | org.geomesa.example.accumulo.auths.EmptyAuthorizationsProvider 2 | -------------------------------------------------------------------------------- /geomesa-tutorials-common/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Tutorials and Examples 2 | ============================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa HBase Tutorials and Examples 2 | ==================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Kafka Tutorials and Examples 2 | ==================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Redis Tutorials and Examples 2 | ==================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Accumulo Tutorials and Examples 2 | ======================================= 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa FileSystem Tutorials and Examples 2 | ========================================= 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Cassandra Tutorials and Examples 2 | ======================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/index.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-avro/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa HBase Avro Tutorial 2 | =========================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-avro.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-avro/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Redis Avro Tutorial 2 | =========================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-avro.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-avro/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa FileSystem Avro Tutorial 2 | ================================ 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-avro.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-avro/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Accumulo Avro Tutorial 2 | ============================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-avro.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-avro/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Cassandra Avro Tutorial 2 | =============================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-avro.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa HBase Quick-Start Tutorial 2 | ================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-hbase.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Kafka Quick-Start Tutorial 2 | ================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-kafka.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Redis Quick-Start Tutorial 2 | ================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-redis.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-transforms/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa HBase Transforms Tutorial 2 | ================================= 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-transformations.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-transforms/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Redis Transforms Tutorial 2 | ================================= 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-transformations.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa FileSystem Quick-Start Tutorial 2 | ======================================= 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-fsds.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-lambda-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Lambda Quick-Start Tutorial 2 | =================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-lambda.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Accumulo Quick-Start Tutorial 2 | ===================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-accumulo.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-transforms/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa FileSystem Transforms Tutorial 2 | ====================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-transformations.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-transforms/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Accumulo Transforms Tutorial 2 | ==================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-transformations.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Cassandra Quick-Start Tutorial 2 | ====================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-cassandra.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-transforms/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Cassandra Transforms Tutorial 2 | ===================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-transformations.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-streams-quickstart/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Kafka Streams Quick-Start Tutorial 2 | ================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-kafka-streams.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Accumulo Authorizations Tutorial 2 | ======================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-authorizations.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-quickstart-storm/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Storm Quick Start 2 | ============================ 3 | 4 | See the official GeoMesa [documentation](http://geomesa.org/documentation/tutorials) for instructions. 5 | 6 | * [GeoMesa Storm Quick Start](https://www.geomesa.org/documentation/stable/tutorials/geomesa-quickstart-storm.html) 7 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-feature-level-vis/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Accumulo Feature-Level Visibility Tutorial 2 | ================================================== 3 | 4 | See the official GeoMesa [documentation](http://www.geomesa.org/documentation/tutorials/geomesa-examples-featurelevelvis.html) for instructions. 5 | -------------------------------------------------------------------------------- /geomesa-examples-spark/README.md: -------------------------------------------------------------------------------- 1 | GeoMesa Spark Examples 2 | ====================== 3 | 4 | See the official GeoMesa [documentation](http://geomesa.org/documentation/tutorials) for instructions. 5 | 6 | * [CountByDay](http://geomesa.org/documentation/tutorials/spark) 7 | * [ShallowJoin](http://www.geomesa.org/documentation/tutorials/shallow-join) 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/zinc* 2 | build/scala* 3 | build/*.jar 4 | build/build.out 5 | *.iws 6 | *.ipr 7 | *.iml 8 | *.idea/ 9 | *.log 10 | .idea/** 11 | **/.classpath 12 | **/.project 13 | **/.settings 14 | target 15 | atlassian* 16 | geomesa-*.*.*-* 17 | **/src/main/resources/git.properties 18 | geomesa-quickstart-accumulo/src/main/java/com/example/geomesa/accumulo/AccumuloQuickStartRead.java 19 | *.pyc 20 | *.gz 21 | *.tar 22 | __pycache__ 23 | Patricia* 24 | patricia* 25 | .eric* 26 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/__init__.py: -------------------------------------------------------------------------------- 1 | #/*********************************************************************** 2 | #* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc. 3 | #* All rights reserved. This program and the accompanying materials 4 | #* are made available under the terms of the Apache License, Version 2.0 5 | #* which accompanies this distribution and is available at 6 | #* http://www.opensource.org/licenses/apache2.0.php. 7 | #*************************************************************************/ 8 | __all__ = ["pyJavaClasses", "tools", "utils"] 9 | from . import * 10 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-avro/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-avro/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-avro/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-transforms/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-transforms/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=warn 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-transforms/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-feature-level-vis/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.hsqldb.db=warn 10 | 11 | # log to stderr by default instead of std out 12 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 14 | log4j.appender.stdout.Target=System.out 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-avro/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.org.apache.redis=warn 10 | log4j.logger.hsqldb.db=warn 11 | 12 | # log to stderr by default instead of std out 13 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 14 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 15 | log4j.appender.stdout.Target=System.out 16 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.org.apache.redis=warn 10 | log4j.logger.hsqldb.db=warn 11 | 12 | # log to stderr by default instead of std out 13 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 14 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 15 | log4j.appender.stdout.Target=System.out 16 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-transforms/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=info 6 | log4j.logger.org.apache.zookeeper=warn 7 | log4j.logger.org.apache.curator=warn 8 | log4j.logger.org.apache.hadoop=warn 9 | log4j.logger.org.apache.redis=warn 10 | log4j.logger.hsqldb.db=warn 11 | 12 | # log to stderr by default instead of std out 13 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 14 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 15 | log4j.appender.stdout.Target=System.out 16 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-avro/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=warn 6 | log4j.logger.org.apache.parquet=warn 7 | log4j.logger.org.apache.orc=warn 8 | log4j.logger.org.apache.zookeeper=warn 9 | log4j.logger.org.apache.curator=warn 10 | log4j.logger.org.apache.hadoop=warn 11 | log4j.logger.hsqldb.db=warn 12 | 13 | # log to stderr by default instead of std out 14 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 15 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.stdout.Target=System.out 17 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=warn 6 | log4j.logger.org.apache.parquet=warn 7 | log4j.logger.org.apache.orc=warn 8 | log4j.logger.org.apache.zookeeper=warn 9 | log4j.logger.org.apache.curator=warn 10 | log4j.logger.org.apache.hadoop=warn 11 | log4j.logger.hsqldb.db=warn 12 | 13 | # log to stderr by default instead of std out 14 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 15 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.stdout.Target=System.out 17 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-transforms/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.org.locationtech.geomesa=warn 6 | log4j.logger.org.apache.parquet=warn 7 | log4j.logger.org.apache.orc=warn 8 | log4j.logger.org.apache.zookeeper=warn 9 | log4j.logger.org.apache.curator=warn 10 | log4j.logger.org.apache.hadoop=warn 11 | log4j.logger.hsqldb.db=warn 12 | 13 | # log to stderr by default instead of std out 14 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 15 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 16 | log4j.appender.stdout.Target=System.out 17 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-quickstart/src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | org.slf4j.simpleLogger.logFile=System.out 3 | org.slf4j.simpleLogger.showDateTime=true 4 | org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 5 | 6 | org.slf4j.simpleLogger.log.org.locationtech.geomesa=info 7 | 8 | # various libraries we want to lower the volume on 9 | org.slf4j.simpleLogger.log.org.apache.zookeeper=warn 10 | org.slf4j.simpleLogger.log.hsqldb.db=warn 11 | org.slf4j.simpleLogger.log.org.apache.curator=warn 12 | org.slf4j.simpleLogger.log.org.apache.hadoop=warn 13 | org.slf4j.simpleLogger.log.org.apache.parquet=warn 14 | org.slf4j.simpleLogger.log.org.apache.orc=warn 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.geomesa=info 6 | log4j.logger.org.locationtech.geomesa=info 7 | log4j.logger.org.apache.zookeeper=warn 8 | log4j.logger.org.apache.curator=warn 9 | log4j.logger.org.I0Itec.zkclient=warn 10 | log4j.logger.org.apache.kafka=warn 11 | log4j.logger.kafka=warn 12 | log4j.logger.org.apache.hadoop=warn 13 | log4j.logger.hsqldb.db=warn 14 | 15 | # log to stderr by default instead of std out 16 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 17 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 18 | log4j.appender.stdout.layout.ConversionPattern=%-5p %c: %m%n 19 | log4j.appender.stdout.Target=System.out -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-lambda-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | 6 | #log4j.logger.org.locationtech.geomesa.lambda=trace 7 | log4j.logger.geomesa=info 8 | log4j.logger.org.locationtech.geomesa=info 9 | log4j.logger.kafka=warn 10 | log4j.logger.org.apache.kafka=warn 11 | log4j.logger.org.I0Itec.zkclient=warn 12 | log4j.logger.org.apache.zookeeper=warn 13 | log4j.logger.org.apache.curator=warn 14 | log4j.logger.hsqldb.db=warn 15 | log4j.logger.org.apache.hadoop=warn 16 | 17 | # log to stderr by default instead of std out 18 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 19 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 20 | log4j.appender.stdout.Target=System.out -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/src/main/resources/geomesa-ldap.properties: -------------------------------------------------------------------------------- 1 | # ldap connection properties 2 | java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory 3 | java.naming.provider.url=ldap://localhost:10389 4 | java.naming.security.authentication=simple 5 | java.naming.security.principal=uid=admin,ou=system 6 | java.naming.security.credentials=secret 7 | 8 | # the ldap node to start the query from 9 | geomesa.ldap.search.root=o=Spring Framework 10 | # the query that will be applied to find the user's record 11 | # the '{}' will be replaced with the common name from the certificate the user has logged into geoserver with 12 | geomesa.ldap.search.filter=(&(objectClass=person)(cn={})) 13 | # the ldap attribute that holds the comma-delimited authorizations for the user 14 | geomesa.ldap.auths.attribute=employeeType 15 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-avro/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-transforms/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-avro/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-avro/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-avro/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-avro/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-transforms/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-transforms/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-transforms/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-transforms/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-streams-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-feature-level-vis/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-lambda-quickstart/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-5level [%thread] %date{ISO8601} %F:%L - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-streams-quickstart/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # log to stdout by default 2 | log4j.rootLogger=info, stdout 3 | 4 | # set logging levels to appropriate values 5 | log4j.logger.geomesa=info 6 | log4j.logger.org.locationtech.geomesa=info 7 | log4j.logger.org.apache.zookeeper=warn 8 | log4j.logger.org.apache.curator=warn 9 | log4j.logger.org.I0Itec.zkclient=warn 10 | log4j.logger.org.apache.kafka=warn 11 | log4j.logger.org.apache.kafka.clients=error 12 | log4j.logger.org.apache.kafka.streams.processor.internals=error 13 | log4j.logger.kafka=warn 14 | log4j.logger.org.apache.hadoop=warn 15 | log4j.logger.hsqldb.db=warn 16 | 17 | # log to stderr by default instead of std out 18 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 19 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 20 | log4j.appender.stdout.layout.ConversionPattern=%-5p %c: %m%n 21 | log4j.appender.stdout.Target=System.out -------------------------------------------------------------------------------- /.github/workflows/build-and-test.yml: -------------------------------------------------------------------------------- 1 | name: build-and-test 2 | 3 | on: 4 | push: 5 | pull_request: 6 | # run nightly to pick up any errors caused by changes in main geomesa 7 | schedule: 8 | - cron: '30 2 * * *' # 0230 UTC, 2130 EST 9 | 10 | jobs: 11 | build-scala: 12 | runs-on: ubuntu-latest 13 | # avoid duplicate jobs on PRs from the main repo 14 | if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-java@v3 19 | with: 20 | distribution: 'temurin' 21 | java-version: '8' 22 | cache: 'maven' 23 | - name: Build with Maven 24 | run: mvn clean install -B -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 25 | - name: Remove GeoMesa artifacts 26 | run: | 27 | rm -rf ~/.m2/repository/org/geomesa/example 28 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-avro/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.geomesa.example 7 | geomesa-tutorials-redis 8 | 5.5.0-SNAPSHOT 9 | 10 | 11 | geomesa-tutorials-redis-avro 12 | GeoMesa Tutorials - Redis - Avro 13 | 14 | 15 | 16 | org.geomesa.example 17 | geomesa-tutorials-common 18 | 19 | 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.geomesa.example 7 | geomesa-tutorials-fsds 8 | 5.5.0-SNAPSHOT 9 | 10 | 11 | geomesa-tutorials-fsds-quickstart 12 | GeoMesa Tutorials - FileSystem - Quick Start 13 | 14 | 15 | 16 | org.geomesa.example 17 | geomesa-tutorials-common 18 | 19 | 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.geomesa.example 7 | geomesa-tutorials-redis 8 | 5.5.0-SNAPSHOT 9 | 10 | 11 | geomesa-tutorials-redis-quickstart 12 | GeoMesa Tutorials - Redis - Quick Start 13 | 14 | 15 | 16 | org.geomesa.example 17 | geomesa-tutorials-common 18 | 19 | 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-transforms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.geomesa.example 7 | geomesa-tutorials-redis 8 | 5.5.0-SNAPSHOT 9 | 10 | 11 | geomesa-tutorials-redis-transforms 12 | GeoMesa Tutorials - Redis - Transforms 13 | 14 | 15 | 16 | org.geomesa.example 17 | geomesa-tutorials-common 18 | 19 | 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/src/main/java/org/geomesa/example/accumulo/auths/EmptyAuthorizationsProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.accumulo.auths; 10 | 11 | import org.apache.accumulo.core.security.Authorizations; 12 | import org.locationtech.geomesa.security.AuthorizationsProvider; 13 | 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | /** 19 | * Implementation of auth provider that always returns empty auths 20 | */ 21 | public class EmptyAuthorizationsProvider implements AuthorizationsProvider { 22 | 23 | public List getAuthorizations() { 24 | List authList = new ArrayList<>(); 25 | authList.add(new Authorizations().toString()); 26 | return authList; 27 | } 28 | 29 | public void configure(Map params) { 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-avro/src/main/java/org/geomesa/example/hbase/avro/HBaseAvroTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.hbase.avro; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.avro.GeoMesaAvroTutorial; 13 | import org.locationtech.geomesa.hbase.data.HBaseDataStoreFactory; 14 | 15 | public class HBaseAvroTutorial extends GeoMesaAvroTutorial { 16 | 17 | public HBaseAvroTutorial(String[] args) throws ParseException { 18 | super(args, new HBaseDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new HBaseAvroTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-avro/src/main/java/org/geomesa/example/redis/avro/RedisAvroTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.redis.avro; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.avro.GeoMesaAvroTutorial; 13 | import org.locationtech.geomesa.redis.data.RedisDataStoreFactory; 14 | 15 | public class RedisAvroTutorial extends GeoMesaAvroTutorial { 16 | 17 | public RedisAvroTutorial(String[] args) throws ParseException { 18 | super(args, new RedisDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new RedisAvroTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-avro/src/main/java/org/geomesa/example/fsds/avro/FileSystemAvroTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.fsds.avro; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.avro.GeoMesaAvroTutorial; 13 | import org.locationtech.geomesa.fs.data.FileSystemDataStoreFactory; 14 | 15 | public class FileSystemAvroTutorial extends GeoMesaAvroTutorial { 16 | 17 | public FileSystemAvroTutorial(String[] args) throws ParseException { 18 | super(args, new FileSystemDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new FileSystemAvroTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-avro/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-accumulo 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-accumulo-avro 19 | GeoMesa Tutorials - Accumulo - Avro 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-avro/src/main/java/org/geomesa/example/accumulo/avro/AccumuloAvroTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.accumulo.avro; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.avro.GeoMesaAvroTutorial; 13 | import org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory; 14 | 15 | public class AccumuloAvroTutorial extends GeoMesaAvroTutorial { 16 | 17 | public AccumuloAvroTutorial(String[] args) throws ParseException { 18 | super(args, new AccumuloDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new AccumuloAvroTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-avro/src/main/java/org/geomesa/example/cassandra/avro/CassandraAvroTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.cassandra.avro; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.avro.GeoMesaAvroTutorial; 13 | import org.locationtech.geomesa.cassandra.data.CassandraDataStoreFactory; 14 | 15 | public class CassandraAvroTutorial extends GeoMesaAvroTutorial { 16 | 17 | public CassandraAvroTutorial(String[] args) throws ParseException { 18 | super(args, new CassandraDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new CassandraAvroTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-transforms/src/main/java/org/geomesa/example/hbase/transformations/HBaseQueryTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.hbase.transformations; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.transformations.GeoMesaQueryTutorial; 13 | import org.locationtech.geomesa.hbase.data.HBaseDataStoreFactory; 14 | 15 | public class HBaseQueryTutorial extends GeoMesaQueryTutorial { 16 | 17 | public HBaseQueryTutorial(String[] args) throws ParseException { 18 | super(args, new HBaseDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new HBaseQueryTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-transforms/src/main/java/org/geomesa/example/redis/transformations/RedisQueryTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.redis.transformations; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.transformations.GeoMesaQueryTutorial; 13 | import org.locationtech.geomesa.redis.data.RedisDataStoreFactory; 14 | 15 | public class RedisQueryTutorial extends GeoMesaQueryTutorial { 16 | 17 | public RedisQueryTutorial(String[] args) throws ParseException { 18 | super(args, new RedisDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new RedisQueryTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-transforms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-accumulo 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-accumulo-transforms 19 | GeoMesa Tutorials - Accumulo - Transforms 20 | 21 | 22 | 23 | 24 | org.apache.maven.plugins 25 | maven-shade-plugin 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-transforms/src/main/java/org/geomesa/example/fsds/transformations/FileSystemQueryTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.fsds.transformations; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.transformations.GeoMesaQueryTutorial; 13 | import org.locationtech.geomesa.fs.data.FileSystemDataStoreFactory; 14 | 15 | public class FileSystemQueryTutorial extends GeoMesaQueryTutorial { 16 | 17 | public FileSystemQueryTutorial(String[] args) throws ParseException { 18 | super(args, new FileSystemDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new FileSystemQueryTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-feature-level-vis/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials-accumulo 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-accumulo-feature-level-vis 20 | GeoMesa Tutorials - Accumulo - Feature-Level Vis 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-shade-plugin 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-transforms/src/main/java/org/geomesa/example/accumulo/transformations/AccumuloQueryTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.accumulo.transformations; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.transformations.GeoMesaQueryTutorial; 13 | import org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory; 14 | 15 | public class AccumuloQueryTutorial extends GeoMesaQueryTutorial { 16 | 17 | public AccumuloQueryTutorial(String[] args) throws ParseException { 18 | super(args, new AccumuloDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new AccumuloQueryTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart/src/main/java/org/geomesa/example/hbase/HBaseQuickStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.hbase; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.data.GDELTData; 13 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 14 | import org.locationtech.geomesa.hbase.data.HBaseDataStoreFactory; 15 | 16 | public class HBaseQuickStart extends GeoMesaQuickStart { 17 | 18 | // uses gdelt data 19 | public HBaseQuickStart(String[] args) throws ParseException { 20 | super(args, new HBaseDataStoreFactory().getParametersInfo(), new GDELTData()); 21 | } 22 | 23 | public static void main(String[] args) { 24 | try { 25 | new HBaseQuickStart(args).run(); 26 | } catch (ParseException e) { 27 | System.exit(1); 28 | } catch (Throwable e) { 29 | e.printStackTrace(); 30 | System.exit(2); 31 | } 32 | System.exit(0); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geomesa-tutorials-redis/geomesa-tutorials-redis-quickstart/src/main/java/org/geomesa/example/redis/RedisQuickStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.redis; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.data.GDELTData; 13 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 14 | import org.locationtech.geomesa.redis.data.RedisDataStoreFactory; 15 | 16 | public class RedisQuickStart extends GeoMesaQuickStart { 17 | 18 | // uses gdelt data 19 | public RedisQuickStart(String[] args) throws ParseException { 20 | super(args, new RedisDataStoreFactory().getParametersInfo(), new GDELTData()); 21 | } 22 | 23 | public static void main(String[] args) { 24 | try { 25 | new RedisQuickStart(args).run(); 26 | } catch (ParseException e) { 27 | System.exit(1); 28 | } catch (Throwable e) { 29 | e.printStackTrace(); 30 | System.exit(2); 31 | } 32 | System.exit(0); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-transforms/src/main/java/org/geomesa/example/cassandra/transformations/CassandraQueryTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.cassandra.transformations; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.transformations.GeoMesaQueryTutorial; 13 | import org.locationtech.geomesa.cassandra.data.CassandraDataStoreFactory; 14 | 15 | public class CassandraQueryTutorial extends GeoMesaQueryTutorial { 16 | 17 | public CassandraQueryTutorial(String[] args) throws ParseException { 18 | super(args, new CassandraDataStoreFactory().getParametersInfo()); 19 | } 20 | 21 | public static void main(String[] args) { 22 | try { 23 | new CassandraQueryTutorial(args).run(); 24 | } catch (ParseException e) { 25 | System.exit(1); 26 | } catch (Throwable e) { 27 | e.printStackTrace(); 28 | System.exit(2); 29 | } 30 | System.exit(0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-quickstart/src/main/java/org/geomesa/example/accumulo/AccumuloQuickStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.accumulo; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.data.GDELTData; 13 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 14 | import org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory; 15 | 16 | public class AccumuloQuickStart extends GeoMesaQuickStart { 17 | 18 | // uses gdelt data 19 | public AccumuloQuickStart(String[] args) throws ParseException { 20 | super(args, new AccumuloDataStoreFactory().getParametersInfo(), new GDELTData()); 21 | } 22 | 23 | public static void main(String[] args) { 24 | try { 25 | new AccumuloQuickStart(args).run(); 26 | } catch (ParseException e) { 27 | System.exit(1); 28 | } catch (Throwable e) { 29 | e.printStackTrace(); 30 | System.exit(2); 31 | } 32 | System.exit(0); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-quickstart/src/main/java/org/geomesa/example/cassandra/CassandraQuickStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.cassandra; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.data.GDELTData; 13 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 14 | import org.locationtech.geomesa.cassandra.data.CassandraDataStoreFactory; 15 | 16 | public class CassandraQuickStart extends GeoMesaQuickStart { 17 | 18 | // uses gdelt data 19 | public CassandraQuickStart(String[] args) throws ParseException { 20 | super(args, new CassandraDataStoreFactory().getParametersInfo(), new GDELTData()); 21 | } 22 | 23 | public static void main(String[] args) { 24 | try { 25 | new CassandraQuickStart(args).run(); 26 | } catch (ParseException e) { 27 | System.exit(1); 28 | } catch (Throwable e) { 29 | e.printStackTrace(); 30 | System.exit(2); 31 | } 32 | System.exit(0); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/pyJavaClasses/javaDateTime.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | javaDateTime.py 5 | 6 | Description: 7 | This function takes a python datetime object with optional timezone information, translates 8 | it into a java datetime object (using jnius) and returns the java datetime object. 9 | 10 | Created by: Jordan Muss 11 | 12 | Creation Date: 4-6-2017 13 | Version: 1.0 14 | 15 | Dependencies: 16 | Public: datetime, jnius 17 | Private: SetupJnius 18 | 19 | Updates: 20 | 21 | To Do: 22 | """ 23 | from datetime import datetime 24 | 25 | def pyDateTimeToJava(JNI, dateTime, tz=None): 26 | if not isinstance(dateTime, datetime): 27 | print("Error: dateTime ({}) must be a python datetime object, not {}".format(dateTime, type(dateTime))) 28 | return None 29 | jDate = JNI.autoclass('org.joda.time.DateTime') 30 | jDTZ = JNI.autoclass("org.joda.time.DateTimeZone") 31 | 32 | jTZ = None 33 | if tz is not None: 34 | try: 35 | jTZ = jDTZ.forID(tz.upper()) 36 | except: 37 | print("Warning: error setting the time zone info for {}; timezone will be ignored".format(tz)) 38 | if jTZ is not None: 39 | dtTm = jDate(dateTime.year, dateTime.month, dateTime.day, dateTime.hour, dateTime.minute, dateTime.second, jTZ) 40 | else: 41 | dtTm = jDate(dateTime.year, dateTime.month, dateTime.day, dateTime.hour, dateTime.minute, dateTime.second) 42 | return dtTm 43 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-streams-quickstart/src/main/java/org/geomesa/example/kafka/GeoPartitioner.java: -------------------------------------------------------------------------------- 1 | package org.geomesa.example.kafka; 2 | 3 | import org.apache.kafka.streams.kstream.KeyValueMapper; 4 | import org.locationtech.geomesa.curve.Z2SFC; 5 | import org.locationtech.geomesa.kafka.streams.GeoMesaMessage; 6 | import org.locationtech.geomesa.utils.geohash.GeohashUtils; 7 | import org.locationtech.jts.geom.Geometry; 8 | import org.locationtech.jts.geom.Point; 9 | 10 | import java.util.List; 11 | 12 | class GeoPartitioner implements KeyValueMapper { 13 | 14 | private final Short partitionNumBits; 15 | private final Integer defaultGeomIndex; 16 | private final Z2SFC z2; 17 | 18 | public GeoPartitioner(Short partitionNumBits, Integer defaultGeomIndex) { 19 | this.partitionNumBits = partitionNumBits; 20 | this.defaultGeomIndex = defaultGeomIndex; 21 | this.z2 = new Z2SFC(partitionNumBits / 2); 22 | } 23 | 24 | private String getZBin(Geometry geom) { 25 | Point safeGeom = GeohashUtils.getInternationalDateLineSafeGeometry(geom).get().getCentroid(); 26 | Long index = z2.index(safeGeom.getX(), safeGeom.getY(), false); 27 | return String.format("%0" + partitionNumBits + "d", index); 28 | } 29 | 30 | @Override 31 | public String apply(String key, GeoMesaMessage value) { 32 | List attributes = value.asJava(); 33 | Geometry geom = (Geometry) attributes.get(defaultGeomIndex); 34 | return getZBin(geom); 35 | } 36 | } -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-avro/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-fsds 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-fsds-avro 19 | GeoMesa Tutorials - FileSystem - Avro 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-avro/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-hbase 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-hbase-avro 19 | GeoMesa Tutorials - HBase - Avro 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-transforms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-fsds 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-fsds-transforms 19 | GeoMesa Tutorials - FileSystem - Transforms 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-hbase 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-hbase-quickstart 19 | GeoMesa Tutorials - HBase - Quick Start 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-tutorials-hbase/geomesa-tutorials-hbase-transforms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-hbase 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-hbase-transforms 19 | GeoMesa Tutorials - HBase - Transforms 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-avro/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-cassandra 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-cassandra-avro 19 | GeoMesa Tutorials - Cassandra - Avro 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-transforms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-cassandra 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-cassandra-transforms 19 | GeoMesa Tutorials - Cassandra - Transforms 20 | 21 | 22 | 23 | org.geomesa.example 24 | geomesa-tutorials-common 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.apache.maven.plugins 32 | maven-shade-plugin 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/pyJavaClasses/SimpleFeatureType.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | SimpleFeatureType.py 5 | 6 | Description: 7 | This function uses jnius to implement various features from the SimpleFeatureType(s) 8 | java classes. 9 | 10 | Created by: Jordan Muss 11 | 12 | Creation Date: 4-4-2017 13 | Version: 1.0 14 | 15 | Dependencies: 16 | Public: jnius 17 | Private: SetupJnius 18 | 19 | Interfaces: 20 | createSimpleFeatureType Class to create a 'bare' SimpleFeatureType from a list of attributes, 21 | and to perform appropriate tasks, e.g. set feature indices 22 | 23 | Updates: 24 | 25 | To Do: 26 | """ 27 | class SimpleFeatureType(): 28 | def __init__(self, JNI): 29 | """ Create the necessary java class interfaces: """ 30 | self.SimpleFeatureTypes = JNI.autoclass("org.locationtech.geomesa.utils.interop.SimpleFeatureTypes") 31 | 32 | def createSimpleFeatureType(self, simpleFeatureTypeName, attribute_list): 33 | """ This will create a 'bare' simpleFeatureType from a list of attributes: """ 34 | attributes = ','.join(attribute_list) 35 | simpleFeatureType = self.SimpleFeatureTypes.createType(simpleFeatureTypeName, attributes) 36 | return simpleFeatureType 37 | 38 | def setDateTimeIndex(self, simpleFeature, field_name): 39 | """ use the user-data (hints) to specify which date-time field is meant to be indexed: """ 40 | simpleFeature.getUserData().put(self.SimpleFeatureTypes.DEFAULT_DATE_KEY, field_name) 41 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials-accumulo 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-accumulo-authorizations 19 | GeoMesa Tutorials - Accumulo - Authorizations 20 | 21 | 22 | 23 | org.geotools 24 | gt-wfs-ng 25 | ${gt.version} 26 | 27 | 28 | org.springframework.security 29 | spring-security-core 30 | 3.1.0.RELEASE 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-shade-plugin 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-lambda-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | org.geomesa.example 13 | geomesa-tutorials-accumulo 14 | 5.5.0-SNAPSHOT 15 | 16 | 4.0.0 17 | 18 | geomesa-tutorials-accumulo-lambda-quickstart 19 | GeoMesa Tutorials - Accumulo - Lambda Quick Start 20 | 21 | 22 | 23 | org.locationtech.geomesa 24 | geomesa-lambda-datastore_${scala.abi.version} 25 | ${geomesa.version} 26 | 27 | 28 | org.apache.kafka 29 | kafka_${scala.abi.version} 30 | ${kafka.version} 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-shade-plugin 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/utils/quickstart_command_line_parser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | quickstart_command_line_parser.py 5 | 6 | Description: 7 | This is extends the basic PyMesa command line parser to run the quickstart demo. 8 | 9 | Created by: Jordan Muss 10 | 11 | Creation Date: 3-30-2017 12 | Version: 1.0 13 | 14 | Dependencies: 15 | Public: argparse 16 | Private: geomesa_command_line_parser 17 | 18 | Updates: 19 | 20 | To Do: 21 | 22 | import os 23 | def pathExpander(path): 24 | if ('~' in path): 25 | return os.path.expanduser(path) 26 | else: 27 | return os.path.abspath(path) 28 | out_dir = os.path.expanduser('~/Documents/Code/geomesa/') 29 | 30 | """ 31 | '''----------------------------------------------------------------------------------------------------------------------''' 32 | ''' Get the runtime options: ''' 33 | '''----------------------------------------------------------------------------------------------------------------------''' 34 | from .geomesa_command_line_parser import GeoMesaParser 35 | 36 | def getArgs(): 37 | argParser = GeoMesaParser() 38 | argParser.description = "{} with the quickstart demo using python & jnius.".format(argParser.description) 39 | argParser.add_argument("--no_print", "--no_quick", default=False, action="store_true", 40 | help="don't run the basic quickstart canned query, which returns nine rows of data (the default is to run it).") 41 | argParser.add_argument("--plot", "--graph", "-g", default=False, action="store_true", 42 | help="get all values from the 'quickstart' table and plot the points in a browser window.") 43 | argParser.add_argument("--out_dir", "--out", "-o", default=None, 44 | help="directory in which the plotting html will be saved.") 45 | 46 | return argParser.parse_args() 47 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-authorizations/src/main/java/org/geomesa/example/accumulo/auths/LdapAuthorizationsProviderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.accumulo.auths; 10 | 11 | import org.springframework.security.authentication.TestingAuthenticationToken; 12 | import org.springframework.security.core.context.SecurityContextHolder; 13 | 14 | import java.io.Serializable; 15 | import java.util.HashMap; 16 | import java.util.List; 17 | 18 | /** 19 | * Integration test for connecting to LDAP for authorizations 20 | */ 21 | public class LdapAuthorizationsProviderTest { 22 | 23 | public static void main(String[] args) { 24 | String user = null; 25 | if (args != null && args.length > 0) { 26 | user = args[0]; 27 | } 28 | 29 | if (user == null || user.isEmpty()) { 30 | user = "rod"; 31 | } 32 | 33 | // create the provider and initialize it with the 'configure' method 34 | LdapAuthorizationsProvider provider = new LdapAuthorizationsProvider(); 35 | provider.configure(new HashMap()); 36 | 37 | // set dummy authentication token corresponding to user 'rod' 38 | SecurityContextHolder.getContext().setAuthentication(new TestingAuthenticationToken(user, null)); 39 | 40 | System.out.println("Checking auths from LDAP for user '" + user + "'"); 41 | 42 | // get the authorizations - this will connect to ldap using the values in geomesa-ldap.properties 43 | List auths = provider.getAuthorizations(); 44 | 45 | System.out.println("Retrieved auths: " + auths); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/utils/geomesa_command_line_parser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | geomesa_command_line_parser.py 5 | 6 | Description: 7 | This is a basic class to parse command line arguments for PyMesa. It will be 8 | extended by other calls as needed. 9 | 10 | Created by: Jordan Muss 11 | 12 | Creation Date: 3-30-2017 13 | Version: 1.0 14 | 15 | Dependencies: 16 | Public: argparse 17 | Private: 18 | 19 | Updates: 20 | 21 | To Do: 22 | """ 23 | import argparse 24 | 25 | class GeoMesaParser(argparse.ArgumentParser): 26 | def __init__(self, argument_default=argparse.SUPPRESS): 27 | """ 28 | :GeoMesaParser. 29 | """ 30 | super(GeoMesaParser,self).__init__(add_help=True, argument_default=argument_default) 31 | self.add_argument("--instanceId", "--instId", "--inst", "-i", default="local", 32 | help="the name of your Accumulo instance (default=local)") 33 | self.add_argument("--zookeepers", "--zoo", "-z", default="localhost", 34 | help="your Zookeeper nodes, separated by commas (default=localhost)") 35 | self.add_argument("--user", "-u", default="root", 36 | help="the name of an Accumulo user that has permissions to create, read and write tables (default=root)") 37 | self.add_argument("--password", "--pwd", "--pw", default="secret", 38 | help="the password for the previously-mentioned Accumulo user (default=secret)") 39 | self.add_argument("--tableName", "--tableNm", "--table", "--tbl", "-t", default="quickstart", 40 | help="the name of the on which to operate. This table will be created if it does not exist (default=quickstart)") 41 | self.add_argument("--classpath", "--cp", type=str, default=None, 42 | help="set the GeoMesa-Accumulo java classpath (default=None; use the classpath set in the os environment") 43 | 44 | self.description = "Run PyGeoMesa command line tools" 45 | -------------------------------------------------------------------------------- /geomesa-tutorials-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-common 20 | GeoMesa Tutorials - Common 21 | 22 | 23 | 24 | org.locationtech.geomesa 25 | geomesa-utils_${scala.abi.version} 26 | 27 | 28 | org.locationtech.geomesa 29 | geomesa-index-api_${scala.abi.version} 30 | 31 | 32 | org.locationtech.geomesa 33 | geomesa-feature-avro_${scala.abi.version} 34 | 35 | 36 | commons-cli 37 | commons-cli 38 | 39 | 40 | org.slf4j 41 | slf4j-reload4j 42 | 43 | 44 | ch.qos.reload4j 45 | reload4j 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/pyJavaClasses/customJavaClasses.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | customJavaClasses.py 5 | 6 | Description: 7 | These functions & classes create custom versions of java classes for python using 8 | jnius. 9 | 10 | Created by: Jordan Muss 11 | 12 | Creation Date: 4-5-2017 13 | Version: 1.0 14 | 15 | Dependencies: 16 | Public: jnius, sys 17 | Private: SetupJnius 18 | 19 | Interfaces: 20 | createSimpleFeatureType Function with a class to create a 'bare' SimpleFeatureType from a list 21 | of attributes, and to perform appropriate tasks, e.g. set feature indices 22 | 23 | Updates: 24 | 25 | To Do: 26 | """ 27 | import sys 28 | 29 | def getJavaTrueFalse(JNI, pyBool): 30 | ''' This function reflects the Java Boolean class and returns a True/False 31 | request as a java object. ''' 32 | BoolDict = {"true":True, 33 | "yes":True, 34 | "false":False, 35 | "no":False 36 | } 37 | class Boolean(JNI.JavaClass): 38 | __javaclass__ = 'java/lang/Object' 39 | __metaclass__ = JNI.MetaJavaClass 40 | TRUE = JNI.JavaObject('()Zjava/lang/Object;', static=True) 41 | FALSE = JNI.JavaObject('()Zjava/lang/Object;', static=True) 42 | 43 | if isinstance(pyBool, str): 44 | boolVal = BoolDict.get(pyBool.lower(), None) 45 | if not isinstance(boolVal, bool): 46 | print("Error:bad value passed to 'getJavaTrueFalse'; {} must be in str(true, false, yes, no).".format(pyBool)) 47 | sys.exit(-1) 48 | elif isinstance(pyBool, bool): 49 | boolVal = pyBool 50 | else: 51 | print("Error:bad value passed to 'getJavaTrueFalse'; {} must be type bool or in str(true, false, yes, no).".format(pyBool)) 52 | sys.exit(-1) 53 | jBool = Boolean() 54 | if boolVal: 55 | jBoolVal = jBool.TRUE 56 | else: 57 | jBoolVal = jBool.FALSE 58 | return jBoolVal 59 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-streams-quickstart/src/main/java/org/geomesa/example/kafka/Proximity.java: -------------------------------------------------------------------------------- 1 | package org.geomesa.example.kafka; 2 | 3 | import org.geotools.referencing.GeodeticCalculator; 4 | import org.locationtech.geomesa.kafka.streams.GeoMesaMessage; 5 | import org.locationtech.jts.geom.Geometry; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Objects; 10 | import java.util.UUID; 11 | 12 | public class Proximity { 13 | GeoMesaMessage message1; 14 | GeoMesaMessage message2; 15 | Integer defaultGeomIndex; 16 | GeodeticCalculator gc; 17 | 18 | public Proximity(GeoMesaMessage message1, GeoMesaMessage message2, Integer defaultGeomIndex) { 19 | this.message1 = message1; 20 | this.message2 = message2; 21 | this.defaultGeomIndex = defaultGeomIndex; 22 | this.gc = new GeodeticCalculator(); 23 | } 24 | 25 | public Double getDistance() { 26 | Geometry geom1 = (Geometry) message1.attributes().apply(defaultGeomIndex); 27 | Geometry geom2 = (Geometry) message2.attributes().apply(defaultGeomIndex); 28 | gc.setStartingGeographicPoint(geom1.getCoordinate().x, geom1.getCoordinate().y); 29 | gc.setDestinationGeographicPoint(geom2.getCoordinate().x, geom2.getCoordinate().y); 30 | return gc.getOrthodromicDistance(); 31 | } 32 | 33 | private String getFID(GeoMesaMessage message) { 34 | return message.attributes().apply(0).toString(); 35 | } 36 | 37 | public GeoMesaMessage toGeoMesaMessage() { 38 | List attributes = new ArrayList<>(); 39 | attributes.add("proximity-" + getFID(message1) + "-" + getFID(message2)); 40 | attributes.add(message1.attributes().apply(1)); 41 | attributes.add(message1.attributes().apply(defaultGeomIndex)); 42 | return GeoMesaMessage.upsert(attributes); 43 | } 44 | 45 | public Boolean areDifferent() { 46 | return !Objects.equals(getFID(message1), getFID(message2)); 47 | } 48 | 49 | public Boolean areNotProximities() { 50 | return !getFID(message1).startsWith("proximity") && !getFID(message2).startsWith("proximity"); 51 | } 52 | } -------------------------------------------------------------------------------- /geomesa-tutorials-redis/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | org.geomesa.example 7 | geomesa-tutorials 8 | 5.5.0-SNAPSHOT 9 | 10 | 11 | geomesa-tutorials-redis 12 | GeoMesa Tutorials - Redis 13 | pom 14 | 15 | 16 | geomesa-tutorials-redis-avro 17 | geomesa-tutorials-redis-transforms 18 | geomesa-tutorials-redis-quickstart 19 | 20 | 21 | 22 | 23 | 24 | com.google.guava 25 | guava 26 | 27.0-jre 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.locationtech.geomesa 34 | geomesa-redis-datastore_${scala.abi.version} 35 | 36 | 37 | 38 | org.geotools 39 | gt-main 40 | 41 | 42 | org.geotools 43 | gt-epsg-hsql 44 | 45 | 46 | 47 | org.slf4j 48 | slf4j-reload4j 49 | 50 | 51 | ch.qos.reload4j 52 | reload4j 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/pyJavaClasses/FeatureTypes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | FeatureTypes.py 5 | 6 | Description: 7 | This function uses jnius to implement various features from the SimpleFeatureType(s) 8 | java classes. 9 | 10 | Created by: Jordan Muss 11 | 12 | Creation Date: 4-4-2017 13 | Version: 1.0 14 | 15 | Dependencies: 16 | Public: jnius 17 | Private: setupJnius 18 | 19 | Interfaces: 20 | createSimpleFeatureType Class to create a 'bare' SimpleFeatureType from a list of attributes, 21 | and to perform appropriate tasks, e.g. set feature indices 22 | 23 | Updates: 24 | 25 | To Do: 26 | """ 27 | from .customJavaClasses import getJavaTrueFalse 28 | 29 | class SimpleFeatureType(): 30 | def __init__(self, JNI): 31 | """ Create the necessary java class interfaces: """ 32 | self.SimpleFeatureTypes = JNI.autoclass("org.locationtech.geomesa.utils.interop.SimpleFeatureTypes") 33 | self.SimpleFeatureBuilder = JNI.autoclass("org.geotools.feature.simple.SimpleFeatureBuilder") 34 | self.Hints = JNI.autoclass("org.geotools.factory.Hints") 35 | self.simpleFeature = None 36 | self.true = getJavaTrueFalse(JNI, True) 37 | 38 | def createSimpleFeatureType(self, simpleFeatureTypeName, attribute_list): 39 | """ This will create a 'bare' SimpleFeatureType from a list of attributes: """ 40 | attributes = ','.join(attribute_list) 41 | self.simpleFeature = self.SimpleFeatureTypes.createType(simpleFeatureTypeName, attributes) 42 | 43 | def setDateTimeIndex(self, field_name): 44 | """ Use the user-data (hints) to specify which date-time field is meant to be indexed: """ 45 | if self.simpleFeature is None: 46 | print("You must create a simple feature type before you can set an index") 47 | index_set = False 48 | else: 49 | self.simpleFeature.getUserData().put(self.SimpleFeatureTypes.DEFAULT_DATE_KEY, field_name) 50 | index_set = True 51 | return index_set 52 | 53 | def build(self, feature_shell, id): 54 | """ Create a new (unique) identifier and empty feature shell: """ 55 | feature_builder = self.SimpleFeatureBuilder.build(self.simpleFeature, feature_shell, id) 56 | """ Explicitly tell GeoTools to use the provided ID: """ 57 | feature_builder.getUserData().put(self.Hints.USE_PROVIDED_FID, self.true) 58 | return feature_builder 59 | -------------------------------------------------------------------------------- /geomesa-tutorials-common/src/main/java/org/geomesa/example/quickstart/CommandLineDataStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.quickstart; 10 | 11 | import org.apache.commons.cli.CommandLine; 12 | import org.apache.commons.cli.DefaultParser; 13 | import org.apache.commons.cli.HelpFormatter; 14 | import org.apache.commons.cli.Option; 15 | import org.apache.commons.cli.Options; 16 | import org.apache.commons.cli.ParseException; 17 | import org.geotools.api.data.DataAccessFactory.Param; 18 | 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | 22 | public class CommandLineDataStore { 23 | 24 | private CommandLineDataStore() {} 25 | 26 | public static Options createOptions(Param[] parameters) { 27 | Options options = new Options(); 28 | for (Param p: parameters) { 29 | if (!p.isDeprecated()) { 30 | Option opt = Option.builder(null) 31 | .longOpt(p.getName()) 32 | .argName(p.getName()) 33 | .hasArg() 34 | .desc(p.getDescription().toString()) 35 | .required(p.isRequired()) 36 | .build(); 37 | options.addOption(opt); 38 | } 39 | } 40 | return options; 41 | } 42 | 43 | public static CommandLine parseArgs(Class caller, Options options, String[] args) throws ParseException { 44 | try { 45 | return new DefaultParser().parse(options, args); 46 | } catch (ParseException e) { 47 | System.err.println(e.getMessage()); 48 | HelpFormatter formatter = new HelpFormatter(); 49 | formatter.printHelp(caller.getName(), options); 50 | throw e; 51 | } 52 | } 53 | 54 | public static Map getDataStoreParams(CommandLine command, Options options) { 55 | Map params = new HashMap<>(); 56 | for (Option opt: options.getOptions()) { 57 | String value = command.getOptionValue(opt.getLongOpt()); 58 | if (value != null) { 59 | params.put(opt.getArgName(), value); 60 | } 61 | } 62 | 63 | return params; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/pyJavaClasses/datastore.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | datastore.py 5 | 6 | Description: 7 | This function uses jnius and a parameter map to open a GeoMesa datastore. It 8 | returns the a DataStore java object, which is used to access the GeoMesa data. 9 | It also includes functions to get information about the contents of a DataStore. 10 | 11 | Created by: Jordan Muss 12 | 13 | Creation Date: 3-31-2017 14 | Version: 1.0 15 | 16 | Dependencies: 17 | Public: jnius 18 | Private: SetupJnius 19 | 20 | Updates: 21 | 4-6-2017 getTableFields Added functionality to get data type for fields 22 | 23 | To Do: 24 | """ 25 | def getDataStore(JNI, dbConf): 26 | ''' This function reflects the Java DataStoreFinder class to get a datastore from 27 | a mapping of database parameters. ''' 28 | class DataStoreFinder(JNI.JavaClass): 29 | __javaclass__ = "org/geotools/data/DataStoreFinder" 30 | __metaclass__ = JNI.MetaJavaClass 31 | getDataStore = JNI.JavaMethod('(Ljava/util/Map;)Lorg/geotools/data/DataStore;', static=True) 32 | 33 | return DataStoreFinder.getDataStore(dbConf) 34 | 35 | def createAccumuloDBConf(JNI, conf_dict): 36 | ''' Create a DataStore config map (java hashmap using jnius) from a dict of parameters. ''' 37 | jMap = JNI.autoclass('java.util.HashMap') 38 | dsConf = jMap() 39 | for key, value in conf_dict.items(): 40 | dsConf.put(key, value) 41 | return dsConf 42 | 43 | def getTableNames(dataStore): 44 | ''' Return a list of Feature (type) names: ''' 45 | return dataStore.getTypeNames() 46 | 47 | def getTableFields(dataStore, feature): 48 | ''' Return a dict with keys=feature field names, and values=basic feature descriptions: ''' 49 | schema = dataStore.getSchema(feature) 50 | field_dict = {} 51 | for field in schema.descriptors.toArray(): 52 | name = field.localName 53 | descriptor = field.toString() 54 | data_type = descriptor.split("{}:".format(name))[1].split(">")[0] 55 | field_dict[name] = {'type':data_type, 56 | 'default':field.defaultValue, 57 | 'isNillable':field.isNillable(), 58 | 'descriptor':descriptor} 59 | return field_dict 60 | 61 | def deleteTable(dataStore, tablename): 62 | ''' Drop a table (feature) from an GeoMesa Accumulo database (table): ''' 63 | print("Warning:dropping {} from {}; this action cannot be reversed; all data will be lost!") 64 | dataStore.removeSchema(tablename) 65 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/PyMesa.e4p: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | en_US 8 | 5d58e60dfec0c1cc036dfb496e10ccb749ab8726 9 | Python2 10 | Console 11 | This project comprises tools and tutorials that provide GeoMesa functionality to python users. Although it is written for Python2, these tools should also run with python 3.5, unless otherwise noted. 12 | 0.1 13 | Jordan Muss 14 | 15 | 16 | 17 | __init__.py 18 | geomesa_quickstart_jnius.py 19 | patricia.py 20 | pyJavaClasses/FeatureTypes.py 21 | pyJavaClasses/SimpleFeatureType.py 22 | pyJavaClasses/__init__.py 23 | pyJavaClasses/customJavaClasses.py 24 | pyJavaClasses/datastore.py 25 | pyJavaClasses/javaDateTime.py 26 | tools/ECQL/__init__.py 27 | tools/ECQL/filter.py 28 | tools/ECQL/queryFormatters.py 29 | tools/__init__.py 30 | tools/dbModify/__init__.py 31 | tools/dbModify/insert.py 32 | utils/__init__.py 33 | utils/geomesa_command_line_parser.py 34 | utils/geomesa_jnius_setup.py 35 | utils/quickstart_command_line_parser.py 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | None 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/tools/dbModify/insert.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | insert.py 5 | 6 | Description: 7 | These functions prepare data and insert them into Accumulo tables (GeoMesa SimpleFeatures). 8 | 9 | Created by: Jordan Muss 10 | 11 | Creation Date: 4-12-2017 12 | Version: 1.0 13 | 14 | Dependencies: 15 | Public: jnius, json 16 | Private: ECQL, SetupJnius 17 | 18 | Interfaces: 19 | queryFeaturesToDict something 20 | more 21 | 22 | Updates: 23 | 24 | To Do: 25 | """ 26 | from __future__ import print_function 27 | 28 | def insert(JNI, ecql, simpleFeatureTypeName, dataStore, filter_string, field_dict, print_num=10): 29 | ''' Insert data into an Accumulo simpleFeatureType (table): ''' 30 | jLong = JNI.autoclass('java.lang.Long') 31 | WKTUtils = JNI.autoclass("org.locationtech.geomesa.utils.interop.WKTUtils") 32 | dfc = JNI.autoclass("org.geotools.feature.DefaultFeatureCollection") 33 | SimpleFeatureStore = JNI.autoclass("org.geotools.data.simple.SimpleFeatureStore") 34 | 35 | # ToDo: This is test stuff, delete this block when finished 36 | 37 | sft = simpleFeatureType(JNI) 38 | sft.createSimpleFeatureType(tableName, attribute_list) 39 | sft.setDateTimeIndex("When") 40 | 41 | print("Creating feature-type (schema): {}".format(tableName)) 42 | dataStore.createSchema(sft.simpleFeature) 43 | 44 | num_features = 1000 45 | print("Creating new {} new features".format(num_features)) 46 | people_names = ["Addams", "Bierce", "Clemens"] 47 | num_names = len(people_names) 48 | 49 | SECONDS_PER_YEAR = 365 * 24 * 60 * 60 50 | random.seed(5771) 51 | MIN_DATE = datetime(2014, 1, 1, 0, 0, 0) 52 | MIN_X = -78.485146 53 | MIN_Y = 38.030758 54 | DX = 2.0 55 | DY = 2.0 56 | fc = dfc() 57 | 58 | for i in range(num_features): 59 | ID = "Observation.{}".format(i) 60 | fb = sft.build([], ID) 61 | fb.setAttribute("Who", people_names[i % num_names]) 62 | fb.setAttribute("What", jLong(i)) 63 | x = MIN_X + random.random() * DX 64 | y = MIN_Y + random.random() * DY 65 | geometry = WKTUtils.read("POINT({} {})".format(x, y)) 66 | fb.setAttribute("Where", geometry) 67 | sample_dateTime = MIN_DATE + timedelta(seconds=int(round(random.random() * SECONDS_PER_YEAR))) 68 | jDateTime = pyDateTimeToJava(JNI, sample_dateTime, "UTC") 69 | fb.setAttribute("When", jDateTime.toDate()) 70 | fc.add(fb) 71 | del fb 72 | 73 | print("Inserting new features") 74 | featureStore = JNI.cast("org.geotools.data.simple.SimpleFeatureStore", dataStore.getFeatureSource(tableName)) 75 | featureStore.addFeatures(fc) 76 | 77 | return 78 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-cassandra 20 | GeoMesa Tutorials - Cassandra 21 | pom 22 | 23 | 24 | geomesa-tutorials-cassandra-avro 25 | geomesa-tutorials-cassandra-transforms 26 | geomesa-tutorials-cassandra-quickstart 27 | 28 | 29 | 30 | 31 | 32 | 33 | com.datastax.cassandra 34 | cassandra-driver-core 35 | ${cassandra.version} 36 | 37 | 38 | com.google.guava 39 | guava 40 | 18.0 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.locationtech.geomesa 48 | geomesa-cassandra-datastore_${scala.abi.version} 49 | 50 | 51 | org.locationtech.geomesa 52 | geomesa-utils_${scala.abi.version} 53 | 54 | 55 | com.datastax.cassandra 56 | cassandra-driver-core 57 | 58 | 59 | org.slf4j 60 | slf4j-reload4j 61 | 62 | 63 | ch.qos.reload4j 64 | reload4j 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /geomesa-examples-spark/src/main/scala/com/example/geomesa/spark/CountByDay.scala: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2013-2017 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 5 | * which accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | ***********************************************************************/ 8 | 9 | package com.example.geomesa.spark 10 | 11 | import java.text.SimpleDateFormat 12 | 13 | import org.apache.hadoop.conf.Configuration 14 | import org.apache.spark.rdd.RDD 15 | import org.apache.spark.{SparkConf, SparkContext} 16 | import org.geotools.api.data.DataStoreFinder 17 | import org.geotools.api.data.Query 18 | import org.geotools.factory.CommonFactoryFinder 19 | import org.geotools.filter.text.ecql.ECQL 20 | import org.locationtech.geomesa.accumulo.data.AccumuloDataStore 21 | import org.locationtech.geomesa.spark.GeoMesaSpark 22 | import org.geotools.api.feature.simple.SimpleFeature 23 | 24 | import scala.collection.JavaConversions._ 25 | 26 | object CountByDay { 27 | 28 | val params = Map( 29 | "instanceId" -> "mycloud", 30 | "zookeepers" -> "zoo1,zoo2,zoo3", 31 | "user" -> "user", 32 | "password" -> "password", 33 | "tableName" -> "geomesa.gdelt") 34 | 35 | // see geomesa-tools/conf/sfts/gdelt/reference.conf 36 | val typeName = "gdelt" 37 | val geom = "geom" 38 | val date = "dtg" 39 | 40 | val bbox = "-80, 35, -79, 36" 41 | val during = "2014-01-01T00:00:00.000Z/2014-01-31T12:00:00.000Z" 42 | 43 | val filter = s"bbox($geom, $bbox) AND $date during $during" 44 | 45 | def main(args: Array[String]) { 46 | // Get a handle to the data store 47 | val ds = DataStoreFinder.getDataStore(params).asInstanceOf[AccumuloDataStore] 48 | 49 | // Construct a CQL query to filter by bounding box 50 | val q = new Query(typeName, ECQL.toFilter(filter)) 51 | 52 | // Configure Spark 53 | val conf = new SparkConf().setAppName("testSpark") 54 | val sc = SparkContext.getOrCreate(conf) 55 | 56 | // Get the appropriate spatial RDD provider 57 | val spatialRDDProvider = GeoMesaSpark(params) 58 | 59 | // Get an RDD[SimpleFeature] from the spatial RDD provider 60 | val rdd = spatialRDDProvider.rdd(new Configuration, sc, params, q) 61 | 62 | // Collect the results and print 63 | countByDay(rdd).collect().foreach(println) 64 | println("\n") 65 | 66 | ds.dispose() 67 | } 68 | 69 | def countByDay(rdd: RDD[SimpleFeature], dateField: String = "dtg") = { 70 | val dayAndFeature = rdd.mapPartitions { iter => 71 | val df = new SimpleDateFormat("yyyyMMdd") 72 | val ff = CommonFactoryFinder.getFilterFactory 73 | val exp = ff.property(dateField) 74 | iter.map { f => (df.format(exp.evaluate(f).asInstanceOf[java.util.Date]), f) } 75 | } 76 | dayAndFeature.map( x => (x._1, 1)).reduceByKey(_ + _) 77 | } 78 | } -------------------------------------------------------------------------------- /geomesa-tutorials-common/src/main/java/org/geomesa/example/data/TutorialData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.data; 10 | 11 | import org.geotools.api.data.Query; 12 | import org.geotools.filter.text.cql2.CQLException; 13 | import org.geotools.filter.text.ecql.ECQL; 14 | import org.geotools.api.feature.simple.SimpleFeature; 15 | import org.geotools.api.feature.simple.SimpleFeatureType; 16 | import org.geotools.api.filter.Filter; 17 | 18 | import java.util.List; 19 | 20 | public interface TutorialData { 21 | 22 | String getTypeName(); 23 | SimpleFeatureType getSimpleFeatureType(); 24 | List getTestData(); 25 | List getTestQueries(); 26 | Filter getSubsetFilter(); 27 | 28 | 29 | /** 30 | * Creates a geotools filter based on a bounding box and date range 31 | * 32 | * @param geomField geometry attribute name 33 | * @param x0 bounding box min x value 34 | * @param y0 bounding box min y value 35 | * @param x1 bounding box max x value 36 | * @param y1 bounding box max y value 37 | * @param dateField date attribute name 38 | * @param t0 minimum time, exclusive, in the format "yyyy-MM-dd'T'HH:mm:ss.SSSZ" 39 | * @param t1 maximum time, exclusive, in the format "yyyy-MM-dd'T'HH:mm:ss.SSSZ" 40 | * @param attributesQuery any additional query string, or null 41 | * @return filter object 42 | * @throws CQLException if invalid CQL 43 | */ 44 | static Filter createFilter(String geomField, double x0, double y0, double x1, double y1, 45 | String dateField, String t0, String t1, 46 | String attributesQuery) throws CQLException { 47 | 48 | // there are many different geometric predicates that might be used; 49 | // here, we just use a bounding-box (BBOX) predicate as an example. 50 | // this is useful for a rectangular query area 51 | String cqlGeometry = "BBOX(" + geomField + ", " + x0 + ", " + y0 + ", " + x1 + ", " + y1 + ")"; 52 | 53 | // there are also quite a few temporal predicates; here, we use a 54 | // "DURING" predicate, because we have a fixed range of times that 55 | // we want to query 56 | String cqlDates = "(" + dateField + " DURING " + t0 + "/" + t1 + ")"; 57 | 58 | // there are quite a few predicates that can operate on other attribute 59 | // types; the GeoTools Filter constant "INCLUDE" is a default that means 60 | // to accept everything 61 | String cqlAttributes = attributesQuery == null ? "INCLUDE" : attributesQuery; 62 | 63 | String cql = cqlGeometry + " AND " + cqlDates + " AND " + cqlAttributes; 64 | 65 | // we use geotools ECQL class to parse a CQL string into a Filter object 66 | return ECQL.toFilter(cql); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /geomesa-quickstart-storm/src/main/java/com/example/geomesa/storm/OSMKafkaSpout.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2016-2017 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 5 | * which accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | ***********************************************************************/ 8 | 9 | package com.example.geomesa.storm; 10 | 11 | import org.apache.kafka.clients.consumer.Consumer; 12 | import org.apache.kafka.clients.consumer.ConsumerRecord; 13 | import org.apache.kafka.clients.consumer.KafkaConsumer; 14 | import org.apache.kafka.common.serialization.StringDeserializer; 15 | import org.apache.log4j.Logger; 16 | import org.apache.storm.spout.SpoutOutputCollector; 17 | import org.apache.storm.task.TopologyContext; 18 | import org.apache.storm.topology.OutputFieldsDeclarer; 19 | import org.apache.storm.topology.base.BaseRichSpout; 20 | import org.apache.storm.tuple.Fields; 21 | 22 | import java.io.IOException; 23 | import java.time.Duration; 24 | import java.util.*; 25 | 26 | import static org.apache.kafka.clients.consumer.ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG; 27 | import static org.apache.kafka.clients.consumer.ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG; 28 | 29 | public class OSMKafkaSpout extends BaseRichSpout { 30 | 31 | private static final Logger log = Logger.getLogger(OSMKafkaSpout.class); 32 | SpoutOutputCollector _collector = null; 33 | Map conf; 34 | String groupId; 35 | String topic; 36 | Consumer consumer; 37 | 38 | public OSMKafkaSpout(Map conf, String groupId, String topic) throws IOException { 39 | this.conf = conf; 40 | this.groupId = groupId; 41 | this.topic = topic; 42 | } 43 | 44 | public void nextTuple() { 45 | Iterator> records = consumer.poll(Duration.ofMillis(10)).iterator(); 46 | if (records.hasNext()) { 47 | List messages = new ArrayList<>(); 48 | messages.add(records.next()); 49 | while (records.hasNext()) { 50 | messages.add(records.next().value()); 51 | } 52 | _collector.emit(messages); 53 | } 54 | } 55 | 56 | public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { 57 | outputFieldsDeclarer.declare(new Fields("field")); 58 | } 59 | 60 | public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) { 61 | _collector = spoutOutputCollector; 62 | Properties props = new Properties(); 63 | props.put("zookeeper.connect", conf.get(OSMIngest.ZOOKEEPERS)); 64 | props.put("group.id", groupId); 65 | props.put("zookeeper.sync.time.ms", "200"); 66 | props.put("auto.commit.interval.ms", "1000"); 67 | props.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); 68 | props.put(VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); 69 | consumer = new KafkaConsumer<>(props); 70 | consumer.subscribe(Collections.singleton(topic)); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/geomesa-tutorials-fsds-quickstart/src/main/java/org/geomesa/example/fsds/FileSystemQuickStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.fsds; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.apache.hadoop.fs.Path; 13 | import org.geomesa.example.data.GDELTData; 14 | import org.geomesa.example.data.TutorialData; 15 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 16 | import org.geotools.api.data.DataStore; 17 | import org.geotools.api.feature.simple.SimpleFeatureType; 18 | import org.locationtech.geomesa.fs.data.FileSystemDataStore; 19 | import org.locationtech.geomesa.fs.data.FileSystemDataStoreFactory; 20 | import org.locationtech.geomesa.fs.storage.api.FileSystemStorage; 21 | import org.locationtech.geomesa.fs.storage.common.interop.ConfigurationUtils; 22 | 23 | import java.io.IOException; 24 | import java.util.Collections; 25 | 26 | public class FileSystemQuickStart extends GeoMesaQuickStart { 27 | 28 | // use gdelt data 29 | public FileSystemQuickStart(String[] args) throws ParseException { 30 | super(args, new FileSystemDataStoreFactory().getParametersInfo(), new GDELTData()); 31 | } 32 | 33 | @Override 34 | public SimpleFeatureType getSimpleFeatureType(TutorialData data) { 35 | SimpleFeatureType sft = super.getSimpleFeatureType(data); 36 | // For the FSDS we need to modify the SimpleFeatureType to specify the index scheme 37 | ConfigurationUtils.setScheme(sft, "daily,z2-2bit", Collections.emptyMap()); 38 | return sft; 39 | } 40 | 41 | public static void main(String[] args) { 42 | try { 43 | new FileSystemQuickStart(args).run(); 44 | } catch (ParseException e) { 45 | System.exit(1); 46 | } catch (Throwable e) { 47 | e.printStackTrace(); 48 | System.exit(2); 49 | } 50 | System.exit(0); 51 | } 52 | 53 | @Override 54 | public void cleanup(DataStore datastore, String typeName, boolean cleanup) { 55 | if (datastore != null) { 56 | try { 57 | if (cleanup) { 58 | // noinspection resource 59 | FileSystemStorage fsStorage = ((FileSystemDataStore) datastore).storage(typeName); 60 | Path fsPath = fsStorage.context().root(); 61 | try { 62 | System.out.println("Cleaning up test data"); 63 | // noinspection resource 64 | fsStorage.context().fs().delete(fsPath, true); 65 | } catch (IOException e) { 66 | System.out.println("Unable to delete '" + fsPath.toString() + "':" + e); 67 | } 68 | } 69 | } catch (Exception e) { 70 | System.out.println("Unable to cleanup datastore: " + e); 71 | } finally { 72 | // make sure that we dispose of the datastore when we're done with it 73 | datastore.dispose(); 74 | } 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials-kafka 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-kafka-quickstart 20 | GeoMesa Tutorials - Kafka - Quick Start 21 | 22 | 23 | 24 | org.geomesa.example 25 | geomesa-tutorials-common 26 | 27 | 28 | commons-cli 29 | commons-cli 30 | 1.4 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.apache.maven.plugins 38 | maven-shade-plugin 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | false 47 | 48 | live-test 49 | 50 | 51 | 52 | org.codehaus.mojo 53 | exec-maven-plugin 54 | 1.5.0 55 | 56 | 57 | 58 | exec 59 | 60 | 61 | 62 | 63 | java 64 | 65 | -classpath 66 | 67 | org.geomesa.example.kafka.KafkaQuickStart 68 | -kafka.brokers 69 | ${kafka.brokers} 70 | -kafka.zookeepers 71 | ${kafka.zookeepers} 72 | -automated 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials-accumulo 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-accumulo-quickstart 20 | GeoMesa Tutorials - Accumulo - Quick Start 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-shade-plugin 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | false 35 | 36 | live-test 37 | 38 | 39 | 40 | org.codehaus.mojo 41 | exec-maven-plugin 42 | 1.5.0 43 | 44 | 45 | 46 | exec 47 | 48 | 49 | 50 | 51 | java 52 | 53 | -classpath 54 | 55 | org.geomesa.example.accumulo.AccumuloQuickStart 56 | --accumulo.instance.id 57 | ${accumulo.instance.id} 58 | --accumulo.zookeepers 59 | ${accumulo.zookeepers} 60 | --accumulo.user 61 | ${accumulo.user} 62 | --accumulo.password 63 | ${accumulo.password} 64 | --accumulo.catalog 65 | ${accumulo.catalog} 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /geomesa-tutorials-cassandra/geomesa-tutorials-cassandra-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials-cassandra 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-cassandra-quickstart 20 | GeoMesa Tutorials - Cassandra - Quick Start 21 | 22 | 23 | 24 | org.geomesa.example 25 | geomesa-tutorials-common 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-shade-plugin 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | false 42 | 43 | live-test 44 | 45 | 46 | 47 | org.codehaus.mojo 48 | exec-maven-plugin 49 | 1.5.0 50 | 51 | 52 | 53 | exec 54 | 55 | 56 | 57 | 58 | java 59 | 60 | -classpath 61 | 62 | org.geomesa.example.cassandra.CassandraQuickStart 63 | --cassandra.contact.point 64 | ${cassandra.contact.point} 65 | --cassandra.keyspace 66 | ${cassandra.keyspace} 67 | --cassandra.catalog 68 | ${cassandra.catalog} 69 | --cassandra.username 70 | ${cassandra.username} 71 | --cassandra.password 72 | ${cassandra.password} 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /geomesa-tutorials-fsds/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-tutorials-fsds 19 | GeoMesa Tutorials - FileSystem 20 | pom 21 | 22 | 23 | geomesa-tutorials-fsds-avro 24 | geomesa-tutorials-fsds-transforms 25 | geomesa-tutorials-fsds-quickstart 26 | 27 | 28 | 29 | 30 | org.locationtech.geomesa 31 | geomesa-fs-datastore_${scala.abi.version} 32 | 33 | 34 | org.locationtech.geomesa 35 | geomesa-fs-storage-parquet_${scala.abi.version} 36 | 37 | 38 | org.locationtech.geomesa 39 | geomesa-fs-storage-orc_${scala.abi.version} 40 | 41 | 42 | 43 | org.apache.hadoop 44 | hadoop-common 45 | 46 | 47 | org.apache.hadoop 48 | hadoop-auth 49 | 50 | 51 | org.apache.hadoop 52 | hadoop-client 53 | 54 | 55 | org.apache.hadoop 56 | hadoop-hdfs 57 | 58 | 59 | org.apache.hadoop 60 | hadoop-hdfs-client 61 | 62 | 63 | org.apache.hadoop 64 | hadoop-mapreduce-client-core 65 | 66 | 67 | com.google.guava 68 | guava 69 | 27.0-jre 70 | compile 71 | 72 | 73 | 74 | org.xerial.snappy 75 | snappy-java 76 | 1.1.10.5 77 | compile 78 | 79 | 80 | 81 | org.geotools 82 | gt-main 83 | 84 | 85 | org.geotools 86 | gt-epsg-hsql 87 | 88 | 89 | 90 | ch.qos.reload4j 91 | reload4j 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /geomesa-tutorials-accumulo/geomesa-tutorials-accumulo-feature-level-vis/src/main/java/org/geomesa/example/accumulo/vis/FeatureLevelVisibilityTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.accumulo.vis; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.data.GDELTData; 13 | import org.geomesa.example.data.TutorialData; 14 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 15 | import org.geotools.api.data.Query; 16 | import org.geotools.feature.simple.SimpleFeatureTypeBuilder; 17 | import org.locationtech.geomesa.accumulo.data.AccumuloDataStoreFactory; 18 | import org.locationtech.geomesa.security.SecurityUtils; 19 | import org.geotools.api.feature.simple.SimpleFeature; 20 | import org.geotools.api.feature.simple.SimpleFeatureType; 21 | 22 | import java.util.Collections; 23 | import java.util.List; 24 | 25 | public class FeatureLevelVisibilityTutorial extends GeoMesaQuickStart { 26 | 27 | // use modified gdelt data 28 | private static TutorialData data = new GDELTData() { 29 | private SimpleFeatureType sft = null; 30 | 31 | @Override 32 | // overwrite the type name so we don't interfere with the regular quick start 33 | public String getTypeName() { 34 | return "gdelt-feature-level-visibility"; 35 | } 36 | 37 | @Override 38 | // add a 'visibility' attribute for visualization 39 | public SimpleFeatureType getSimpleFeatureType() { 40 | if (sft == null) { 41 | SimpleFeatureType base = super.getSimpleFeatureType(); 42 | SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); 43 | builder.init(base); 44 | builder.add("visibility", String.class); 45 | sft = builder.buildFeatureType(); 46 | // initializing a simple feature type builder doesn't copy user data, so do it ourselves 47 | sft.getUserData().putAll(base.getUserData()); 48 | } 49 | return sft; 50 | } 51 | }; 52 | 53 | public FeatureLevelVisibilityTutorial(String[] args) throws ParseException { 54 | super(args, new AccumuloDataStoreFactory().getParametersInfo(), data); 55 | } 56 | 57 | @Override 58 | public List getTestFeatures(TutorialData data) { 59 | List features = super.getTestFeatures(data); 60 | int i = 0; 61 | while (i < features.size()) { 62 | SimpleFeature feature = features.get(i); 63 | String visibilities; 64 | if (i % 2 == 0) { 65 | visibilities = "admin"; 66 | } else { 67 | visibilities = "user|admin"; 68 | } 69 | // set the visibility as user data in the feature 70 | SecurityUtils.setFeatureVisibility(feature, visibilities); 71 | // also set as an attribute for visualization 72 | feature.setAttribute("visibility", visibilities); 73 | i++; 74 | } 75 | return features; 76 | } 77 | 78 | @Override 79 | public List getTestQueries(TutorialData data) { 80 | // we use geoserver for visualization 81 | return Collections.emptyList(); 82 | } 83 | 84 | public static void main(String[] args) { 85 | try { 86 | new FeatureLevelVisibilityTutorial(args).run(); 87 | } catch (ParseException e) { 88 | System.exit(1); 89 | } catch (Throwable e) { 90 | e.printStackTrace(); 91 | System.exit(2); 92 | } 93 | System.exit(0); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-kafka 20 | GeoMesa Tutorials - Kafka 21 | pom 22 | 23 | 24 | geomesa-tutorials-kafka-quickstart 25 | geomesa-tutorials-kafka-streams-quickstart 26 | 27 | 28 | 29 | 30 | 31 | org.geomesa.example 32 | geomesa-tutorials-kafka-quickstart 33 | ${project.version} 34 | 35 | 36 | 37 | 38 | org.apache.kafka 39 | kafka_${scala.abi.version} 40 | ${kafka.version} 41 | 42 | 43 | org.apache.kafka 44 | kafka-clients 45 | ${kafka.version} 46 | 47 | 48 | org.apache.zookeeper 49 | zookeeper 50 | ${zookeeper.version} 51 | 52 | 53 | org.apache.zookeeper 54 | zookeeper-jute 55 | ${zookeeper.version} 56 | 57 | 58 | com.google.guava 59 | guava 60 | 20.0 61 | 62 | 63 | 64 | 65 | 66 | 67 | org.locationtech.geomesa 68 | geomesa-kafka-datastore_${scala.abi.version} 69 | 70 | 71 | org.apache.kafka 72 | kafka_${scala.abi.version} 73 | 74 | 75 | org.apache.kafka 76 | kafka-clients 77 | 78 | 79 | org.apache.zookeeper 80 | zookeeper 81 | 82 | 83 | org.apache.zookeeper 84 | zookeeper-jute 85 | 86 | 87 | org.slf4j 88 | slf4j-reload4j 89 | 90 | 91 | ch.qos.reload4j 92 | reload4j 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/utils/geomesa_plotting.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | geomesa_plotting.py 5 | 6 | Note: this has been tested with python 2.7.12 & 3.5 7 | 8 | Description: 9 | This script uses bokeh to perform plotting operations on GeoMesa data collected using 10 | the PyMesa libraries. It relies heavily on the bokeh plotting library, which can be loaded 11 | using pip: 12 | 1) sudo -H pip install bokeh 13 | 14 | Created by: Jordan Muss 15 | CCRi 16 | 17 | Creation Date: 3-30-2017 18 | Version: 1.0 19 | 20 | Dependencies: 21 | Public: bokeh, re, string, os, sys, __future__ (print_function) 22 | Private: 23 | How to use: 24 | Updates: 25 | 26 | To Do: 27 | """ 28 | import os, re, string, sys 29 | '''----------------------------------------------------------------------------------------------------------------------''' 30 | ''' Load the plotting libraries: ''' 31 | '''----------------------------------------------------------------------------------------------------------------------''' 32 | try: 33 | from bokeh.plotting import ColumnDataSource, figure, output_file, reset_output, show 34 | from bokeh.models import (HoverTool, BoxZoomTool, CrosshairTool, PanTool, ResetTool, 35 | SaveTool, WheelZoomTool, ZoomInTool, ZoomOutTool, Range1d) 36 | except: 37 | print("Error: the bokeh package has not been installed. Please install it with:") 38 | print("\t\tsudo -H pip install bokeh\n\n") 39 | sys.exit(-1) 40 | '''--------------------------------------------------------------------''' 41 | ''' Begin plotting functions:''' 42 | '''--------------------------------------------------------------------''' 43 | def plotGeoPoints(data_dict, data_title, offset=0.25, pt_size=7, save_dir=None): 44 | if save_dir is not None: 45 | path = os.path.expanduser(save_dir) 46 | if os.path.exists(path) and os.path.isdir(path): 47 | os.chdir(path) 48 | else: 49 | print("Warning: either {} does not exist or is not a valid directory; writing html file to {}".format(path, os.getcwd())) 50 | noPunc = re.compile("[%s\\…]" % re.escape(string.punctuation)) 51 | out_file_name = "{}.html".format(noPunc.sub("", data_title).replace(" ", "_")) 52 | ''' Plot the points collected from GeoMesa''' 53 | fid, x, y, what, who, when, why = zip(*[(key, row['x'], row['y'], row['what'], row['who'], row['when'], row['why']) for key, row in data_dict.items()]) 54 | ''' Put the time fields into mm/dd/yyyy h:m am/pm format: ''' 55 | when = [tm.strftime("%M/%d/%Y %I:%M %p") for tm in when] 56 | data_source = ColumnDataSource(dict(fid=fid, x=x, y=y, what=what, who=who, when=when, why=why)) 57 | hover = HoverTool(tooltips=[ ("fid", "@fid"), 58 | ("(x,y)", "($x, $y)"), 59 | ("Who", "@who"), 60 | ("What", "@what"), 61 | ("When", "@when"), 62 | ("Why", "@why"), ] ) 63 | tools = [PanTool(), BoxZoomTool(), CrosshairTool(), hover, WheelZoomTool(), ZoomInTool(), ZoomOutTool(), ResetTool(), SaveTool()] 64 | ''' Set the values to show with hover: ''' 65 | output_file(out_file_name, title="Results of {}".format(data_title)) 66 | geo_plt = figure(title="GeoMesa--{}".format(data_title), tools=tools, plot_width=600, plot_height=600) 67 | geo_plt.title.align = 'center' 68 | geo_plt.toolbar.logo = None 69 | geo_plt.toolbar_sticky = False 70 | geo_plt.xaxis.axis_label = "Lat" 71 | geo_plt.yaxis.axis_label = "Long" 72 | geo_plt.y_range = Range1d(start=min(y)-offset, end=max(y)+offset) 73 | geo_plt.x_range = Range1d(start=min(x)-offset, end=max(x)+offset) 74 | geo_plt.square("x", "y", fill_color="red", line_color=None, source=data_source, size=pt_size) 75 | show(geo_plt) 76 | reset_output() 77 | -------------------------------------------------------------------------------- /geomesa-tutorials-kafka/geomesa-tutorials-kafka-streams-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 4.0.0 12 | 13 | 14 | org.geomesa.example 15 | geomesa-tutorials-kafka 16 | 5.5.0-SNAPSHOT 17 | 18 | 19 | geomesa-tutorials-kafka-streams-quickstart 20 | GeoMesa Tutorials - Kafka Streams - Quick Start 21 | 22 | 23 | 24 | org.geomesa.example 25 | geomesa-tutorials-common 26 | 27 | 28 | org.geomesa.example 29 | geomesa-tutorials-kafka-quickstart 30 | 31 | 32 | org.locationtech.geomesa 33 | geomesa-kafka-datastore_${scala.abi.version} 34 | 35 | 36 | org.apache.kafka 37 | kafka-streams-scala_${scala.abi.version} 38 | ${kafka.version} 39 | 40 | 41 | org.apache.kafka 42 | kafka-streams 43 | ${kafka.version} 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-shade-plugin 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | false 60 | 61 | live-test 62 | 63 | 64 | 65 | org.codehaus.mojo 66 | exec-maven-plugin 67 | 1.5.0 68 | 69 | 70 | 71 | exec 72 | 73 | 74 | 75 | 76 | java 77 | 78 | -classpath 79 | 80 | org.geomesa.example.kafka.KafkaStreamsQuickStart 81 | -kafka.brokers 82 | ${kafka.brokers} 83 | -kafka.zookeepers 84 | ${kafka.zookeepers} 85 | -automated 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /geomesa-tutorials-common/src/main/java/org/geomesa/example/avro/GeoMesaAvroTutorial.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.avro; 10 | 11 | import org.apache.commons.cli.ParseException; 12 | import org.geomesa.example.data.GDELTData; 13 | import org.geomesa.example.data.TutorialData; 14 | import org.geomesa.example.quickstart.GeoMesaQuickStart; 15 | import org.geotools.api.data.DataAccessFactory.Param; 16 | import org.geotools.api.data.DataStore; 17 | import org.geotools.data.DataUtilities; 18 | import org.geotools.api.data.FeatureReader; 19 | import org.geotools.api.data.Query; 20 | import org.geotools.api.data.Transaction; 21 | import org.locationtech.geomesa.features.avro.io.AvroDataFileReader; 22 | import org.locationtech.geomesa.features.avro.io.AvroDataFileWriter; 23 | import org.geotools.api.feature.simple.SimpleFeature; 24 | import org.geotools.api.feature.simple.SimpleFeatureType; 25 | 26 | import java.io.ByteArrayInputStream; 27 | import java.io.ByteArrayOutputStream; 28 | import java.io.IOException; 29 | import java.util.Collections; 30 | import java.util.List; 31 | 32 | public abstract class GeoMesaAvroTutorial extends GeoMesaQuickStart { 33 | 34 | public GeoMesaAvroTutorial(String[] args, Param[] parameters) throws ParseException { 35 | super(args, parameters, new GDELTData(),true); 36 | } 37 | 38 | @Override 39 | public List getTestQueries(TutorialData data) { 40 | // we return the entire data set 41 | return Collections.singletonList(new Query(data.getTypeName())); 42 | } 43 | 44 | @Override 45 | public void queryFeatures(DataStore datastore, List queries) throws IOException { 46 | for (Query query: queries) { 47 | int n = 0; 48 | 49 | // write to in-memory bytes - alternatively we could write to a file, etc 50 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 51 | // create an avro writer based on the simple feature type 52 | SimpleFeatureType sft = datastore.getSchema(query.getTypeName()); 53 | try (AvroDataFileWriter writer = new AvroDataFileWriter(out, sft, -1)) { 54 | System.out.println("Querying data store and writing features to Avro binary format"); 55 | 56 | // read from the underlying data store and write to the output stream 57 | try (FeatureReader reader = 58 | datastore.getFeatureReader(query, Transaction.AUTO_COMMIT)) { 59 | while (reader.hasNext()) { 60 | writer.append(reader.next()); 61 | n++; 62 | } 63 | writer.flush(); 64 | } 65 | } 66 | 67 | byte[] bytes = out.toByteArray(); 68 | 69 | System.out.println("Wrote " + n + " features as " + bytes.length + " bytes"); 70 | 71 | System.out.println("Reading features back from Avro binary format"); 72 | 73 | n = 0; 74 | 75 | // create an avro reader - the schema is self-describing, so we don't need to know 76 | // the SimpleFeatureType up front 77 | try (AvroDataFileReader reader = new AvroDataFileReader(new ByteArrayInputStream(bytes))) { 78 | while (reader.hasNext()) { 79 | SimpleFeature feature = reader.next(); 80 | if (n++ < 10) { 81 | // use geotools data utilities to get a printable string 82 | System.out.println(String.format("%02d", n) + " " + DataUtilities.encodeFeature(feature)); 83 | } else if (n == 10) { 84 | System.out.println("..."); 85 | } 86 | } 87 | } 88 | System.out.println(); 89 | System.out.println("Read back " + n + " total features"); 90 | System.out.println(); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /geomesa-quickstart-python/tools/ECQL/filter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | filter.py 5 | 6 | Description: 7 | These functions are helpers to build ECQL queries/filters to access data GeoMesa data. 8 | 9 | Created by: Jordan Muss 10 | 11 | Creation Date: 3-31-2017 12 | Version: 1.0 13 | 14 | Dependencies: 15 | Public: jnius 16 | Private: SetupJnius 17 | 18 | Interfaces: 19 | ECQLQuery Helper cass to allow python access to java Query & CQL functions. Has createFilter, 20 | createQuery, & getFeatures methods 21 | createBBoxFilter Function to create a bounding-box (BBOX) filter string of a rectangular query area 22 | createWithinFilter Function to create a container (WITHIN) filter of a query area described by a polygon 23 | or multipolygon WKT 24 | createDuringFilter Function to create a temporal query string for a fixed range of date/times (DURING) 25 | createAttributeFilter Function to create a query that accepts everything else (other predicates that operate 26 | on other attribute types); this uses the GeoTools Filter constant "INCLUDE" 27 | 28 | Updates: 29 | 4-6-2017 createWithinFilter Function to create a container (WITHIN) filter of a query area 30 | described by a polygon or multipolygon WKT 31 | To Do: 32 | """ 33 | class ECQLQuery: 34 | """ This is a helper class to allow python access to java Query & CQL functions.""" 35 | def __init__(self, JNI): 36 | ''' This is sets up links to the java types & java Query and CQL functions.''' 37 | self.jString = JNI.autoclass('java.lang.String') 38 | self.Query = JNI.autoclass('org.geotools.data.Query') 39 | self.CQL = JNI.autoclass('org.geotools.filter.text.cql2.CQL') 40 | 41 | def createFilter(self, filter_string): 42 | ''' Create the ECQL filter from the prepared (python) string: ''' 43 | return self.CQL.toFilter(self.jString(filter_string)) 44 | 45 | def createQuery(self, simpleFeatureTypeName, dataStore, filter_string): 46 | ''' Return an ECQL filter query for iterating & additional processing: ''' 47 | jSFT_name = self.jString(simpleFeatureTypeName) 48 | cqlFilter = self.createFilter(filter_string) 49 | return self.Query(jSFT_name, cqlFilter) 50 | 51 | def getFeatures(self, simpleFeatureTypeName, dataStore, filter_string): 52 | ''' Build & execute an ECQL query from a filter string for the DataStore. 53 | Return an ECQL filter query for iterating & additional processing: ''' 54 | jSFT_name = self.jString(simpleFeatureTypeName) 55 | query = self.createQuery(simpleFeatureTypeName, dataStore, filter_string) 56 | #query = ecql.queryFeatures(simpleFeatureTypeName, dataStore, filter_string) 57 | ''' Submit the query, which will return an iterator over matching features: ''' 58 | featureSource = dataStore.getFeatureSource(jSFT_name) 59 | #featureItr = featureSource.getFeatures(query).features() 60 | return featureSource.getFeatures(query) 61 | 62 | def createBBoxFilter(geomField, x0, y0, x1, y1): 63 | ''' Create a bounding-box (BBOX) filter of a rectangular query area: ''' 64 | cqlGeometry = "BBOX({}, {}, {}, {}, {})".format(geomField, x0, y0, x1, y1) 65 | return cqlGeometry 66 | 67 | def createWithinFilter(geomField, poly_descriptor): 68 | ''' Create a container (WITHIN) filter of a query area described by a polygon or 69 | multipolygon WKT: ''' 70 | cqlGeometry = "WITHIN({}, {})".format(geomField, poly_descriptor) 71 | return cqlGeometry 72 | 73 | def createDuringFilter(dateField, t0, t1): 74 | ''' Create a temporal query string for a fixed range of date/times (DURING): ''' 75 | cqlDates = "({} DURING {}/{})".format(dateField, t0, t1) 76 | return cqlDates 77 | 78 | def createAttributeFilter(attributesQuery): 79 | ''' The GeoTools Filter constant "INCLUDE" is a default meant to accept 80 | everything else (other predicates that operate on other attribute types): ''' 81 | cqlAttributes = "INCLUDE" if attributesQuery is None else attributesQuery 82 | return cqlAttributes 83 | 84 | -------------------------------------------------------------------------------- /geomesa-quickstart-storm/src/main/java/com/example/geomesa/storm/OSMIngestProducer.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2016-2017 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 5 | * which accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | ***********************************************************************/ 8 | 9 | package com.example.geomesa.storm; 10 | 11 | import org.apache.commons.cli.BasicParser; 12 | import org.apache.commons.cli.CommandLine; 13 | import org.apache.commons.cli.CommandLineParser; 14 | import org.apache.commons.cli.Option; 15 | import org.apache.commons.cli.OptionBuilder; 16 | import org.apache.commons.cli.Options; 17 | import org.apache.commons.cli.ParseException; 18 | import org.apache.kafka.clients.producer.KafkaProducer; 19 | import org.apache.kafka.clients.producer.Producer; 20 | import org.apache.kafka.clients.producer.ProducerRecord; 21 | import org.apache.log4j.Logger; 22 | 23 | import java.io.BufferedReader; 24 | import java.io.FileNotFoundException; 25 | import java.io.FileReader; 26 | import java.io.IOException; 27 | import java.util.Properties; 28 | import java.util.Random; 29 | 30 | public class OSMIngestProducer { 31 | 32 | private static final Logger log = Logger.getLogger(OSMIngestProducer.class); 33 | static String INGEST_FILE = "ingestFile"; 34 | static String TOPIC = "topic"; 35 | static String BROKER_LIST = "brokers"; 36 | 37 | public static Options getRequiredOptions() { 38 | Options options = new Options(); 39 | Option ingestFileOpt = OptionBuilder.withArgName(INGEST_FILE) 40 | .hasArg() 41 | .isRequired() 42 | .withDescription("ingest csv file") 43 | .create(INGEST_FILE); 44 | Option topicOpt = OptionBuilder.withArgName(TOPIC) 45 | .hasArg() 46 | .isRequired() 47 | .withDescription("name of kafka topic") 48 | .create(TOPIC); 49 | Option brokersOpt = OptionBuilder.withArgName(BROKER_LIST) 50 | .hasArg() 51 | .isRequired() 52 | .withDescription("kafka metadata brokers list") 53 | .create(BROKER_LIST); 54 | options.addOption(ingestFileOpt); 55 | options.addOption(topicOpt); 56 | options.addOption(brokersOpt); 57 | return options; 58 | } 59 | 60 | public static void main(String[] args) 61 | throws FileNotFoundException, ParseException { 62 | 63 | CommandLineParser parser = new BasicParser(); 64 | Options options = getRequiredOptions(); 65 | CommandLine cmd = null; 66 | Producer producer = null; 67 | String topic = null; 68 | try { 69 | cmd = parser.parse(options, args); 70 | topic = cmd.getOptionValue(TOPIC); 71 | final Properties props = new Properties(); 72 | props.put("serializer.class", "kafka.serializer.StringEncoder"); 73 | props.put("metadata.broker.list", cmd.getOptionValue(BROKER_LIST)); 74 | props.put("producer.type", "async"); 75 | producer = new KafkaProducer<>(props); 76 | } catch (ParseException e) { 77 | log.error("Error parsing command line args", e); 78 | throw e; 79 | } 80 | 81 | BufferedReader bufferedReader = null; 82 | try { 83 | FileReader fileReader = new FileReader(cmd.getOptionValue(INGEST_FILE)); 84 | bufferedReader = new BufferedReader(fileReader); 85 | } catch (FileNotFoundException e) { 86 | log.error("File not found", e); 87 | throw e; 88 | } 89 | 90 | //to assign messages to different partitions using default partitioner, need random key 91 | Random rnd = new Random(); 92 | try { 93 | for (String x = bufferedReader.readLine(); 94 | x != null; 95 | x = bufferedReader.readLine()) { 96 | producer.send(new ProducerRecord<>(topic, String.valueOf(rnd.nextInt()), x)); 97 | } 98 | } catch (IOException e) { 99 | log.error("Error reading lines from file", e); 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /geomesa-quickstart-python/utils/geomesa_jnius_setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | geomesa_jnius_setup.py 5 | 6 | Note: this has been tested with python 2.7.12 & 3.5 7 | 8 | Description: 9 | This script performs the necessary steps to setup jnius to provide GeoMesa functionality 10 | with Accumulo. PyJnius is a third party package that requires cython and acts as a Java 11 | Natie Interface, allowing python programs to run java code. 12 | 13 | On unix-based systems these packages can be installed using pip: 14 | 1) sudo -H pip install cython 15 | 2) sudo -H pip install pyjnius 16 | 17 | Created by: Jordan Muss 18 | CCRi 19 | 20 | Creation Date: 3-30-2017 21 | Version: 1.0 22 | 23 | Dependencies: 24 | Public: jnius, os, sys, __future__ (print_function) 25 | Private: 26 | 27 | Interfaces: 28 | SetupJnius Class to set up jnius to work with the necessary GeoMesa libraries. It tests 29 | that the necessary packages are accessible, or fails with a sys.exit(-1). It also 30 | wraps some of the jnius classes with helper functions specific to GeoMesa cases. 31 | 32 | DataStoreFinder A jnius Java reflection class that allows PyGeomesa to connect to GeoMesa 33 | Accumulo databases. 34 | 35 | Updates: 36 | 4-6-2017 Added cast wrapper to the class for java object casting 37 | 38 | @property 39 | def cast(self, JavaClassPath, jObject): 40 | ''' Cast an object as a specific java object type:''' 41 | #return _cast(JavaClassPath, jObject) 42 | return _cast 43 | 44 | 45 | To Do: 46 | """ 47 | '''----------------------------------------------------------------------------------------------------------------------''' 48 | ''' Import Java & Geomesa classes: ''' 49 | '''----------------------------------------------------------------------------------------------------------------------''' 50 | #from __future__ import print_function 51 | import os, sys 52 | 53 | class SetupJnius: 54 | def __init__(self, classpath=None): 55 | ''' This is a kluge to allow autoclass & find_javaclass to be 'private' functions 56 | of this class. In reality, they are global to the geomesa_jnius_setup namespace''' 57 | global _autoclass, _cast, _detach, _find_javaclass, _JavaClass, _JavaMethod, _JavaObject, _MetaJavaClass 58 | if classpath is not None: 59 | java_classpath = os.path.expanduser(classpath) 60 | os.environ['CLASSPATH'] = java_classpath 61 | try: 62 | from jnius import autoclass as _autoclass 63 | from jnius import cast as _cast 64 | from jnius import detach as _detach 65 | from jnius import find_javaclass as _find_javaclass 66 | from jnius import JavaClass as _JavaClass 67 | from jnius import JavaMethod as _JavaMethod 68 | from jnius import JavaObject as _JavaObject 69 | from jnius import MetaJavaClass as _MetaJavaClass 70 | except: 71 | print("Error: the jnius package has not been installed. Please install it with:") 72 | print("\t\tsudo -H pip install jnius\n\n") 73 | _detach() 74 | sys.exit(-1) 75 | if self.testClasspath(): 76 | self.classpath_status = True 77 | print("Your classpath is valid.") 78 | else: 79 | print("Error:there are errors in your classpath; refer to the logged tests above.") 80 | _detach() 81 | sys.exit(-1) 82 | 83 | def autoclass(self, JavaClass): 84 | return _autoclass(JavaClass) 85 | 86 | @property 87 | def cast(self):#, JavaClassPath, jObject): 88 | ''' Cast an object as a specific java object type:''' 89 | return _cast 90 | 91 | @property 92 | def detach(self): 93 | ''' Detach jnius' native thread to the JVM:''' 94 | return _detach 95 | 96 | def find_javaclass(self, JavaClass, msg=None): 97 | if msg is None : msg = JavaClass 98 | try: 99 | _find_javaclass(JavaClass) 100 | print("{} classpath is OK".format(msg)) 101 | result = True 102 | except: 103 | print("Error: {} classpath is NOT OK".format(msg)) 104 | result = False 105 | return result 106 | 107 | @property 108 | def JavaClass(self): 109 | return _JavaClass 110 | 111 | def JavaMethod(self, jMethod, static=False): 112 | return _JavaMethod(jMethod, static=static) 113 | 114 | @property 115 | def JavaObject(self): 116 | return _JavaObject 117 | 118 | @property 119 | def MetaJavaClass(self): 120 | return _MetaJavaClass 121 | 122 | def testClasspath(self): 123 | #GeoMesa test: 124 | GeoMesa = self.find_javaclass("org.geotools.data.DataStoreFinder", msg="GeoMesa") 125 | #Hadoop test: 126 | Hadoop = self.find_javaclass("org.apache.hadoop.io.Writable", msg="Hadoop") 127 | #zookeeper test: 128 | zookeeper = self.find_javaclass("org.apache.zookeeper.KeeperException", msg="zookeeper") 129 | #Accumulo test: 130 | accumulo = self.find_javaclass("org.apache.accumulo.core.util.Version", msg="accumulo") 131 | return GeoMesa and Hadoop and zookeeper and accumulo 132 | -------------------------------------------------------------------------------- /geomesa-quickstart-storm/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-quickstart-storm 19 | GeoMesa Quickstart - Storm 20 | 2016 21 | 22 | 23 | 24 | 25 | 26 | org.apache.accumulo 27 | accumulo-core 28 | ${accumulo.version} 29 | 30 | 31 | org.apache.accumulo 32 | accumulo-start 33 | ${accumulo.version} 34 | 35 | 36 | org.apache.kafka 37 | kafka_${scala.abi.version} 38 | ${kafka.version} 39 | 40 | 41 | org.apache.kafka 42 | kafka-clients 43 | ${kafka.version} 44 | 45 | 46 | org.apache.zookeeper 47 | zookeeper 48 | ${zookeeper.version} 49 | 50 | 51 | org.apache.storm 52 | storm-core 53 | ${storm.version} 54 | provided 55 | 56 | 57 | 58 | 59 | 60 | 61 | org.locationtech.geomesa 62 | geomesa-accumulo-datastore_${scala.abi.version} 63 | 64 | 65 | org.apache.accumulo 66 | accumulo-core 67 | 68 | 69 | org.apache.accumulo 70 | accumulo-start 71 | 72 | 73 | org.apache.kafka 74 | kafka_${scala.abi.version} 75 | 76 | 77 | org.apache.kafka 78 | kafka-clients 79 | 80 | 81 | org.apache.storm 82 | storm-core 83 | 84 | 85 | org.apache.hadoop 86 | hadoop-common 87 | 88 | 89 | org.apache.hadoop 90 | hadoop-client 91 | 92 | 93 | org.geotools 94 | gt-epsg-wkt 95 | 96 | 97 | com.google.guava 98 | guava 99 | 11.0.1 100 | 101 | 102 | ch.qos.reload4j 103 | reload4j 104 | provided 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | org.apache.maven.plugins 113 | maven-shade-plugin 114 | 115 | 116 | 117 | org.slf4j:* 118 | 119 | 120 | 121 | 122 | com.google.common 123 | com.example.geomesa.shaded.com.google.common 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /geomesa-quickstart-storm/src/main/java/com/example/geomesa/storm/OSMKafkaBolt.java: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2016-2017 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 5 | * which accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | ***********************************************************************/ 8 | 9 | package com.example.geomesa.storm; 10 | 11 | import org.apache.storm.task.OutputCollector; 12 | import org.apache.storm.task.TopologyContext; 13 | import org.apache.storm.topology.OutputFieldsDeclarer; 14 | import org.apache.storm.topology.base.BaseRichBolt; 15 | import org.apache.storm.tuple.Fields; 16 | import org.apache.storm.tuple.Tuple; 17 | import org.locationtech.jts.geom.Coordinate; 18 | import org.locationtech.jts.geom.Geometry; 19 | import org.locationtech.jts.geom.GeometryFactory; 20 | import org.apache.log4j.Logger; 21 | import org.geotools.api.data.DataStore; 22 | import org.geotools.api.data.DataStoreFinder; 23 | import org.geotools.api.data.FeatureWriter; 24 | import org.geotools.api.data.Transaction; 25 | import org.geotools.feature.simple.SimpleFeatureBuilder; 26 | import org.geotools.filter.identity.FeatureIdImpl; 27 | import org.geotools.geometry.jts.JTSFactoryFinder; 28 | import org.geotools.api.feature.simple.SimpleFeature; 29 | import org.geotools.api.feature.simple.SimpleFeatureType; 30 | 31 | import java.io.IOException; 32 | import java.util.HashMap; 33 | import java.util.Map; 34 | import java.util.UUID; 35 | 36 | public class OSMKafkaBolt extends BaseRichBolt { 37 | private static final Logger log = Logger.getLogger(OSMKafkaBolt.class); 38 | Map conf; 39 | String groupId; 40 | String topic; 41 | String featureName; 42 | Map connectionParams; 43 | private FeatureWriter featureWriter = null; 44 | private SimpleFeatureBuilder featureBuilder; 45 | private GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); 46 | private static final int LATITUDE_COL_IDX = 0; 47 | private static final int LONGITUDE_COL_IDX = 1; 48 | 49 | public OSMKafkaBolt(Map conf, String groupId, String topic) { 50 | this.conf = conf; 51 | this.groupId = groupId; 52 | this.topic = topic; 53 | 54 | featureName = conf.get(OSMIngest.FEATURE_NAME); 55 | 56 | connectionParams = new HashMap(); 57 | connectionParams.put("instanceId", conf.get(OSMIngest.INSTANCE_ID)); 58 | connectionParams.put("zookeepers", conf.get(OSMIngest.ZOOKEEPERS)); 59 | connectionParams.put("user", conf.get(OSMIngest.USER)); 60 | connectionParams.put("password", conf.get(OSMIngest.PASSWORD)); 61 | connectionParams.put("auths", conf.get(OSMIngest.AUTHS)); 62 | connectionParams.put("tableName", conf.get(OSMIngest.TABLE_NAME)); 63 | } 64 | 65 | public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) { 66 | outputFieldsDeclarer.declare(new Fields("field")); 67 | } 68 | 69 | public void prepare(Map map, TopologyContext topologyContext, OutputCollector outputCollector) { 70 | final DataStore ds; 71 | try { 72 | ds = DataStoreFinder.getDataStore(connectionParams); 73 | SimpleFeatureType featureType = ds.getSchema(featureName); 74 | featureBuilder = new SimpleFeatureBuilder(featureType); 75 | featureWriter = ds.getFeatureWriterAppend(featureName, Transaction.AUTO_COMMIT); 76 | } catch (IOException e) { 77 | throw new RuntimeException("Unable to initialize feature writer", e); 78 | } 79 | } 80 | 81 | public void execute(Tuple tuple) { 82 | 83 | final String[] attributes = tuple.getValue(0).toString().split(","); 84 | 85 | // Only ingest attributes that have a latitude and longitude 86 | if (attributes.length == 2 && attributes[LATITUDE_COL_IDX] != null && attributes[LONGITUDE_COL_IDX] != null) { 87 | 88 | featureBuilder.reset(); 89 | final SimpleFeature simpleFeature = featureBuilder.buildFeature(String.valueOf(UUID.randomUUID().getMostSignificantBits())); 90 | simpleFeature.setDefaultGeometry(getGeometry(attributes)); 91 | 92 | try { 93 | final SimpleFeature next = featureWriter.next(); 94 | for (int i = 0; i < simpleFeature.getAttributeCount(); i++) { 95 | next.setAttribute(i, simpleFeature.getAttribute(i)); 96 | } 97 | ((FeatureIdImpl)next.getIdentifier()).setID(simpleFeature.getID()); 98 | featureWriter.write(); 99 | } catch (IOException e) { 100 | log.error("Exception writing feature", e); 101 | } 102 | } 103 | } 104 | 105 | private Geometry getGeometry(final String[] attributes) { 106 | try { 107 | final Double lat = (double)Integer.parseInt(attributes[LATITUDE_COL_IDX]) / 1e7; 108 | final Double lon = (double)Integer.parseInt(attributes[LONGITUDE_COL_IDX]) / 1e7; 109 | return geometryFactory.createPoint(new Coordinate(lon, lat)); 110 | } catch (NumberFormatException e) { 111 | log.error("Number format exception", e); 112 | } 113 | return null; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /geomesa-examples-spark/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 4.0.0 11 | 12 | 13 | org.geomesa.example 14 | geomesa-tutorials 15 | 5.5.0-SNAPSHOT 16 | 17 | 18 | geomesa-examples-spark 19 | GeoMesa Examples - Spark 20 | 2013 21 | 22 | 23 | 2.4.0 24 | 25 | 26 | 27 | 28 | 29 | 30 | org.apache.accumulo 31 | accumulo-core 32 | ${accumulo.version} 33 | 34 | 35 | org.apache.accumulo 36 | accumulo-start 37 | ${accumulo.version} 38 | 39 | 40 | org.apache.zookeeper 41 | zookeeper 42 | ${zookeeper.version} 43 | 44 | 45 | 46 | 47 | 48 | 49 | org.locationtech.geomesa 50 | geomesa-accumulo-datastore_${scala.abi.version} 51 | 52 | 53 | org.locationtech.geomesa 54 | geomesa-accumulo-spark_${scala.abi.version} 55 | ${geomesa.version} 56 | 57 | 58 | org.apache.accumulo 59 | accumulo-core 60 | 61 | 62 | 63 | 64 | org.apache.spark 65 | spark-core_${scala.abi.version} 66 | ${spark.version} 67 | provided 68 | 69 | 70 | org.apache.spark 71 | spark-catalyst_${scala.abi.version} 72 | ${spark.version} 73 | provided 74 | 75 | 76 | org.apache.spark 77 | spark-sql_${scala.abi.version} 78 | ${spark.version} 79 | provided 80 | 81 | 82 | org.apache.spark 83 | spark-yarn_${scala.abi.version} 84 | ${spark.version} 85 | provided 86 | 87 | 88 | 89 | 90 | 91 | 92 | src/main/resources 93 | true 94 | 95 | 96 | 97 | 98 | 99 | net.alchim31.maven 100 | scala-maven-plugin 101 | 3.2.1 102 | 103 | 1.8 104 | 1.8 105 | ${scala.version} 106 | 107 | 108 | 109 | scala-compile-first 110 | process-resources 111 | 112 | add-source 113 | compile 114 | 115 | 116 | 117 | scala-test-compile 118 | process-test-resources 119 | 120 | testCompile 121 | 122 | 123 | 124 | 125 | 126 | org.apache.maven.plugins 127 | maven-shade-plugin 128 | 129 | 130 | 131 | org.slf4j:* 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /geomesa-tutorials-common/src/main/java/org/geomesa/example/data/CvilleRICData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2018 Commonwealth Computer Research, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Apache License, Version 2.0 which 5 | * accompanies this distribution and is available at 6 | * http://www.opensource.org/licenses/apache2.0.php. 7 | */ 8 | 9 | package org.geomesa.example.data; 10 | 11 | import org.apache.commons.csv.CSVFormat; 12 | import org.apache.commons.csv.CSVParser; 13 | import org.apache.commons.csv.CSVRecord; 14 | import org.geotools.api.data.Query; 15 | import org.geotools.feature.simple.SimpleFeatureBuilder; 16 | import org.geotools.util.factory.Hints; 17 | import org.locationtech.geomesa.utils.interop.SimpleFeatureTypes; 18 | import org.geotools.api.feature.simple.SimpleFeature; 19 | import org.geotools.api.feature.simple.SimpleFeatureType; 20 | import org.geotools.api.filter.Filter; 21 | 22 | import java.io.IOException; 23 | import java.net.URL; 24 | import java.nio.charset.StandardCharsets; 25 | import java.time.Instant; 26 | import java.time.LocalDateTime; 27 | import java.time.ZoneOffset; 28 | import java.time.format.DateTimeFormatter; 29 | import java.util.*; 30 | 31 | public class CvilleRICData implements TutorialData { 32 | 33 | private SimpleFeatureType sft = null; 34 | private List features = null; 35 | private List queries = null; 36 | private Filter subsetFilter = null; 37 | 38 | public String getTypeName() { 39 | return "cvilleric-quickstart"; 40 | } 41 | 42 | @Override 43 | public SimpleFeatureType getSimpleFeatureType() { 44 | if (sft == null) { 45 | // list the attributes that constitute the feature type 46 | // this is a reduced set of the attributes from GDELT 2.0 47 | StringBuilder attributes = new StringBuilder(); 48 | attributes.append("entityId:String,"); 49 | attributes.append("dtg:Date,"); 50 | attributes.append("*geom:Point:srid=4326"); // the "*" denotes the default geometry (used for indexing) 51 | 52 | // create the simple-feature type - use the GeoMesa 'SimpleFeatureTypes' class for best compatibility 53 | // may also use geotools DataUtilities or SimpleFeatureTypeBuilder, but some features may not work 54 | sft = SimpleFeatureTypes.createType(getTypeName(), attributes.toString()); 55 | 56 | // use the user-data (hints) to specify which date field to use for primary indexing 57 | // if not specified, the first date attribute (if any) will be used 58 | // could also use ':default=true' in the attribute specification string 59 | sft.getUserData().put(SimpleFeatureTypes.DEFAULT_DATE_KEY, "dtg"); 60 | } 61 | return sft; 62 | } 63 | 64 | @Override 65 | public List getTestData() { 66 | if (features == null) { 67 | List features = new ArrayList<>(); 68 | 69 | // read the bundled t-drive CSV 70 | URL input = getClass().getClassLoader().getResource("cville-ric.txt"); 71 | if (input == null) { 72 | throw new RuntimeException("Couldn't load resource cville-ric.txt"); 73 | } 74 | 75 | // use a geotools SimpleFeatureBuilder to create our features 76 | SimpleFeatureBuilder builder = new SimpleFeatureBuilder(getSimpleFeatureType()); 77 | 78 | try (CSVParser parser = CSVParser.parse(input, StandardCharsets.UTF_8, CSVFormat.DEFAULT)) { 79 | for (CSVRecord record : parser) { 80 | // use apache commons-csv to parse the file 81 | // pull out the fields corresponding to our simple feature attributes 82 | builder.set("entityId", record.get(0)); 83 | 84 | // some dates are converted implicitly, so we can set them as strings 85 | // however, the date format here isn't one that is converted, so we parse it into a java.util.Date 86 | builder.set("dtg", Date.from(Instant.ofEpochMilli(Long.parseLong(record.get(1))))); 87 | 88 | // we can use WKT (well-known-text) to represent geometries 89 | // note that we use longitude first ordering 90 | double longitude = Double.parseDouble(record.get(2)); 91 | double latitude = Double.parseDouble(record.get(3)); 92 | builder.set("geom", "POINT (" + longitude + " " + latitude + ")"); 93 | 94 | // be sure to tell GeoTools explicitly that we want to use the ID we provided 95 | builder.featureUserData(Hints.USE_PROVIDED_FID, Boolean.TRUE); 96 | 97 | // build the feature - this also resets the feature builder for the next entry 98 | // use the taxi ID as the feature ID 99 | features.add(builder.buildFeature(record.get(0))); 100 | } 101 | } catch (IOException e) { 102 | throw new RuntimeException("Error reading cville-ric data:", e); 103 | } 104 | this.features = Collections.unmodifiableList(features); 105 | } 106 | return features; 107 | } 108 | 109 | @Override 110 | public List getTestQueries() { 111 | if (queries == null) { 112 | List queries = new ArrayList<>(); 113 | // this data set is meant to show streaming updates over time, so just return all features 114 | queries.add(new Query(getTypeName(), Filter.INCLUDE)); 115 | this.queries = Collections.unmodifiableList(queries); 116 | } 117 | return queries; 118 | } 119 | 120 | @Override 121 | public Filter getSubsetFilter() { 122 | return Filter.INCLUDE; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /geomesa-quickstart-python/tools/ECQL/queryFormatters.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | """ 4 | queryFormatters.py 5 | 6 | Description: 7 | These functions executes an ECQL query and either loads the results into a python 8 | dictionary or list, or writes it to a JSON file. Field names and java data type are provided 9 | in field_dict, where the dict key is the field name and the java data type is stored in 10 | "type". The type_dict provides functions to convert from java data types to python data 11 | types. 12 | 13 | Created by: Jordan Muss 14 | 15 | Creation Date: 4-11-2017 16 | Version: 1.0 17 | 18 | Dependencies: 19 | Public: jnius, json 20 | Private: ECQL, SetupJnius 21 | 22 | Interfaces: 23 | queryFeaturesToDict Execute a query, convert the java objects to python types, and load 24 | load the results into a python dict of dicts. The master dict is keyed 25 | by row number & each sub_dict is the entire row of data, keyed by 26 | field name. Warning, this seems to have a potential java memory 27 | leak, because some objects are not properly destroyed. 28 | 29 | queryFeaturesToList Execute a query, but append each record (a java object) to a python 30 | list, which is the returned object. Warning, this has a potential java 31 | memory leak, because the objects are not properly destroyed. 32 | 33 | queryFeaturesToJSON Execute a query, convert each row (a java object) to dict of python 34 | types keyed by field name. Each row dict is then written as a json 35 | object to a text file/ Warning, this seems to have a potential java 36 | memory leak, because some objects are not properly destroyed. 37 | 38 | Updates: 39 | 40 | To Do: 41 | """ 42 | from __future__ import print_function 43 | import json 44 | 45 | def queryFeaturesToDict(ecql, simpleFeatureTypeName, dataStore, filter_string, field_dict, print_num=10): 46 | ''' Return the results of a ECQL filter query as a dict for additional processing: ''' 47 | type_dict = {"date":lambda v : v.toString(), 48 | "double":lambda v : v, 49 | "float":lambda v : v, 50 | "integer":lambda v : v, 51 | "long":lambda v : v, 52 | "point":lambda v : {"X":v.x, "Y":v.y, "geom":v}, 53 | "string":lambda v : v 54 | } 55 | ''' Get field names and types for processing and type conversion: ''' 56 | fields = {key:val["type"].lower() for key, val in field_dict.items()} 57 | ''' Submit the query, which will return a features object: ''' 58 | features = ecql.getFeatures(simpleFeatureTypeName, dataStore, filter_string) 59 | ''' Get an iterator of the matching features: ''' 60 | featureIter = features.features() 61 | ''' Loop through all results and put them into a dictionary for secondary processing: ''' 62 | n = 0 63 | results = {} 64 | while featureIter.hasNext(): 65 | feature = featureIter.next() 66 | n += 1 67 | record = {} 68 | for key, fType in fields.items(): 69 | record[key] = type_dict[fType](feature.getProperty(key).getValue()) 70 | results[n] = record 71 | featureIter.close() 72 | if print_num is not None and print_num > 0 and n <= print_num: 73 | print("N|{}".format("|".join(record.keys()))) 74 | for i in range(print_num): 75 | p = "|".join(["{}".format(v) for v in record.values()]) 76 | print("{}|{}".format(i, p)) 77 | return results 78 | 79 | def queryFeaturesToList(ecql, simpleFeatureTypeName, dataStore, filter_string): 80 | ''' Return the results of a ECQL filter query as a list of GeoMesa java objects for additional processing: ''' 81 | ''' Submit the query, which will return a features object: ''' 82 | features = ecql.getFeatures(simpleFeatureTypeName, dataStore, filter_string) 83 | ''' Get an array (list) of the matching features as GeoMesa java objects: ''' 84 | results = features.toArray() 85 | return results 86 | 87 | def queryFeaturesToJSON(ecql, simpleFeatureTypeName, dataStore, filter_string, field_dict, out_file): 88 | ''' Return the results of a ECQL filter query as a dict for additional processing: ''' 89 | type_dict = {"date":lambda v : v.toString(), 90 | "double":lambda v : v, 91 | "float":lambda v : v, 92 | "integer":lambda v : v, 93 | "long":lambda v : v, 94 | "point":lambda v : {"X":v.x, "Y":v.y}, 95 | "string":lambda v : v 96 | } 97 | ''' Get field names and types for processing and type conversion: ''' 98 | fields = {key:val["type"].lower() for key, val in field_dict.items()} 99 | ''' Submit the query, which will return a features object: ''' 100 | features = ecql.getFeatures(simpleFeatureTypeName, dataStore, filter_string) 101 | ''' Get an iterator of the matching features: ''' 102 | featureIter = features.features() 103 | ''' Loop through all results and put them into a dictionary for secondary processing: ''' 104 | n = 0 105 | with open(out_file, "w") as json_file: 106 | while featureIter.hasNext(): 107 | n += 1 108 | feature = featureIter.next() 109 | record = {} 110 | for key, fType in fields.items(): 111 | record[key] = type_dict[fType](feature.getProperty(key).getValue()) 112 | print(json.dumps(record), file=json_file) 113 | del record 114 | featureIter.close() 115 | return n 116 | --------------------------------------------------------------------------------