Re: [Qgis-developer] Use of Spatial Index and more

2011-08-01 Thread Martin Dobias
On Fri, Jul 29, 2011 at 6:26 PM, maaza mekuria  wrote:
> Thanks again Martin. I was able to use it effectively for my needs. I am 
> delighted to have you guys to help. Many times because of the lack of 
> available documentation, your experiences are invaluable and it may be the 
> one that would make or break a person's patience to do plugging along in QGis.

In case you have some spare time we would be glad if you help us with
the documentation. If you do not feel like writing some docs it would
be fine just to point out what is lacking there and/or what is
unclear.

> I still would like that one should be able to create and access indices to 
> perform spatial analysis fairly easily. For doing GIS work one must perform 
> these actions many times not just from a single geometry, but in groups. So 
> my humble request is to place a function function (perhaps in QgsSpatialIndex 
> that will take a data layer and return a spatial index.

Such a function might be added in future, however it is a matter of
few lines of code, so no problem to write it yourself - and eventually
submit a patch ;-)

> Also it would be helpful for those with less memory, and highly memory 
> intensive work, to allow access to the spatial index disk file for similar 
> use in place of memory index. It may be a bit slower than an in memroy 
> version, but it should do just the same as the other.

Yes that would be a nice feature to have.

Martin
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Use of Spatial Index and more

2011-07-29 Thread maaza mekuria
Thanks again Martin. I was able to use it effectively for my needs. I am 
delighted to have you guys to help. Many times because of the lack of available 
documentation, your experiences are invaluable and it may be the one that would 
make or break a person's patience to do plugging along in QGis. 

I did also benefit greatly from Sergey Yakushev's road graph plugin. I did not 
realize that one can setup a plugin Gui fairly easily once cmakelist file is 
modified by disabling the dummy plugin's ".ui" file. That file, while it is 
meant to help one use the designer, many times it makes it harder to manage all 
that goes on in the internals. Unless a person is well versed in QT Designer 
and, I must say, uses QT for compiling, I found it to be a bit awkward to use 
in Windows. I learned about making a dockable widget, writing defaults and 
storing variables in the project file, etc.

Sergey's programming ability is very impressive, I wish I could be like him. 
But I am thankful that he shared his knowledge and work with me. I am glad I 
was able to glean a lot from him and learned a bit about the internals of QGIS. 
There are still many things that I do not understand how the program works but 
it is an excellent work worthy of a QGIS award. Is there something like that? 

One question I would ask Sergey is, why RoadGraph runs out of memory when I 
include more data. It works if the dataset is relatively small. But as soon as 
I increase the extent of the data, the program quits. I looked at the code and 
there is a number of points allocation that seems to be set at twice the size 
of a certain estimate. But I did not want to attempt to bungle an excellent 
program. It took me almost two month just to grasp what the program was doing, 
and yet there are still things that I still do not understand. But it has 
helped me comprehend many things including interaction with the canvas, and 
of-course the question I asked about spatial indexing came after looking at the 
road graph code of creating an in memory index.

I still would like that one should be able to create and access indices to 
perform spatial analysis fairly easily. For doing GIS work one must perform 
these actions many times not just from a single geometry, but in groups. So my 
humble request is to place a function function (perhaps in QgsSpatialIndex that 
will take a data layer and return a spatial index. Also it would be helpful for 
those with less memory, and highly memory intensive work, to allow access to 
the spatial index disk file for similar use in place of memory index. It may be 
a bit slower than an in memroy version, but it should do just the same as the 
other.

What do you think,

Maaza  

--- On Thu, 7/28/11, Martin Dobias  wrote:

> From: Martin Dobias 
> Subject: Re: [Qgis-developer] Use of Spatial Index
> To: "maaza mekuria" 
> Cc: "QGIS Developer" 
> Date: Thursday, July 28, 2011, 2:45 PM
> On Thu, Jul 28, 2011 at 8:36 PM,
> maaza mekuria 
> wrote:
> > Thank you, Martin for your explanation. I ahve one
> more followup question.
> >
> > Can the spatial index be composed of features other
> than points? I do not see any restriction in the
> documentation. Can I use features such as lines and
> polylines in an in-memory spatial index and use these as one
> uses points?
> 
> Yes, you can use lines and polygons. Spatial index only
> uses bounding
> boxes of the geometries to for the queries. Therefore also
> intersection query will return features that have bounding
> box of
> their geometry intersecting the query rectangle.
> 
> Martin
> 
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer