Displaying demographics on google maps

982 views
Skip to first unread message

Mohan

unread,
Dec 27, 2010, 1:56:27 AM12/27/10
to Google Maps JavaScript API v3
Hi,

I am new to Google MAPS. I need a help.

As a part of my project, I need to highlight the states/Provence of
South Africa using google map according to demographics.

But I am not sure how can I get the states boundaries ? I know each
state is polygon, but how can I get lat/lang values for each state ?

Please suggest how can I achieve this ?

will appreciate any help on this.

Rgds
Mohan

Mohan

unread,
Dec 27, 2010, 1:53:42 AM12/27/10
to Google Maps JavaScript API v3

geoco...@gmail.com

unread,
Dec 27, 2010, 10:37:53 AM12/27/10
to Google Maps JavaScript API v3
On Dec 27, 1:56 am, Mohan <vpapin...@gmail.com> wrote:
> Hi,
>
> I am new to Google MAPS. I need a help.
>
> As a part of my project, I need to highlight the states/Provence of
> South Africa using google map according to demographics.
>
> But I am not sure how can I get the states boundaries ? I know each
> state is polygon, but how can I get lat/lang values for each state ?

Have you tried:
http://www.diva-gis.org/gdata

>
> Please suggest how can I achieve this ?
Download the shapefiles, convert them to kml, display the kml using
KmlLayer, not sure how you want to display the demographics (inside
the infowindow, color coding the polygons...)

-- Larry

Mohan

unread,
Dec 27, 2010, 11:04:21 PM12/27/10
to Google Maps JavaScript API v3
Thanks Lary.

I want to show the demographics by color coding the polygons, which
are states of the South Africa.

When browsing , i am not able to found any code sample for above
thing. Can you please help me ?

Rgds
Mohan



On Dec 27, 8:37 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:

geoco...@gmail.com

unread,
Dec 27, 2010, 11:12:07 PM12/27/10
to Google Maps JavaScript API v3
On Dec 27, 11:04 pm, Mohan <vpapin...@gmail.com> wrote:
> Thanks Lary.
>
> I want to show the demographics by color coding the polygons, which
> are states of the South Africa.
>
> When browsing , i am not able to found any code sample for above
> thing. Can you please help me ?

What kind of code samples do you need?
1. displaying kml on a map using the API? - see the documentation
2. color coding polygons in kml? - not a google maps API issue, is a
KML issue, see the KML reference:
http://code.google.com/apis/kml/documentation/kmlreference.html
3. translating shapefiles to kml? - also not a google maps API issue:
http://www.google.com/search?client=gmail&rls=gm&q=translate%20shapefile%20to%20kml
I use software from here: http://fwtools.maptools.org/

-- Larry

Mohan

unread,
Dec 27, 2010, 11:39:29 PM12/27/10
to Google Maps JavaScript API v3
Lary, I want guidelines on how can I achieve the task stated in my
question with Google maps. So if you can tell me follow these steps to
display demographics, lets say i want to show the readership details
of news paper , I have data for each state, how can I display these on
google maps? I want to color the states polygon but I don't have
latitude and longitudes of polygon.

-Mohan

On Dec 28, 9:12 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Dec 27, 11:04 pm, Mohan <vpapin...@gmail.com> wrote:
>
> > Thanks Lary.
>
> > I want to show the demographics by color coding the polygons, which
> > are states of the South Africa.
>
> > When browsing , i am not able to found any code sample for above
> > thing. Can you please help me ?
>
> What kind of code samples do you need?
> 1. displaying kml on a map using the API? - see the documentation
> 2. color coding polygons in kml? - not a google maps API issue, is a
> KML issue, see the KML reference:http://code.google.com/apis/kml/documentation/kmlreference.html
> 3. translating shapefiles to kml? - also not a google maps API issue:http://www.google.com/search?client=gmail&rls=gm&q=translate%20shapef...

geoco...@gmail.com

unread,
Dec 27, 2010, 11:58:21 PM12/27/10
to Google Maps JavaScript API v3
On Dec 27, 11:39 pm, Mohan <vpapin...@gmail.com> wrote:
> Lary, I want guidelines on how can I achieve the task stated in my
> question with Google maps.

Google Maps? Or using the Google Maps API v3?

> So if you can tell me follow these steps to
> display demographics, lets say i want to show the readership details
> of news paper , I have data for each state, how can I display these on
> google maps? I want to color the states polygon but I don't have
> latitude and longitudes of polygon.

To create the states polygon you need to:
1. download the appropriate shapefile from:
http://www.diva-gis.org/gdata
2. convert the shapefile to kml by using a conversion program. I use
software from here:
http://fwtools.maptools.org/
(it is free, you should be able to download it, install it on your
computer and run it)

An alternative would be to search the web to see if someone has
already created kml you can use.

-- Larry

Mohan

unread,
Dec 28, 2010, 1:39:39 AM12/28/10
to Google Maps JavaScript API v3
Thanks Lary.

I downloaded the tool and trying to open .shp files, its giving error
and abort the app.

Is there any other way to achieve displaying demographics without
using KML files ?

Rgds
Mohan

On Dec 28, 9:58 am, "geocode...@gmail.com" <geocode...@gmail.com>

geoco...@gmail.com

unread,
Dec 28, 2010, 5:43:32 AM12/28/10
to Google Maps JavaScript API v3
On Dec 27, 10:39 pm, Mohan <vpapin...@gmail.com> wrote:
> Thanks Lary.
>
> I downloaded the tool and trying to open .shp files, its giving error
> and abort the app.
>
> Is there any other way to achieve displaying demographics without
> using KML files ?

There are lots of ways. But you have to get the coordinates to create
the polygons somehow.

Maybe someone else has created kml you can use:
http://www.google.com/search?client=gmail&rls=gm&q=South%20Africa%20states%20KML

Mohan

unread,
Dec 29, 2010, 11:56:13 PM12/29/10
to Google Maps JavaScript API v3
Thanks, able to get coordinates data for states at
http://www.dyngeometry.com/web/WorldRegion.aspx

Now I can put these cordinates in xml file and load the xml file to
show the states.

How can I bind this to data source so that I can display demographics
dunamically ?

Rgds
Mohan

On Dec 28, 3:43 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Dec 27, 10:39 pm, Mohan <vpapin...@gmail.com> wrote:
>
> > Thanks Lary.
>
> > I downloaded the tool and trying to open .shp files, its giving error
> > and abort the app.
>
> > Is there any other way to achieve displaying demographics without
> > using KML files ?
>
> There are lots of ways.  But you have to get the coordinates to create
> the polygons somehow.
>
> Maybe someone else has created kml you can use:http://www.google.com/search?client=gmail&rls=gm&q=South%20Africa%20s...

geoco...@gmail.com

unread,
Dec 30, 2010, 12:06:39 AM12/30/10
to Google Maps JavaScript API v3
On Dec 29, 8:56 pm, Mohan <vpapin...@gmail.com> wrote:
> Thanks, able to get coordinates data for states athttp://www.dyngeometry.com/web/WorldRegion.aspx
>
> Now I can put these cordinates in xml file and load the xml file to
> show the states.
>
> How can I bind this to data source so that I can display demographics
> dunamically ?

Didn't I answer that in my second post?

+ 2. color coding polygons in kml? - not a google maps API issue, is
a
+ KML issue, see the KML reference:
+ http://code.google.com/apis/kml/documentation/kmlreference.html

If you want to do that dynamically, you will have to generate the kml
dynamically (add the color to each polygon based on your
demographics).
Reply all
Reply to author
Forward
0 new messages