Results 1 to 2 of 2

Thread: Selecting rectangle from large 'continuous' matrix?

  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Lightbulb Selecting rectangle from large 'continuous' matrix?

    I'm having a hard time working out the following problem efficiently.

    I have a 15000x15000 xy matrix. I'm storing element locations in this matrix by defining a x,y coordinate for the element. I want to display a part of the matrix in a so called viewport. The viewport dimensions are e.g. 1600x1000

    Consider the following db structure:

    Element (element_id, image, width, height)
    Globe_Element (ge_id, x, y, element_id)

    With the only input being a x,y coordinate somehwere in the grid (500x500) how can I select all the Globe_Element rows which are visible in the viewport (6x4)?

    Please take the following image as a reference: http://img33.imageshack.us/img33/608...ortexample.jpg

    The image demonstrates the issues. The small orange squares are elements which should be included, small red squares shouldn't (looking at the nearest viewport). The big colored blocks (blue, yellow, green and red (yes again, sorry for confusion) are viewports. One color is one viewport. Gray circles define the input coordinates.

  2. #2
    Join Date
    Jan 2010
    Posts
    2
    the grid is 15000x15000 and the viewport is 1600x1000 (can't edit the message) as in the image!!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •