Get Band Information from WMS Geoserver Leafletjs

Get Band Information from WMS Geoserver Leafletjs. Band Information from Layer: In its simplest form, a raster consists of a matrix of cells (or pixels) organized into rows and columns (grid), where each cell contains a value representing information, such as temperature, precipitation or elevation etc. Rasters are digital aerial photographs, imagery from satellites, digital pictures, or even scanned maps.

Get Band Information from WMS Geoserver Leafletjs

Data stored in a raster format represents real-world phenomena – Get Band Information from WMS Geoserver Leafletjs:
  • Thematic data (also known as discrete) represents features such as land-use or soils data.

  • Continuous data represents phenomena such as temperature, elevation, or spectral data such as satellite images and aerial photographs.

  • Pictures include scanned maps or drawings and building photographs.

You may check different multidimensional multiband files like Grib files, NetCDF files and Hdf5 files.

There are three main ways to display (render) single-band raster datasets:
  • Using two colors—In a binary image, each cell has a value of 0 or 1 and is often displayed using black and white. This type of display is often used for displaying scanned maps with simple line work, such as parcel maps.

  • Grayscale—In a gray scale image, each cell has a value from 0 to another number, such as 255 or 65535. These are often used for black-and-white aerial photographs.

  • Color map—One way to represent colors on an image is with a color map. A set of values is coded to match a defined set of red, green, and blue (RGB) values.

When there are multiple bands, every cell location has more than one value associated with it. With multiple bands, each band usually represents a segment of the electromagnetic spectrum collected by a sensor. Bands can represent any portion of the electromagnetic spectrum, including ranges not visible to the eye, such as the infrared or ultraviolet sections. The term band originated from the reference to the color band on the electromagnetic spectrum.

Get Band Information from WMS Geoserver Leafletjs
Get Band Information from WMS Geoserver Leafletjs

This demo shows the raster overlay on map with the help of Leaflet javascript library. The raster contains three bands as Red, Blue and green. Here raster data is in GeoTiff format and is published on Geoserver. This demo is about how one can extract the Bands information from layer. In similar way we can also extract values such as elevation, any natural hazards distortion or changes in data from layers.

Get Band Information from WMS Geoserver Leafletjs

For this demo we have downloaded data from  from one of the free data download website. It is a raster data containing three bands as blue, red and green. In this demo we render raster data on map and shown the value of bands using popup.

Raster data on GeoServer and styling:

GeoServer is an open source server for sharing geospatial data in both vector format and raster format. It is designed to host major datasets, which can easily render on maps.

To Download and install GeoServer please follow the last article. Then login to the GeoServer and publish data on the Geoserver and get the link from layer preview section. You can visit the articles to know how to publish and style the GeoTiff file on Geoserver and also how to make geotiff work with geowebcache for tiling.

For rendering layer on map, you need to create division for map.

var map = L.map('map').setView([34.84859848,-111.788002],5);
  L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href=”http://osm.org/copyright”>OpenStreetMap</a> contributors'
  }).addTo(map);
Render Raster on Map:

To render this data on map, we need to get the data from GeoServer, which can be done by using leaflet javascript library. In the Leaflet library, we have Leaflet-WMS plugin.

<script src="leaflet.wms.js"></script>
What is WMS service:

WMS (web map service), is a way of publishing maps. This format is similar to map tiles, but more generic. A WMS image is defined by the coordinates.

L.tileLayer.wms: It provides a simple interface for loading tiles from a WMS service. Here we also need to provide layer name, format of layer and make transparent as true.

var raster = L.tileLayer.wms('http://139.59.42.235:8080/geoserver/portfolio/wms?',{
    layers: 'HYP_HR',
    format: 'image/png',
    transparent: true
}).addTo(map);

In this way we can render raster data and have layer information. This information further can be used for analysis purpose. For example we can have vegetation index (NDVI) from values of bands. We can actually calculate the loss information if having two time series band information.

function showGetFeatureInfo(latlng,layer){
 var prop = layer.features[0].properties;
 var mark=L.marker([latlng.lat,latlng.lng]).addTo(map);
 var blue=prop['BLUE_BAND'];
 var green=prop['GREEN_BAND'];
 var red=prop['RED_BAND'];
 mark.bindPopup("Blue Band: "+blue.toString()+"
 <br>Green Band:"+green.toString()+"
 <br>Red Band:"+red.toString());
 document.querySelector('#demoR').innerHTML=red; document.querySelector('#demoB').innerHTML=blue; document.querySelector('#demoG').innerHTML = green; }
Get Band Information from WMS Geoserver Leafletjs
Get Band Information from WMS Geoserver Leafletjs

Check more:

Large GIS Data file on Web

Speed up the rendering of data

Comment below if you found any issue in getting band information in the box provided. Thanks.

GeoServer Tiling – Web Cache Load WMS layer Fast

Here we will find out how to implement GeoServer Tiling to make wms tiles load fast.

Tile Layers from geoserver:

The need of tile layer is to speed up the rendering of data. It is similar to the Layer Preview for GeoWebCache. There are png, jpeg, geotiff many formats available to store the tiles. In all the format png is considered as fastest format to render data with geoserver.

Advantages of GeoServer tiling

Rendering is done by the client (for example, OpenLayers or leaflet), not by the server. This allows different maps/applications to style a map differently without having to reconfigure GeoServer.

The size of a vector tile is usually smaller than an image tile, resulting in faster data transfer and lower bandwidth usage.

GeoWebCache, embedded with GeoServer efficiently stores the vector tile data. Since styling is done by the client, not the server, GeoWebCache only needs to store one tile for all different styles.

Because the vector data is available on the client, very high-resolution maps can be drawn without corresponding increases in bandwidth.
The client has native access to the actual feature information (attributes and geometry), allowing for very sophisticated rendering.

For each layer, GeoServer has some information such as

1. Type: type of layer i.e. line, point or polygon layer
2. Layer name: name of the layer,
3. Disk quota: The maximum amount of disk space that can be used for this layer,
4. Disk used: The current disk space being used by tiles for this particular layer,
5. Enabled: shows whether tile caching is enabled for this layer,
6. Preview: Similar to Layer Preview, this will generate a simple OpenLayers application populated with tiles from one of the available gridset/image format combinations.
7. Action: It has two option seed/truncate or empty. Whereas seed/truncate option opens the GeoWebCache page for automatically seeding and truncating the tile cache and empty option removes all saved tiles from the cache.

Adding GeoServer Tiles

If you have already published your layer on GeoServer, and want it to be in tiles you can follow the procedure given below.

i.) First of all publish your layer with proper name and style. To know how to publish layer on GeoServer you can visit previous articles based on GeoServer.

