Skip to content

vangav/vos_geo_server

Repository files navigation

why? geo server is a next level template for vangav backend where database and geo services utility are used

geo server

geo server backend design

prerequisite

functionality

  • transforms geo coordinates (latitude and longitude) into reverse geo code and geo hash
  • it also offers getting top queried continents and countries

overview

  • this service is based on vangav backend's geo server template
  • this service has the 90+% of the vangav backend's generated code + the 10-% of the logic code needed to complete the service

try this service

  1. for first timers - follow the steps in the system requirements tutorial
  2. for first timers - follow the steps in the workspace initialization tutorial
  3. download this vos_geo_server.zip project (from the green clone or download button up there) inside the workspace directory created previously (my_services) and unzip it
  4. rename unzipped vos_geo_server-master to vos_geo_server
  5. in the terminal cd to vos_geo_server/cassandra/cql/
  6. execute ./_start_cassandra.sh to start cassandra
  7. cd to vos_geo_server/cassandra/cql/drop_and_create/
  8. execute the command ./_execute_cql.sh gs_top_dev.cql to initialize the service's database tables
  9. cd to vos_geo_server
  10. start the service: ./_run.sh
  11. from your prefered client (we recommned postman) start trying the service; refer to the features and service references sections for reference
  • at the end to stop the service: press control + d in the terminal session where the service was started in (10)
  • to stop cassandra: execute ps auwx | grep cassandra to get cassandra's (pid) then kill -9 (pid) to stop cassandra

eclipse

  • follow the following steps to import the downloaded backend service in eclipse
  1. cd to the service's directory and execute the ./_eclipsify.sh script
  2. file > import > general > existing projects into workspace > next > set "select root directory" to my_services > under projects make sure that vos_calculate_sum is selected > finish
  3. double check the java version used for compiling the project: right click the project > properties > java compiler > enable project specific settings > compiler compliance level > 1.7 or 1.8

covered topics

  • generate a service with multi-entry-point api
  • generate a database
  • use the geo services utility

features

controller(s) feature
reverse geo code transforms request's latitude and longitude into reverse geo code (continent, country, city, ...) and geo hash
top continents and top countries returns the top queried continents and countries

service references

reference explanation
routes api routes
reverse_geo_coding reverse geo coding data
controllers.json api request/response's elements
gs_top.keyspace gs_top is the keysapce for all the tables keeping track of the most queried continents and countries
Global.java reverse geo coding initialization
common handles common operations like initializing the continents/countries names index
controllers api implementation
gs_top gs_top cassandra's keyspace client

change log

  • this section lists the 10-% code added after vangav backend generated 90+% of the code
file/dir change
conf/data added reverse geo coding data from vangav backend's data
Global.java added reverse geo coding initialization in beforeStart method
common contains common operations like initializing the continents/countries names index
controllers added the implementation of request processing logic under controller_name/HandlerControllerName.java classes and nested response json structures under controller_name/response_json packages

share

facebook share twitter share pinterest share google plus share linkedin share

free consulting

vangav's consultant