1

I am trying to create a grid in my map and do some calculations.

I seen the following links:-

Create regular polygon grid using postgis

Create regular polygon grid inside a polygon using postgis

Here I understood, how to create a polygon grid using postgis spatial query.

Any one, please help me to do the same concept in Openlayers(any client side code).

My arguments are :

  1. Bounds value. Example: new OpenLayers.Bounds(77.06173,28.50872,77.40918,28.74567)
  2. Distance between the points in the grid. Example : 100

My actual requirements is

  1. Create a grid on map.
  2. Plot some POINTS.
  3. Calculate the number of points in each grid.
  4. Get the centroid(x,y) of the grid which have maximum number of points.

I just seen this code..

var points = new OpenLayers.Layer.PointGrid({
 isBaseLayer: true, dx: 15, dy: 15
});
var map = new OpenLayers.Map({
 div: "map",
 layers: [points],
 center: new OpenLayers.LonLat(0, 0),
 zoom: 2
});

Reference: Openlayers Point Grid

My Queries

  1. How can I add polygon grid layer.
  2. How can I set this layer in a particular bounds/extent.
  3. How can I give "select" control to this layer.
  4. How can I find out Number of points on a selected grid/polygon.

Note: I am using Openlayers 2.11.

asked Feb 7, 2014 at 10:53
0

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.