ii.) Then go to Tile Layer option under Tile Caching. Then search your published layer in list.

iii.) Now you can open that layer as png or jpeg in preview/openLayer option or before that you can seed the layer. Seed layer is nothing but an option where you can decide the zoom level for the layer and hence number of tiles in layer.

While seeding you need to provide the given requirements mentioned below:

a) Number of threads to use:

Possible values are between 1 and 16.

b) Type of operation:

Sets the operation. There are three possible values: Seed (creates tiles, but does not overwrite existing ones), Reseed (like Seed, but overwrites existing tiles) and Truncate (deletes all tiles within the given parameters)

c) SRS (Spatial Reference System):

Specifies the projection to use when creating tiles (default values are EPSG:4326 and EPSG:900913)

d) Format:

Sets the image format of the tiles. Can be application/vnd.google-earth.kml+xml (Google Earth KML), image/gif (GIF), image/jpeg (JPEG), image/png (24 bit PNG), and image/png8 (8 bit PNG)

f) Zoom start:

Sets the minimum zoom level. Lower values indicate map views that are more zoomed out. When seeding, GeoWebCache will only create tiles for those zoom levels inclusive of this value and Zoom stop.

g) Zoom stop:

Sets the maximum zoom level. Higher values indicate map views that are more zoomed in. When seeding, GeoWebCache will only create tiles for those zoom levels inclusive of this value and Zoom start.

h) Bounding box:

(optional) Allows seeding to occur over a specified extent, instead of the full extent of the layer. This is useful if your layer contains data over a large area in GeoServer, but the application will only request tiles from a subset of that area. The four boxes correspond to Xmin, Ymin, Xmax, and Ymax.

iv.) After giving all this, you need to submit these details. After that you will be having a list containing Id, Layer, Status, Type, Estimated number of tiles, Tiles completed, Time elapsed, Time remaining and Tasks. In this list you can check the number of tiles whether it is too high or too low. It should be balanced if it is too high the data size would be high if to low then zooming will not be proper. The number of tiles depends upon zoom start and stop. If difference is very high then number of tiles will be more and vice versa, so it is advised to keep the zoom stop level less than 20.

v.) Before open this layer you should reload the configuration then open it as png and jpeg format under openLayer option.

OUTPUT of GeoServer Tiling-

You must notice that png format would open fast than jpeg format.
The images given below has left side Jpeg format and right side png format. So it is clear that tile in png format render faster than jpeg or any other format.

GeoServer Tiling
GeoServer Tiling

You also can visit Install Geoserver in linux operating system, Install GeoServer in Windows operating system, Publish and style Raster data on GeoServer, Publish and style Vector data etc.

If you find any problem during implementing this tutorial, please let us know. Feel free to comment in given comment box provided below.

Create and Measure Map Polygon Area – Quick Help

Creating Polygons shapes on digitized lands is easy as we already have some tutorial created for creating polygon with leafletjs. But ever wondered what should one do when they need to Create and measure Map Polygon area? The solutions for small challenges like this, which appears to be big for developers who didn’t worked on GIS earlier, is what we are providing here at Engineer Philosophy Web Services.

This case happened when one of the United States based ERP company, which operates in multiple countries, wants to provide a small GIS solution to be intergrated in their existing ERP system to their fertilization and agricultural sector client. As their client need a quick POC (Proof of concept) to digitize their land and calculate area in acres, they need a quick solution to be created. As their team is not expert in GIS and doesnot know which technology to opt for, they approached us around mid-night through our website chat box, as we provide 24/7 assistance with chat at our website. Quickly after talking to us and checked our ability, they turned to our GIS Consultancy Services, which helps them in getting solutions and consultant related to leaflet, geoserver or any other GIS related issues.

The Challenge – Create and Measure Map Polygon Area

Sometimes Mapping and Drawing Shapes can be challenging

Being a large ERP organization which operates with fertilization and agriculture clients to deliver and support its services to end user. Given the immediate nature of on-demand services, they expect instant support and exceptional services from us. This created a colossal consumer service challenge.

  • They needed assistance on setting up basic mapping within their .Net application which will then can be incorporated into the ERP system.
  • They needed tool for measure the polygon shape area that their clients will map on digitized lands from the ERP.
  • The Company also required an add-on, i.e. Geocoding along with maps, which can provide geographical coordinates corresponding to a particular location or address which their client might type in to search their address.

The Solution- Create and Measure Map Polygon Area

There is nothing Like Leaflet.js when it comes to mapping

To address these challenges, we analyzed and documented different solution which we can provide in an next hour. We suggested two best options with all the calculation of pros and cons for them –

The company decided to go with Leaflet.js, as it is open-source which saves them a reasonable amount of capital.

Then we worked on the solutions as follows –

  • Initially we used the Leaflet.js Draw plugin to create and digitized polygon which can be digitized, deleted and edited easily.
  • We also used Turf.js for evaluating the polygon area drawn on the digitized map because it gives more approximate results then the Leaflet.js Draw plugin.
  • When the company decided to go with the open source software, we again provided them with two options in their best interest i.e. MapQuest API and MapBox API for Geocoding purpose.
Final Result : Create and Measure Map Polygon Area
Geocoding : Create and Measure Map Polygon Area

Once we are done with coding part in next 3 hours, we showed the solution to the organisation. Get the feedback corrected some User Interface stuff and provided code to their developers. In an 1 hour we helped them to understand the code and integrate the same with their system.

The Result – Create and Measure Map Polygon Area

We are best in Overcoming challenges and providing the Best GIS Consultancy

We provided solutions for every concern related to map and gis challenges to the ERP company developers.

Final Result : Create and Measure Map Polygon Area
Final Result : Create and Measure Map Polygon Area
  • Provided hands-on assistance in setting up basic mapping within their .Net application which will then can be incorporated into the ERP system.
  • Consultancy and hands-on assistance with evaluating polygon area on digitized lands with Leaflet.js and the same saved polygon should be reopened and edited from the system.
  • Provided wonderful tool for Geocoding along with the maps and assistance on implementing it.

We here at Engineering Philosophy Web Services provides Services and Consultancy related to Leaflet.js, Geoserver, Geocoding, Web/App development and Other GIS tech factors.

Fleet Management System – Requirement | Features | Cost

This blog post describes a detailed overview of fleet management system – Requirement, Time, Technology and functionality. All features of Fleet Management Systems are going to be provided in this post in details.

Fleet Management System:

Fleet Management System is the range of functions which allows transportation companies in business to minimize the risk related with the improving efficiency, proven return on investment, productivity in business and reducing the overall cost.
It is a modular based system that has been developed for the group of transportation or large companies using fleets/vehicles with the sole intention of operating the business in a timely manner and reliable way.
Fleet management includes a range of functions like tracking valuable assets; automate the fleet reports, Management of vehicles and security & control of the fleet.
We provide simple and versatile fleet management system which is backed up by mobile access and live support. We emancipate your fleet with the sharpest technology, outstanding features and 24 hr access.
Now you can have more time to achieve your destination then less time to worry about the fleet operations and route.

Requirement Gathering:

  • What do client requires?

    We have an absolute idea of our client’s needs for the Fleet Management System in their business, so here is a list of some main requirements we think that every client would want in their Fleet management system.

    • Reduce fleet management time and cost
    • Integrate fleet planning and execution
    • Real time tracking of fleet which includes vehicle tracking, driver detail and asset details.
    • Fleet scheduling management for on-time deliveries and customer service.
    • Automation of fleet reports.
    • Management of fleet/vehicle Maintenance
    • Fleet utilization management
    • All time fleet monitoring
    • Route tracking
    • Expense tracking
    • Fleet analytics
  • Hardware requirements:

    Implementation of fleet management system would require hardware entities for Real time tracking of fleets and driver, which can be listed as:

    • Mobile Phones (iOS/Android/Windows): Any Mobile phone with the driver with GPS enabled in it can be used for the real time tracking of the vehicle and the driver. This provides you the location access to any of the mobile or immobile fleet.
    • GPS Device: Live GPS tracking devices are ideal for most vehicle tracking needs. With live GPS tracking systems in the fleet, you can have access to real-time data about vehicle location, use, driving speed and etc. This can be used to track driving habits, route vehicles more effectively, keep tabs on equipment that is at high risk of theft, and improve your dispatch processes.
      You can use both of these for the combine and separate tracking of the fleet and the driver.
  •  Software requirements:

    These are some software requirements for the implementation of the fleet management system:

    • Server: We can use any server for this management system but we prefer these two servers to be precise that we will be working on:
      1. NGINX Server – Nginx is an open source web server which can handle a website with a huge amount of traffic. It is a high performance web server developed with an intention to handle websites with large number of users. Its speciality is that it can run on a minimal amount of resources and handle a large number of requests.
      2. Digital Ocean Server – Digital ocean server or ‘droplets’ is a cloud server which is designed to store and server massive amount of data while making it easy and cost effective. Digital ocean server use KVM as hyperviser and can be created in various sizes. It helps in build deploy and scale cloud application faster and more efficient

      We personally recommend to use Digital Ocean Server, as it is much faster, easy and cost efficient.

    • Socket connection: One of the main software components of the Fleet management system is socket communication server. It is a central server component that communicates with the tracking units. Socket connection is capable of communicating with multiple clients units using multiple threads as it establishes TCP/IP socket connection with the remote hardware units. When the fleet GPS is connected, the server will authenticate the connection and proceed to receive information from the device.
    • RabbitMQ: RabbitMQ is the most used open source message broker software. It originally implemented the Advance message Queuing Protocol, which we will be using in this system. If we add single entries from server multiple times in database it will lock itself. So for preventing that from happening we will use RabbitMQ, which stores a information until a receiving server connects and takes a message off the queue. The receiving server then processes the information in an appropriate manner. So we can insert bulk information in the database in particular time as we want.
    • Database: We will be using any of these two databases for storing the data we collected from the tracking devices of the fleet:
      1. PostGIS/PostGreSQL
      2. MySQL
    • Mapping Systems: This is the main software component of the Fleet management system. This whole system is dependent on the web mapping of the data or information that the GPS devices provide. For mapping the data we can use any of these two Mapping systems.
      1. Google Maps: Google Maps is the tool which is used to display geographical information on a map which is in a widely accepted standard format for digital maps.
      2. OSM (Open Street Map): OSM is the software that creates and distributes the open source graphic data of the world. OSM has no restriction of technical or legal type. It allows free access to its map images and underlying map data. Here we can show our tracking data in real time.

    Features:

    •  Managing vehicles:

      We will provide you all the information regarding the fleet/vehicles in the web portal’s dashboard like vehicles insurances details, vehicle renewable reminders and Maintenance/service reminders for vehicles etc. Our system provides automated reports for every penny you spent on the vehicle and each expense you are going to do in meantime. We provide vehicle orders bar where you can manage orders and get previous order details.

    • GPS Tracking:

      The tracking unit collects the location information with the help of the GPS (Global Positioning System) device which we used in our system as hardware. Global Positioning System can be used for providing the route to the fleet. GPS formats collected information into the system–specific packet format and sends it to server via socket connection server. Global Positioning System tracking system uses the Global Navigation Satellite System (GNSS) network. This network incorporates a range of satellites that use microwave signals that are transmitted to GPS devices to give information on location, vehicle speed, time and direction by which we can manage Real time tracking of fleet which includes vehicle tracking, driver detail and asset details and Fleet scheduling management for on-time deliveries and customer services.

    • Speed tracking:

      Driving with excessive speed is one of the main factors in fatal road accidents. Driving at a safe speed can help save lives. Fleet managers have an interest in keeping their drivers on the road and out of the troubles, and they also want to ensure that their fleet is operating in an efficient and timely manner. Speed tracking and reporting is a principal feature in Fleet Management System. In terms of reporting, our systems will report all offences to base in real time (even have the capacity to set an SMS alert).

    • Geofence:

      Geofence is described as the circular areas which are defined around a particular location. It is set by the client in Fleet Management system by able to define the radius of the area. The GPS location of the center of the circle and the radius define a Geo-fence. If a vehicles GPS location is within the Geofence, then they are in safe area and if any vehicle go outside the area of geofence the client is notified by a text or email alert and the event is recorded.
      geofence- fleet management system

    • Automate the fleet report:

      We surely provide the automated report on each transaction or order. We provide automated report of the previous orders of fleet which you can check any time or download the file.

    Cost:

    Contact us at our mail or put a comment below to discuss the expected cost.

Large GIS Data file on Web | GeoServer Importance

Render Large GIS Data file on Web | GeoServer Importance. For producing any detail map, we need to have large detailed dataset. If it is about country level or world level analysis data it may create huge problems with huge dataset. It can hang your system or slow down it if not used properly. Even for browser it is dangerous because browser takes time or get in not responding mode. More than this you want to change or query data with rendering it on map, this will take much of your precise time. Here is what we are going to discuss how should we avoid rendering the large vector layer from leaflet js or any other library in browser and instead, look for the server side tile to render the same as like GeoServer.

Render Large GIS Data file on Web | GeoServer Importance

To solve this problem we use some servers which can handle the dataset and provide us when required. For the map data we have one the great solution that is geoserver. What is geoserver and how it is helping us? geoserver is an open-source server written in Java that allows users to share, process and edit geospatial data. It helps us to display the information to the world. It has a great feature that using WMS standards it provides variety for output format.

What is WMS – WMS helps in rendering Large GIS Data file on Web

It is the Web Map Service Interface Standard (WMS) provides a simple HTTP interface for requesting Geo-registered map images from one or more distributed geospatial databases. A WMS request defines the geographic layers and area of interest to be processed. The response to the request is one or more Geo-registered map images (returned as JPEG, PNG, etc) that can be displayed in a browser application. The interface also supports the ability to specify whether the returned images should be transparent so that layers from multiple servers can be combined or not.

Using this with leaflet or Openlayer we can easily create beautiful and interactive maps. It also uses WFS standards, which gives us permission to actually edit and share the data to generate maps. This is also integrating with some popular API such as Google Maps, Google Earth, Yahoo Maps, and Microsoft Virtual Earth. In addition, GeoServer can connect with traditional GIS architectures such as ESRI ArcGIS. Now you might be thinking how geoserver is handling this much of data. Lets explore this topic next.

If you are just starting with Geoserver, then you look for install geoserver in windows or install geoserver in ubuntu system. Looking for further web development with geoserver then you can check out other articles too i.e GIS Web Development with geoserver, leaflet and postgis, publish GIS data with api in geoserver, styling raster data  and vector data style and other operation like split polygon with WFS in Geoserver.

How Geoserver handles Rendering for Large GIS Data file on Web

The reason is OCFS2 (Oracle Cluster File System 2) , which is a free, open source, general-purpose, extent-based clustered file system which Oracle developed and contributed to the Linux community, and accepted into Linux kernel 2.6.16. Building on Oracle’s long-term commitment to the Linux and open source community, OCFS2 provides an open source, enterprise-class alternative to proprietary cluster file systems, and provides both high performance and high availability. Cluster- aware applications can leverage cache-coherent parallel I/O for higher performance, and other applications can make use of the file system to provide a fail-over setup to increase availability.

Other than this geoserver is having 16 GB memory and geoWebCache has 16 to 32 GB memory. One of reason for high speed performance of geoserver is GeoWebCache. As when new maps with vector data and raster data as tiles are requested, GeoWebCache intercepts these calls and returns pre-rendered tiles if stored, or calls the server to render new tiles as necessary. Thus, once tiles are stored, the speed of map rendering increases by many times.

This way you should use GeoServer or any other Server side Tools or Software to render Large GIS Data file on Web. I hope you find this article helpful the importance of GeoServer. If you have any suggestions or questions to ask, do comment below. Thanks.

PostGIS, Geoserver and Leaflet | GIS Web Development

In this article we will see how data can query in Postgres and store and view at Geoserver and Leaflet i.e GIS Web Development with PostGIS, Geoserver and Leaflet. For this you will require setup of all three. You can visit our tutorial to install Geoserver For Linux or geoserver install in windows, Postgres and Postgis installation for Ubuntu 16.04. and a basic of Leaflet Js Javascript Library. If you are done with intial setup, then we can first start with to adding Shapefile in postgres by creating  database in database.

PostGIS, Geoserver and Leaflet | GIS Web Development – Steps

Step 1: After installing Geoserver and Postgress postgis in your system you need to download dataset. The data we are using is shapefile for this tutorial, which you can download from the sources given in this post. The shapefile can be administrative boundary or road network etc. For any region. This website will help you to download zip file as well, which will have all supporting file for shapefile.

Step 2: Now you need to open Postgres, add database, table and add shape file using shp2pgsql. This all has been explained in our tutorial.

Step 3: Start Geoserver by running shell file provided in bin folder of geoserver. That can be run by executing the given command on terminal.

cd <path to Geoserver/bin>
sh startup.sh

Then Open browser and type

http://localhost:8080/geoserver 

and login by using your credentials. Generally its admin as username and password as geoserver.

Step 4: Now create a new workspace on Geoserver. Now Move to workspace option in data section by providing required information. Create new store as PostGIS and provide information required.  Here you need to give workspace name and data source name you created. If you want you can write the description about your data.

PostGIS, Geoserver and Leaflet | GIS Web Development
PostGIS, Geoserver and Leaflet | GIS Web Development

Now you need to provide connection parameter.

PostGIS, Geoserver and Leaflet | GIS Web Development

Dbype is the type of database, you can leave it as default or can specify your database type. Host and port: these are the parameter, which help geoserver to connect with postgres. The Host is space where database exist. The port to connect with postgres host, you can provide if you have set any otherwise make it as 5432.

Database: this is the database, which you have created using postgis. You are not sure about the name you can check it on pgAdmin or in terminal.

\l : this will provide you the list of available database. For this you must work with proper user-name.

Schema: to know your table, which you have created in database you can execute \d as this will provide you list of table associated database with their schema.

User and Password: this the USER with whom you have created database. In postgres you can create a new user with proper password.

Namespace: Namespace to be associated with the database. This field is altered by changing the workspace name. Remaining option you can leave as it is. And save the information.

Stpe 5: Now open the Layer option in data section, searched for your workspace and publish the layer.

Stpe 6: Here you will see tabs as data and publishing. In data tab you need to provide the reference coordinate system (CRS) by clicking on compute from data or compute from native bounds. After this you can save this layer with default styling. If you want to style your layer, which includes color, symbols etc. You can visit our tutorial styling vector data.

Step 7: Now moving to layer preview option in same data section. Here you can see your shape file.

Step 8: The shape file now can be render on map using leaflet javascript library.

For that you need to create HTML file, add leaflet library. After this create a div, which will contain map. Using L.map() and initialize the map and set view using setView() this takes center latitude longitude and zoom as arguments. You can check how to load a layer of polygon, point or polyline in leafletjs.

After that the shape file using L.TileLayer.WMS() , provide the base WMS URL, and specify whatever WMS options you need. The option can be layer, transparent and format etc. After this  use addTo() function to add layer to initialized map. Open that HTML file on browser to see the map with rendered shapefile.

Hope this PostGIS, Geoserver and Leaflet | GIS Web Development helped you in creating a map layer of shapefile which is loaded in postgis, and added the wms layer from geoserver which is then served as map in browser with leafletjs. If you find any problem in understanding the same, do let us know by commenting below.

GIS in Healthcare Industry – Mapping, Tracking, Discover

Healthcare Industry or the Public healthcare Industry deals with public medical care on a very large scale and there are many outbreaks and crisis happens some particular areas or some routes. The Ability to map out  and visually represent a region is necessary for planning responses to health crises and  identified outbreaks which is done by GIS in Healthcare Industry.

GIS in Healthcare Industry :

In this post we are going to focus on How can we use GIS in Healthcare Industry and for that let us first talk about Healthcare Industry.

Health care industry is one of the most important and organized sector in the world, It deals with public medical care on a vast level. Health care industry is just beginning to realize the tremendous potential of GIS to benefit the public medical care. Either private or public organisation, both sectors are evolving innovative ways to harness the data integration and spatial visualization tech, which can be used with GIS in Health Industry.

Now That we had a brief of Healthcare Industry, lets discuss how would they make use of GIS in their working. GIS is helping every sector and so does it with the Health care. So lets see the benefits of the GIS in Healthcare Industry.

Benefits of GIS in Healthcare Industry :

Healthcare Industries are using the resource integration capabilities of geospatial technologies to create analytical and descriptive solutions for major health issues. Geographical Information System impersonates an important role in improving the quality of care, integrating and analyzing clinical data — alongside environmental data, increasing accessibility of services, finding cheap cost delivery modes, and preserving patient confidentiality while satisfying the needs of the research community for data accessibility.

Here we list out some of the main benefits of using GIS in Healthcare Industry:

  • Mapping :

    GIS uses maps to analyze and understand the location of doctor or patients or hospitals. GIS mapping of data helps you make informed decisions with a web portal or application. It can provide a web- based portal for every patient or doctor, as you can find your closest doctor or right doctor for your specific need etc. This System includes comprehensive hospital listing locations and the no. of healthcare and social associated employees. These data provide a complete framework for exploring care provider locations.
    Mapping - GIS in Healthcare Industry

  • Tracking :

    Tracking is one of the most powerful aspect provided by GIS in Healthcare Industry. It has ability to use geography and other inputs to identify many new aspects. Let us discuss about two of them.

    1. Tracking of Infectious Diseases : GIS can identify where diseases are most likely to spread next when an Infectious disease is effecting over a wide range of area. Collecting this kind of data can be essential to on-ground working personnel working to save lives because it enables them to prepare in advance for a disease and can severely impact.
    2. Tracking Children Immunizations : GIS tracking can also be used as tracking child immunizations. GIS provides a way to move data from the project level so that it can be used by the entire organization, as it is used to gain a better understanding of Immunizations rates to determine which locations could be rescued during an outbreak.

    Tracking - GIS in Healthcare Industry

  • Helps in Research – GIS in Health Care:

    For broad regional treatment plans the collection of vast amount of accurate personal data is expected to reveal a great deal, but it can also greatly impact personalized healthcare. It has the potential to uncover long-term geographic trends in the health of certain demographics of people living within certain regions of the world.  If the people or individuals have same health condition on same regions, like in a particular area, 70% of the population is suffering from the same common disease. So we can discover about why they all have the same disease? and we could open new realms of healthcare research.
    Research - GIS in Healthcare Industry

  • Discovering Health Trends – With GIS Tool :

    The Geographical Information System provides healthcare industry personnel the ability to recognize health related trends. The GIS offers public healthcare target healing endeavor based upon the result of health related trends. GIS offers a method for health care professionals in which they can address where the diseases are more prevalent or likely to be  widespread in mean time and proactively begins implementation of preventative strategies or begin staffing skilled medical specialists healthcare professionals.

  • Improving Healthcare Services by GIS tool :

    The Geographical Information System helps in identifying the greater needs of specific healthcare services in a large area or country. GIS helps in providing  quick access to medical records, which is crucial to effective treatment. The use of GIS improves national healthcare services as it enables leaders and developers to work more closely with hospitals. And healthcare to take larger steps in addressing national healthcare needs. The geography of health care systems, which  deals with  the planning, management and delivery of suitable health services after determining healthcare needs of target community and service catchment zones. Improving healthcare services is the most important benefit of using GIS in Healthcare Industry.

So, This is how Healthcare System is using GIS for performing their tasks more efficiently. Geographical Information System is a powerful tool that has been successfully implemented to assist address a number of noteworthy health issues ranging from mapping to improved services. Using GIS in Healthcare System is one of the best method to have some control over the management and services. As the healthcare professionals start to adopt and integrate GIS. The number of benefits is likely to rise including the relationship between hospitals and communities. Which is perhaps the most important connection to be made.

Do let us know how this Article is helpful for you, by commenting below in the comment box.

GIS in Banking Sector – Scope | Benefits | Uses

In last decade, the Banking sector has been undergone drastic changes, reflecting a huge development in services. The impressive advancements in communication and information technology accelerated and broadened  the expansion of financial information and services in the first place. As a matter of fact there is an imperative necessity to standardize the industry processes through interactive portals and location analytics. As both these sectors are location-based, by understanding the location of customers and their transactions, they can better manage the branch networks. It will also enable them to understand the competition and regulators. In this post we are going to focus on one of the key component of banking sector i.e GIS and Find out How useful is GIS in Banking Sector.

GIS in Banking Sector – Scope | Benefits | Uses

A customer-centric business model can help address the challenges in banking sector like ease of usability, skimming, web hacking and problems with customer services. Financial product and services and delivering them to customers are the  major functions of banks. One of the required feature of Banking industries and financial services is Market analysis.

Banks and Financial services manages a ton of information data about their consumer, consumer’s profile and so much more, so database management for bank data and customer relationship management is one of the main functions of the banks and this can be easily achieved by the GIS. Using GIS in banking sector or Geographic modeling with future plans provides paramount benefits to the banking industry.

Benefits of GIS in Banking Sector :

  • Expansion of Customer base and managing its database
  • Improving Quality of the Services using GIS
  • Increasing Consumer Satisfaction
  • Consistent Business/ financial Growth and expansion
  • Increase in Profitability

GIS can help in banking sectors various functional areas by providing support in decision-making and strategic planning of the Business and consumer. Effective resource management and operations management can possible by adopting GIS in banking sector.

How Useful and important is GIS in Banking Sector

  • Customer Analysis and Management: Customer analysis is useful in determination of customer characteristics like characterizing market segmentation of locations. It can help in convert a Postal address to a location reference such as to its corresponding position on the map. Catchment area for the branches can be drawn and areas which are not served can be easily identified. It helps displaying customers location on map in relation to a bank branch.
    customers - GIS in Banking Sector
  • Market Analysis : Defining the target group of audiences/customers for banks, we need GIS to develop the market segmentation. Marketing is a customer-orientated operation that is essential for business success of any bank. GIS based marketing analysis proves relevant and useful in understanding financial needs of market and potential customers for their finance products and services. GIS helps in pinpoint demand and supplies to their geographic locations.  It also reveals the importance of geo-demographic research to marketing.
  • Performance monitoring : Using GIS in banking sector, you can analyze and monitor performance of the branches using spatial components. GIS component of a branch review involves defining a trade area and identifying the nearby competitors. It can also help in drawing potential customers zones based on the spatial distribution of the customers.
    monitoring - GIS in Banking Sector
  • Asset Management: Bank management needs to monitor a large amounts of information over an ever-changing inventory of physical assets. GIS helps us in managing Banks all the modern or traditional assets. This makes it possible to operate, maintain, and upgrade physical assets cost-effectively. Asset management includes management of mortgaged properties location and cost. As well as online tracking of cash status in ATMs and their distribution by using cash Van Fleet management. the spatial components  puts requirements to maintain minimum asset condition.
    Asset- GIS in Banking Sector

