POI Finding using Google map and PostGIS


Google map and PostGis both are very nice tools for GIS application development. PostGis is an Open Source spatial database which supports almost every spatial operation. We can develop unique features for web application by combining Google Map and PostGis.
GmapPostGis
I want to developed an web page where user input an lat/lon of a location and distance. Then the application search all the POI(points) within this buffer an display them in Google map.

In above scenario, the solution can be given very easily using google map and PostGis. To do that, first we need to import shape file to PostGis. Secondly, have to make a PostGis query based on point and buffer area.Finally customize google map for display query result. Check the below link for live demo,

Click Here

Another post in this blog i have described how to import shape file to postgis. Please check this,

Click Here

PostGis have a set of GIS functions. All are very usefull and very compatible for web development. we can use ST_Buffe and ST_INTERSECTION to implement our requirement. Using ST_BUFFER We can create a max extend box by giving the distance parameter. Then the box will be intersected with our point map in the database. Below is the SQL,

SELECT gid, landmark_n, groupcode, lat, lon, the_geom
FROM landmark
WHERE the_geom && ST_Buffer(ST_GeomFromText(‘POINT(90.4142 23.7948)’), .01)

Here the landmark is our PostGis geo table. Using && we make intersection with buffer box. Our sample input location lng/lat is 90.4142,23.7948(Gulshan-1, Dhaka).We use .01 unit buffer area.

This SQL will return landmarks information with Lat/Lng. Now we need to display this points using Google Map which is quite simple task. There are many simple example available in the web to that. Check the below links,
Click Here

If this article do any help to you, please make comments.

Thanks,
Khayer
GIS Programmer, CEGIS
Bangladesh.

Advertisements

6 thoughts on “POI Finding using Google map and PostGIS

  1. Hi,

    I want to overlay existing 100 of Postgis Polygon tables.How i can populate those on gmap overlay.Please let me know your response.

    Thanks and Regrads,

    Venkat

  2. Hi Mikes,
    Yes, currently i am working to develop this kind of homes finding mapping tools using google map in rentacoder.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s