Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE:RE : [udig-devel] Exploring uDIG: from a map selection to a database query

Title: RE:RE : [udig-devel] Exploring uDIG: from a map selection to a database query

Hi Jody,

The fact that I write "1." at each point show that I want to go to fast and do everything at the same time. I remember you that I am enthusiast about uDIG.

You give me a good hint; here is a generic example of the code that should be use (for reference to others):

Filter filter = PlatformGIS.getActiveMap().getMapLayers().Get(0).getFilter;
FeatureSource data = "">
FeatureCollection collection = data.getFeatures(filter);

When I read that: "You should be able to ask for the FeatureSource associated with the Layer, and then you can use normal geotools code to access.", I understand how to deal between uDIG and Geotools.

You write: The layer should already be defined by a FeatureSource ...   Question: are you defining your Layer as a program or is the user defining the layer which you are then operating with?

Response: It is a wizard that will help the user to choose the layers that are available in the database.

At the end you write: So the suggestion is - define your view on the database side, and read it through geotools.
Response: Thank you, we think about the same strategy, and I am considering using JDBC.

Thank you

Al :)

Nouvelles coordonnées !!!
Notez le changement de Code Postal
 
Alain Demers
Faune Québec
Direction de la recherche sur la faune
Ministère des Ressources naturelles 
et de la Faune
930, Chemin Ste-Foy
Québec, Québec
G1S 2L4

(418) 627-8692 poste 7486
Télécopie: 646-6863
 

-----Message d'origine-----
De : udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx [mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] De la part de jgarnett
Envoyé : 24 octobre 2005 11:58
À : User-friendly Desktop Internet GIS
Objet : Re: [udig-devel] Exploring uDIG: from a map selection to a database query



alain.demers@xxxxxxxxxxxxxxxx wrote:
>
> Hi,
>

>
> Congratulation for uDIG, it is a great tool that I discover with
> enthusiasm. I am trying to find my way in the javadoc (uDIG and
> GeoTools), which are huge. To understand uDIG plug-in creation, I try
> to create a real case. Here my scheme of work (my trouble is in the #4):
>
Your list always begins with "1." :-)
>
>    1. Make a selection on a layer.
>
> This is a user interface operation with the use of selection tool- no
> code here
>
Behind the scenes a GeoTools Filter indicating the selection is stored
for each Layer. The selection tool lets you modify this Filter. If
someone has time a dialog could also be created to let people manually
indicate the selection.
>
>    1. Read the filter of the selection of this layer.
>
> I use PostGIS. I have a Geometry table which is link to huge schema
> including many descriptive tables. Geometries are points where I have
> information on fish or fish habitat. One point may include many
> information types (fish inventory, habitats, species observations,
> etc.). I know the layer name which is my Geometry Table. I retrieve my
> Layer with PlatformGIS. getActiveMap().getMapLayers(). I can make a
> check to find the layer to catch the filter with getFilter() on this
> layer. I want to use this filter to select the descriptive information
> in my database.
>
You should be able to ask for the FeatureSource associated with the
Layer, and then you can use normal geotools code to access.

(I am doing this from memory so may need correction)

FeatureSource data = "" FeatureSource.class );
data.getFeatures( layer.getFilter() );

>    1. Read the source of the data of the layer.
>
> I can find the URL for the same layer
>
If you ask the the way in which you want to see the data (using
getResource above) we will be use any metadata around to help out at the
framework level. As an example sometimes a WMS Layer has a data url
which we may be able to use to find a WFS etc ...
>
>    1. Make a collection to create an Iterator.
>
> Here is my trouble, is it the right way if I try to create a
> FeatureCollection from a FeatureSource? How should I link a
> FeatureSource to a Layer? I guess that there is another way than
> FeatureSource...
>
The layer should already be defined by a FeatureSource ...   Question:
are you defining your Layer as a program or is the user defining the
layer which you are then operating with?
>
>    1. Make a View (in PostGresSQL and Udig) to explore the data based
>       on the Iterator.
>
> I am not here yet, do you have a suggestion
>
Making a view is kind of tough, and is a subject of research in the
geotools library right now. Right now a datastore *can* show the
database defined views - the result should be returned as a read-only
FeatureSource. So the suggestion is - define your view on the database
side, and read it through geotools.

Jody

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top