Banking Sector manages all over world’s customer information, and the GIS in Banking sector database manages the data and customer relations of the bank. Geographic modeling with astonishing future plans provides crucial benefits to banking sector. GIS in banking can work as a strategic tool providing a competitive advantage. Geography based network analysis can be used for better business opportunities and will allow better understanding of market strength.

Do let us know how this Article is helpful for you, by commenting below in the comment box.

 

Traffic Congestion Modelling – GIS

In this modern society’s substructure, roads behave as the key medium for transportation and lending a great deal to the allocation of goods, funds and individuals.  The trend of urbanization, the increase in population and increase in number of registered vehicles on roads induces pressure on traffic movements and causing the traffic congestion problem on roads in almost every part of the world which makes living in urban area more difficult.  Application of GIS in road traffic management renders many useful functions for assuring an efficient flow in the traffic systems of a country. In this post we are going to discuss about the Traffic Congestion Modelling – GIS . but let’s first talk about what actually is Traffic Congestion.

What is Traffic Congestion?

Congestion is a possibility for any mode of transportation, Traffic congestion is a condition on transport networks. When traffic demand on road is great enough that the interaction between vehicles slows the speed of the traffic stream, this results in some congestion.

Traffic Congestion Modelling – GIS

The Traffic Congestion Modelling is the strategic planning to influence the traffic with the  monitoring and control over the traffic systems. The traffic congestion management is used to expand the potential of State and local transportation systems. Traffic congestion management is one of the tough task of the local authorities because of the rapid urbanization. Improper traffic management and planning may lead to severe traffic congestion and accidents in the city. For inventing and implementing new solution on such problems it is necessary to get current traffic data and right decision making tool. In recent years, GIS has emerged as one of the most efficient tools in the transportation sector and GIS is one of the management decision making tool which analyses stores huge amount of data efficiently and effectively. Expected project output will be the recommendation for better traffic management using GIS tool on the basis of data collected, analysis and design.

Benefits of Traffic Congestion Modelling – GIS

  • Effortlessness movement of traffic
  • Minimum time spent on roads due to traffic
  • Improving the travelling mobility
  • Increased roadway safety and personal protection
  • Efficient transport planning and designing
  • Reliable and safe operation of transport
  • Conserving the energy while protecting the environment

GIS can help in the assessment and management of traffic congestion by mapping out these various factors that influence the speed of moving vehicles, like width of road, construction work, road’s structure, various land uses that attract vehicle traffic. GIS represent the modern entry of multi-discipline fields in subject areas like computer science, surveying, geography, and cartography into statistical analysis and the management of transportation systems.

Use of Traffic Congestion Modelling – GIS

  • Routing with GIS: GIS provides alternative routes to road user so that they don’t get in any congestion on road. Roads and traffic information is crucial data and road traffic mangers normally organize this material by compelling the data into table used in statistical analysis. spatial analysis, allows the tool to start responding to various events, evaluate impact and answers the best route for the road users.
    Routing-Traffic-Congestion-GIS-Modelling
  • Monitoring with GIS: GIS can render large database easily, which can integrate data from disparate sources.  The monitoring allows the tool for proper signal controlling on busy or congestion squares. for example if Square A shows as the congestion spot with high congestion, then for reducing the congestion of square A, we can divert the traffic coming to this square by using proper signalling of near by square B and square C with low congestion with the help of monitoring. Monitoring helps us understand the right timing and how can we properly control the signals, which can help in Traffic congestion model.
    Monitoring-Traffic-Congestion-GIS-Modelling
  • Accidents minimization : In Traffic Congestion Management, accidents can be minimized via GIS by generating a data of most accidents prone spots. The information can be provided either in the graphical format to the users or user’s driver and when the users gets the information about nearest dangerous area the drivers become extra cautious at such spots hence free flow can be maintained.Accident-minimization-Traffic-Congestion-GIS-Modelling
  • Reduction of Congestion spots : GIS is one of the powerful tools for analysis the spatial and attribute data for effective traffic management. Regional
    planning is essential for proper transportation management. GPS data was used to identify the spatial location of traffic congestion and other location based spatial information. One of the useful GIS functions to be used for this purpose is known as shortest path. It refers to the process of creating map of the shortest path from one point to another. The GIS tool requires that the user should have road direction table containing a list of directions stored as a database table as well as a set of reference data such as roads on which the addresses can be located. This can help in Reducing the congestion spots on the roads by providing the shortest and easiest part to the user.

GIS has a wide variety of applications in road traffic direction and traffic planning in transportation networks. GIS is a bonus to all sorts of traffic direction; the blending of GIS with other schemes is perhaps the best principal potential for the expectations of GIS. The priority results are utilized in evaluating congestion points according to roads direction. Results obtained from this tools compare alternate improvement strategies, and solutions thus giving the best possible solution. This is how you can use GIS in Traffic Congestion Modelling.

Do let us know how this Article is helpful for you, by commenting below in the comment box.

 

PHP PostGIS connection – Codeigniter and GIS Database

PHP PostGIS connection.  Let see first, what is PHP (Code igniter), PostGIS and why we are connecting them? PHP (Hypertext Preprocessor) is a server scripting language, and a powerful tool for making dynamic and interactive Web pages where as PostGIS is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL. We are connecting both of them to query spatial data stored in PostGIS and send them server.

Before looking into this post you may try to look for installing postgis and postgresql in your system or server.

PHP PostGIS connection – Codeigniter and GIS Database

There are many exciting things that you can do, for example you can use pgrouting and see the shortest path. Codeigniter is an Application Development framework. It is well designed structure to write code in PHP.

PHP codeigniter Desciption – connection with postgis

There are three main component, which separates the logical and presentation.

Part – 1. Model – This component connects you with your database. Here you can insert, update or delete data from your connected database.

Part – 2. View – This component is mainly about presentation part. This is PHP file which contains information, which you need to show to users.

Part – 3. Controller – This one is main component of the codeigniter as model and view or any other resources are loaded here.

This helps to process the HTTP request and generates the web pages.

Step for PHP PostGIS connection – Codeigniter and GIS Database

There are few steps for doing this-

1. Very first step is to download the code igniter, PostGIS and have knowledge about PHP.

2. Download  codeigniter framework or which every framework you use. Then unzip the downloaded file. If you are using Ubuntu system then place it inside /var/www/html folder.

3. You need to do some settings such as set base url by navigating your self to application/config/config.php path. (for Codeigntier php people)

4. As in controller the index function loads the welcome page so by entering base URL in browser you will see the welcome page.

5. Installation of PostGIS in described in last article please follow that.

6. Now as we want Postgres to connect with code igniter So we need to open application/config/database.php file.

Here in the end of page you will see the

$db['default'] =  array( 'dsn' => '', 
 'hostname' => 'localhost', 
 'username' => 'root', 
 'password' => '', 
 'database' => 'database_name', 
 'dbdriver' => 'mysqli', 
 'dbprefix' => '', 
 'pconnect' => TRUE, 
 'db_debug' => TRUE, 
 'cache_on' => FALSE, 
 'cachedir' => '', 
 'char_set' => 'utf8', 
 'dbcollat' => 'utf8_general_ci', 
 'swap_pre' => '', 
 'encrypt' => FALSE, 
 'compress' => FALSE, 
 'stricton' => FALSE, 
 'failover' => array() 
 );

Here Mysqli driver is connected. Now we will change the Username by Postgres. If you have change the username of Postgres replace ‘root’ by that name. If this this password protected then provide the password in third row. Change the database name with one available in postgres. Now write postgre in place of mysqli. Let rest all fields as it is. In the last you can add port number for postgres by typing this ‘port’ => 5432.

So this will look like:

$db['default'] = array( 
 'dsn' => '', 
 'hostname' => 'localhost', 
 'username' => 'Postgres', 
 'password' => 'password', 
 'database' => 'postgres', 
 'dbdriver' => 'postgre', 
 'dbprefix' => '', 
 'pconnect' => FALSE, 
 'db_debug' => (ENVIRONMENT !== 'production'), 
 'cache_on' => FALSE, 
 'cachedir' => '', 
 'char_set' => 'utf8', 
 'dbcollat' => 'utf8_general_ci', 
 'swap_pre' => '', 
 'encrypt' => FALSE, 
 'compress' => FALSE, 
 'stricton' => FALSE, 
 'failover' => array(), 
 'save_queries' => TRUE, 
 'port'=> 5432 
 );

Now to check that your database is successfully connected with codeigniter you can run query to insert data in available table.

As after connection with PostGIS i.e with GIS extension enabled, you may look forward to insert shapefile data into postgis or import osm data into postgis.

For example- First of all create a view which shows that we are passing username and password, Which will get store in database table. Go to the application/view and create php file and write the given code. For this can use any test editor.

    <h2>Login Details</h2>

<form action="<?php echo base_url()?>index.php/User_Authentication/checkUser" method="post">
<label>UserName :</label>
<input type="text" name="username" id="username" placeholder="username"/><br /><br />
<label>Password :</label>
<input type="password" name="password" id="password" placeholder="**********"/><br/><br />
<input type="submit" value=" Login " name="submit"/><br />
</form>

Model will have query to insert data. Provide proper table name and data to be entered coming from view page.
public function registration_insert($data) 
{
  $rs=  $this->db->insert('user_login',$data);
  if($rs)
  {
      return TRUE;
  }else{
      return FALSE;
  }
}

Finally in controller load the model and created views.
class User_Authentication extends CI_Controller {

public function __construct() {
parent::__construct();

// Load form helper library
$this->load->helper('form');

// Load form validation library
$this->load->library('form_validation');

$this->load->helper(array('form', 'url'));
// Load database
$this->load->model('Login_Database');
}


// After loading model and views write a function whcih will take data coming from view, will make a array and sent this data to function registration_insert() in model.

public function newuser(){

$data = array(
   // 'id'=>'2',
'user_name' => $this->input->post('username'),
'user_email' => $this->input->post('email'),
'user_password' => $this->input->post('password')
);
$this->Login_Database->registration_insert($data);
$this->load->view('Login_Form');
}

Want to visualize the postGIS data, you can use QGIS to connect with PostGreSql and postgis.

Similarly after processing the data, you may be looking for exporting the PostGIS postgresql data in Shapefile or other format.

After this you can load the base URL in browser and pass data needed to insert in database table. Now open postgres and see the data hase updated accordingly. If you find any problem in connecting between php and postgis, do comment below.