I have a map showing two different kind of projects, National projects and Regional Projects. Each type of project is in a different layer, made with views, but shown in the same map. I would like to apply a different cluster to each layer, e.g. National projects cluster in green and with a distance of 5px, Regional Projects cluster in blue and with a distance of 20px.
I also would like the two layers not to mix between them, meaning the regional layers should not cluster with the national one.
I am using Drupal 7, openlayers 2.0beta-7
Is this possible?
Thank you!!
Solution:
Finally I decided to go the easy way and I added a custom behavior called custom_cluster so I can a apply a different one to each layer.
If I have understood your question, then I think you can do something like this: http://openlayers.org/dev/examples/strategy-cluster-extended.html
Generally, cluster strategies are defined at the level of the vector layer, so having two separate ones within one map view could also be achieved by adding two different vector layers, each with their own markup and clustering strategy.
Related
I was going through the OrientDB tutorial yesterday and think it looked really promising.
I like the possibility to add entities to different clusters and my question is if it is possible to have a hierarchy of clusters?
As an example, if I add a User to the cluster California I would like it to also be a part of the cluster USA without having to specifically add it to that cluster.
I am thinking about clusters as a way to divide data in sets and subsets, but maybe that is wrong?
This is what Classes are. You have real inheritance between classes, so querying a base class will give you all the instances of that class and its subclasses.
Clusters are a more physical concepts, think to them like a file or a table. A Class uses one or more clusters to store instances.
I want cluster an image dataset into several groups using K-means, N-cut or other algorithm, but I don't know how to process those images in the dataset first. These groups should have their own special features. Anyone has any suggestions?
My suggestion is that you go ahead and try a number of features.
Which feature works best for your is very much dependent on your use case.
If you are hoping to group photos by mood, group faces by users or group CAD drawings by the type of gear on it require completely different feature extraction approaches. So you will have to kiss a few frogs to find your prince.
You use the mosaic dataset.
A mosaic dataset allows you to store, manage, view, and query small to vast collections of raster and image data. It is a data model within the geodatabase used to manage a collection of raster datasets (images) stored as a catalog and viewed as a mosaicked image. Mosaic datasets have advanced raster querying capabilities and processing functions and can also be used as a source for serving image services. find more here
And also I refere you to this paper-article:
title: CREATING AN IMAGE DATASET TO MEET YOUR CLASSIFICATION NEEDS:A PROOF-OF-CONCEPT STUDY
By:
James D. Hurd, Research Associate
Daniel L. Civco, Director and Professor
I am new to Solr, and am trying to figure out the best way to index and search our catalogs.
We have to index multiple manufactures and each manufacturer has a different catalog per country. Each catalog for each manufacture per country is about 8GB of data.
I was thinking it might be easier to have an index per manufacture per country and have some way to tell Solr in the URL which index to search from.
Is that the best way of doing this? If so, how would I do it? Where should I start looking? If not, what would be the best way?
I am using Solr 3.5
In general there are two ways of solving this:
Split each catalog into its own core, running a large multi core setup. This will keep each index physically separated from each other, and will allow you to use different properties (language, etc) and configuration for each core. This might be practical, but will require quite a bit of overhead if you plan on searching through all the core at the same time. It'll be easy to split the different cores into running on different servers later - simply spin the cores up on a different server.
Run everything in a single core - if all the attributes and properties of the different catalogs are the same, add two fields - one containing the manufacturer and one containing the country. Filter on these values when you need to limit the hits to a particular country or manufacturer. It'll allow you to easily search the complete index, and scalability can be implemented by replication or something like SolrCloud (coming in 4.0). If you need multilanguage support you'll have to have a field for each language with the settings you need for that language (such as stemming).
There are a few tidbits of information about this on the Solr wiki, but my suggestion is to simply try one of the methods and see if that solves your issue. Moving to the other solution shouldn't be too much work. The simplest implementation is to keep everything in the same index.
I'm developing a WPF click once application using Prism v4, and MEF (MVVM pattern). I have multiple modules that reside in their own assemblies.
I'm trying to figure out where to place my model objects.
Would you place them in the assembly where they're primarily used (even though they could be used in other assemblies), or would you create an assembly to house all of the models (to be more easily used in other programs)? I'm leaning towards the latter but that brings be to the next question below...
How would you go about distinctly separating model objects, who are populated from different databases / servers - do you clump them all together in the same assembly / namespace or separate them into different namespaces / assemblies? I'm trying to prevent issues down the road due to a bad decision starting this project and would appreciate anyones feedback.
I put the model objects in their own assembly. This promotes reuse as well as separation, as its much more difficult to "pollute" the model with presentation related code.
As for your second question:
How would you go about distinctly separating model objects, who are populated from different databases / servers - do you clump them all together in the same assembly / namespace or separate them into different namespaces / assemblies?
If you're planning to have models that are populated from multiple sources, I would personally put the Model definitions in one assembly, then use a DAL (in separate assemblies) per data source. This keeps the model definitions separate from the data access, which in turn is still presentation-neutral.
If the Model will always be populated from a single data source, then keeping this together (but separating via namespaces) is probably a simpler option.
I am writing an application, there are various forms and their corresponding datamodules.
I wrote in a way that they are using each other by mentioning in uses class(one in implementation and another in interface to avoid cross reference)
Is this approach is wrong? why or why not i should use in this way?
I have to agree with Ldsandon, IMHO it's way better to have more than one datamodule in your project. If you look at it as a Model - View - Controller thingie, your DB is the model, your forms would be the Views and your datamodules would be the controllers.
Personally I always have AT LEAST 2 datamodules in my project. One datamodule is used to share Actions, ImageLists, DBConnection, ... and other stuff throughout the project. Most of the time this is my main datamodule.
From there on I create a new datamodule for each 'Entity' in my application. For example If my application needs to proces or display orders, cursomters and products, then I will have a Datamodule for each and everyone of those.
This way I can clearly separate functionality and easily reuse bits and pieces without having to pull in everything. If I need something related to Customers, I simple use the Customers Datamodule and just that.
Regards,
Stefaan
It is ok, especially if you're going to create more than one instance of the same form each using a different instance of the related datamodule.
Just be aware of a little issue in the VCL design: if you create two instances of the same form and their datamodules, both forms will point to the same datamodule (due the way the VLC resolves links) unless you use a little trick when creating the datamodule instance:
if FDataModule = nil then
begin
FDataModule := TMyDataModule.Create(Self);
FDataModule.Name := ''; // That will avoid pointing to the same datamodule
end;
A data module just for your table objects, if you only have a db few tables, would be a good one to be the first one.
And a data module just for your actions is another.
A data module just for image lists, is another good third data module. This data module only contains image lists, and then your forms that need access to image lists can use them all from this shared location.
If you have 200 table objects, maybe more than one data module just for db tables. Imagine an application that has 20 tables to do with invoicing, and another 20 tables to do with HR. I would think an InvoicingDataModule, and HRDataModule would be nice to be separate if the tables inside them, and the code that works against them, doesn't need to know anything about each other, or even when one module has a "uses" dependency in one direction, but that relationship is not circular. Even then, finer grained data module modularity can be beneficial.
Beyond the looking glass. I always use Forms instead of DataModules. I know it's not common ground.
I always use Forms instead of DataModules. I call them DataMovules.
I use one such DataMovule per each group of tables logically related.
I use Forms instead of DataModules because both DataModules and Forms are component containers and both can effectively be used as containers for data related components.
During development:
My application is easier to develop. Forms give you the opportunity to view the data components, making easy to develop those components.
My application is easier to debug, as you may put some viewer components right away so you may actually see the data. I usually create a tab rack, with one page per table, and one datagrid on every page for browsing the data on the table.
My application is easier to test, as you may eventually manipulate the data, for example experimenting with extreme values for stress testing.
After development:
I do turn form invisible. Practically making it a DataModule, I enjoy the very same container features than a datamodule has.
But with a bonus. The Form is still there, so I may eventually can turn it visible for problem determination. I use the About Box for this.
And no, I have not experienced any noticeable penalty in application size or performance.
I don't try to break the MVC paradigm. I try to adhere to it instead. I don't mix the Forms that constitute my View with the DataMovules that constitute my Controllers. I don't consider them part of my View. They will never be used as the User Interface of my application. DataMovules just happen to be Forms. They are just convenient engineering artifacts.