Skip to content

bscpnu/OpenLayersFromPostGIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Part 2. OpenLayersFromPostGIS

Components: PostGIS, OpenLayers, NodeJS, and Express with Jade

Program Assigment SDB Class, Pusan National University 2017

Imam Mustafa Kamal (201683609)

After sucessfully converting OSM data to PostGIS as shown in https://github.com/bscpnu/ConvertOsmPostGIS, in this part we display those data to the web.

Features list that will be displayed are as follow: Road, railroad, building, parking, park, industrial, barrier, platform, playing_field, plaza, water, waterway, grass and garden. Those features list are retrieved from tables: human_built, human_landuse, physiography_water, and physiongraphy_life.

First thing first, let's create an index for our data to make it more easily searchable using the following statement

CREATE INDEX human_built_gist ON public.human_built USING gist (geom);
CREATE INDEX human_landuse_gist ON public. human_landuse USING gist (geom);
CREATE INDEX physiography_water_gist ON public. physiography_water USING gist (geom);
CREATE INDEX physiography_life_gist ON public. physiography_life USING gist (geom);

Screenshot

  1. localhost:3000/map overview

  2. Select road layer road network

  3. Select spatial object select map

  4. Query data in rectangle area. input (xmin, ymin, xmax, ymax) = (-2.2364, 53.4823, -2.2301, 53.4862) select rectangle

Query : SELECT sym1, COALESCE(name, sym1) As name, ST_AsGeoJSON(geom)::json As geometry FROM public.human_built WHERE geom && ST_MakeEnvelope('"+xmin+"', '"+ymin+"', '"+xmax+"', '"+ymax+"', 4326).

From above figure (point number 4), it can reveal that all the spatial object overlapping with the given rectangle coordinate will be included.

About

#2 Program Assigment SDB Class, Pusan National University 2017

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors