Skip to content

volneineves/apirestdigitalinnovation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Construindo uma API Rest de consulta de cidades do Brasil do zero até a produção

Deploy Heroku

Distance:

Requirements

  • Git
  • Java 17
  • Docker
  • IntelliJ Community
  • Heroku CLI

DataBase

Postgres

//pgAdmin Query Tool:

CREATE DATABASE cities
    WITH 
    OWNER = postgres
    ENCODING = 'UTF8'
    CONNECTION LIMIT = -1;

Populate and implementation

//PSQL Tool:
CREATE EXTENSION cube; 
CREATE EXTENSION earthdistance;

Access

psql -U youruser cities

Query Earth Distance

Point

select ((select lat_lon from cidade where id = 4929) <@> (select lat_lon from cidade where id=5254)) as distance;

Cube

select earth_distance(
    ll_to_earth(-21.95840072631836,-47.98820114135742), 
    ll_to_earth(-22.01740074157715,-47.88600158691406)
) as distance;

Spring Boot

  • Java 17
  • Maven Project
  • Jar
  • Spring Web
  • Spring Data JPA
  • PostgreSQL Driver

Spring Data

Properties

Types

Heroku

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages