Giter VIP home page Giter VIP logo

geo_json_task's Introduction

API for GeoJSON for pincodes and area shapes

APIs

	Go To **http://localhost:5000/** to know more about the APIs methods and there data
  • post_location - to add a location to DB
  • get_using_postgres - to get nearby pincodes for given lat, long and distance, using postgres extensions
  • get_using_self - to get nearby pincodes for given lat, long and distance, using self calculations
  • get_containing_area - to get area in which the given lat, long exists

Pre-requisites

  • Flask
  • Postgresql

Step 1.

In postgresql shell write following commands to add extensions -

CREATE EXTENSION IF NOT EXISTS cube;
CREATE EXTENSION IF NOT EXISTS earthdistance;
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;

Step 2.

In postgresql shell write following commands to add area_codes table -

create table area_codes(
  pincode varchar(15) PRIMARY KEY NOT NULL, 
  place_name varchar(50), 
  state_name varchar(50), 
  lat float(5), 
  long float(5), 
  accuracy SMALLINT,
  g_point cube
);

Step 3.

In postgresql shell write following commands to add area_geojson table -

create table area_geojson(
  id SERIAL PRIMARY KEY, 
  place_name varchar(50) NOT NULL,
  parent_name varchar(50),
  type varchar(50),
  boundary_points polygon NOT NULL
);

Step 4.

Import Data via pgAdmin or python init.py import_data when area_data.json and pincode_data.json are in your root directory for geojson and area pincodes respectively

Step 5.

run the flask app python app.py

geo_json_task's People

Contributors

rashmisangwan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.