Hi Puneet.  

I don't know if this will solve your dB problem or not. I realize that you 
indicated that you are using Postgres, however, this information may provide a 
different perspective. For your application it may be better to investigate 
using what is called a columnar or analytic dB. These dB types provide much 
higher performance (more than several orders of magnitude) than strict 
relational dB when the data is querying column data instead of the more 
traditional relational row query. I have been looking at them for a bit now, 
unfortunately haven't had time to actually install and convert my dB to it. The 
product that I am aware of is based on MySQL and is available as a community 
supported edition. It may support other dB platforms as well - I was only 
interested in the MySQL at the time. It is called Infobright and can be found - 
http://www.infobright.org/. There are several supporting packages that provide 
everything from the Extract-Transform-Load function of the database (I don't 
know if you would likely need this as I am still trying to determine if I do 
for my application, although I am starting to lean away from it), to the data 
mining and reporting functions. Pentaho - http://www.pentaho.com/ and Vertica 
providee these, but they do not have a community sourced version, although a 
trial version is available. These latter products provide support for almost 
all database platforms. From what I can understand of your application, you 
would likely be fine with the Infobright product. YMMV. Good luck.

CLIFF SOBCHUK 

Core RF Engineering
Phone 403-262-4010x3618169
www.ericsson.com 

"The author works for Telefonaktiebolaget L M Ericsson ("Ericsson"), who is 
solely responsible for this email and its contents. All inquiries regarding 
this email should be addressed to Ericsson. The web site for Ericsson is 
www.ericsson.com."

This Communication is Confidential. We only send and receive email on the basis 
of the terms set out at www.ericsson.com/email_disclaimer 


-----Original Message-----
From: P Kishor [mailto:[email protected]] 
Sent: June-29-10 10:12 PM
To: perldl
Subject: [Perldl] storing map coordinates in a piddle -- looking for ideas

I have a rectangular map of square grid cells. Each grid cell has an x,y 
(lat,lon) centroid, and a serial number, the cell_id, starting at 0,0 in the 
top-left corner, and increasing to the right and down. Here is a picture

1     2    3  ..  9
10  11  12 .. 19
..

(except, in my map, the rows are much longer).

Right now, these "cells" are stored in Postgres/PostGIS, with the geometry in a 
geometry-type column which enables drawing a grid image and sending it to the 
browser. When a user clicks on or selects an area of the map in the browser, 
the pixel coords are converted to lat-lon, and a Pg query is able to retrieve 
the cell(s) that match the click or the select area.

I am considering storing some of the attribute data for these cells as a 
rectangular piddle, in files (hence, my experimentation with FastRaw, and 
range() and at(), etc.). PDL is fast. Very, very fast.
Much faster than the database, in my initial, non-scientific tests.

However, in order to find the correct attributes, I have to have the x,y of the 
piddle elements I want. But, what I have is the lat-lon of the user click or 
area selection. Of course, I can query the Pg table, get the cell_ids (the 
serial number), have a function that calculates the x,y based on the serial 
number, and then look up in the piddle.
What I am wondering is -- can I bypass the db completely? Because of my geog. 
transformation, the lat-lon spaces maps to the rectangular space.

Hence, can I --
1. based on a click or an area selection, determine the cell_ids of the one or 
more cells (the click will fall in a square cell, hence the cell_id of that 
cell, and the area selection will "contain" within it, for some definition of 
"contain," many square cells, hence the cell_ids of those cells);

2. convert the cell_ids from #1 above to x,y coords of the PDL;

3. use range() or at() to retrieve the values for those cells from the PDL;

4. do something with those values, like, make an image using PLplot or GD?

How?

I want to do this because: (1) as I said, PDL is way faster than a db;
(2) PDL is way funner than a db; (3) it is a nice challenge, worth exploring.

Since I am way too new with PDL, I would appreciate any guidance I can get.



--
Puneet Kishor

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to