Kudos!
Thanks a lot, Steve.
It´s working:
http://www.webmapit.com.br/downloads/area_drawing.png - during drawing
http://www.webmapit.com.br/downloads/area_submited.png - after
submiting and as feature objects.
Eduardo
On 3/16/07, Steve Lime <[EMAIL PROTECTED]> wrote:
Hi Eduardo: This is possible once you know how. The coordinates from drawing
are held in two
arrays in the dBox object, called x and y. They are held in screen coordinates
and need to be
converted to image and then map coordinates before being used. I'll make this
more transparent
in the future. Anyhow, you'd do this with code like this:
for (var i=0; i<myDbox.x; i++) {
img_x[i] = myDbox.x[i] - myDbox.offsetx; // convert from screen to image
coordinates
img_y[i] = myDbox.y[i] - myDbox.offsety;
map_x[i] = myDbox.extent[0] + img_x[i]* myDbox.cellsize; // convert from
image to map coordinates
map_y[i] = myDbox.extent[3] - img_y[i]* myDbox.cellsize;
}
Dbox's polygon drawing does not make the first coordinate the same as the last
so you'll have to
do that yourself. Hope this helps.
Steve
>>> On 3/14/2007 at 9:38 AM, in message
<[EMAIL PROTECTED]>, Eduardo Patto
Kanegae <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I'm using dBox as my MapServer CGI front end and have enabled draw area
> tool.
>
> Now I'd like to submit the points defined by area tool and then save
> the area as a polygon inside a PostGIS database.
>
> Have someone done something similar? How does dBox handle this area?
> As image coordinates? Or as UTM coordinates?
>
> best
--
Eduardo Patto Kanegae