Get the data from Info tools in MapDisplayLab

15 messages Options
Embed this post
Permalink
dadar

Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
how can i get or view the data like when i click an area with info tools?
when i click area in map from identify button in MapDisplayLab show this one

Geometry: MultiPolygon
KODE_PROV: 61
KABKOTA: 6108
KABUPATEN: Kab. KAPUAS HULU
IBUKOTA: PUTUSSIBAU
PROVINSI: KALBAR
LUAS: 3094716.6244274

now how can i get the field and content to view it in joptionpane ??
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
Hello

Just to confirm: you want to retrieve the feature data collected by
InfoTool but display it in something other than the window that
InfoTool currently uses, is that correct ?

I see on another thread that you've been working through the
MapDisplayLab example. That really gives you all the background that
you need.

Also, if you study the source code for InfoTool you will see the
methods where the feature data is being written to a JTextReporter
(the window that displays the feature attribute data).

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
that's right michael. i already got it
i get the data using feature.getAttribute("KABKOTA");
is that the right one?

yeah i've been working on mapdisplay lab cause all i need is in there
but i still have one problem.
i don't know how to display the IDs with many color like i post in the other thread.
can u help me with that problem michael?
i already sent you the post

Darmawan

mbedward wrote:
Hello

Just to confirm: you want to retrieve the feature data collected by
InfoTool but display it in something other than the window that
InfoTool currently uses, is that correct ?

I see on another thread that you've been working through the
MapDisplayLab example. That really gives you all the background that
you need.

Also, if you study the source code for InfoTool you will see the
methods where the feature data is being written to a JTextReporter
(the window that displays the feature attribute data).

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
Hi Darmawan,

> i get the data using feature.getAttribute("KABKOTA");
> is that the right one?

That's how to get the value of a feature attribute, yes.

> i don't know how to display the IDs with many color like i post in the other
> thread.
> can u help me with that problem michael?

I noticed that Jody already replied to your question - what was it
that you didn't understand about his answer ?

Michael

PS. please send posts directly to the list rather than through Nabble
- it's so much easier for you and us :)

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
joy said:
No problem.

To get different colors you will want to create multiple rules; each with their own description of how to draw. And bundle them up into a single style.  Time to look at how that createSelectedStyle function works.

i don't understand if i create multiple rule, then how can i applied it to my selected IDs
my selectedIDs is contain more than 1 IDs like this one:

Set<FeatureIds> selectedIds = new HashSet<FetureIds>();

selectedIds().addAll( IDs );
selectedIds().addAll( IDs2 );

then if i applied it to my selectedIDs, IDs and IDs2 will have same rule right?

Rule selectedRule = createRule(SELECTED_COLOUR, SELECTED_COLOUR);
        selectedRule.setFilter(ff.id(selectedIDs));

how can i applied different rule for IDs and IDs2 (they both inside selectedIDs) ??

Darmawan

mbedward wrote:
Hi Darmawan,

> i get the data using feature.getAttribute("KABKOTA");
> is that the right one?

That's how to get the value of a feature attribute, yes.

> i don't know how to display the IDs with many color like i post in the other
> thread.
> can u help me with that problem michael?

I noticed that Jody already replied to your question - what was it
that you didn't understand about his answer ?

Michael

PS. please send posts directly to the list rather than through Nabble
- it's so much easier for you and us :)

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
> how can i applied different rule for IDs and IDs2 (they both inside
> selectedIDs) ??
>

Just don't combine them into a single set - keep them separate and use
each to create a rule. It's as simple as that really, unless I don't
understand your question properly (?)

When Jody suggests that you look at how the createSelectedStyle method
in the example works he means for you to understand the general
concepts of it, not to stick to the exact code.  The same is the case
with all of the examples, they are only intended to get you started.

Hope this helps.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
i can't do that michael. i combine it because i want to display it both in map at the same time so i must set the style at the same time to repaint it in displayselectedfeature. do you get what my point?

Darmawan

mbedward wrote:
> how can i applied different rule for IDs and IDs2 (they both inside
> selectedIDs) ??
>

Just don't combine them into a single set - keep them separate and use
each to create a rule. It's as simple as that really, unless I don't
understand your question properly (?)

When Jody suggests that you look at how the createSelectedStyle method
in the example works he means for you to understand the general
concepts of it, not to stick to the exact code.  The same is the case
with all of the examples, they are only intended to get you started.

Hope this helps.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
> i can't do that michael. i combine it because i want to display it both in
> map at the same time so i must set the style at the same time to repaint it
> in displayselectedfeature. do you get what my point?
>

Yes, I understand what you're trying to achieve but it sounds like
you're confused about combining IDs into a set and combining rules
into a style.

For each category of features that you want to be rendered in a given
colour your provide a rule with a filter for the feature IDs and a
symbolizer describing how to draw the features. All of your rules are
then combined into a single Style object. It's just an extension of
what you see in the example code where there are only two rules being
used: selected and other.

I hope that makes it more clear for you.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
hmm can you give me an example code for it?
from what you write you tell me to make another rule beside selectedrule and otherrule in createselectedrule method right?
then after i create another rule how i set it in IDs??
  selectedRule.setFilter(ff.id(selectedIDs));
that is to set the rule for the feature right?
to set the rule i want in IDs and IDs2 i must do it like this:
  Rule1.setFilter(ff.id(IDs));
  Rule2.setFilter(ff.id(IDs2));
but the IDs and IDs2 is in selectedIDs so how i set it. that's what i mean

Darmawan

mbedward wrote:
> i can't do that michael. i combine it because i want to display it both in
> map at the same time so i must set the style at the same time to repaint it
> in displayselectedfeature. do you get what my point?
>

Yes, I understand what you're trying to achieve but it sounds like
you're confused about combining IDs into a set and combining rules
into a style.

For each category of features that you want to be rendered in a given
colour your provide a rule with a filter for the feature IDs and a
symbolizer describing how to draw the features. All of your rules are
then combined into a single Style object. It's just an extension of
what you see in the example code where there are only two rules being
used: selected and other.

I hope that makes it more clear for you.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
Hi Darmawan,

> hmm can you give me an example code for it?

You really have all the example code that you need. I'm afraid that
none of us here can write your app for you - at least not for free :-)

> but the IDs and IDs2 is in selectedIDs so how i set it. that's what i mean

They are in the example code but they don't have to be in _your_ code.
Simply modify the method. Give the method an extra Set argument if you
like.  Or if you want to make it more flexible you might give is a Map
argument where the keys are feature IDs and the values are numbers or
names of feature categories that you want to display in separate
colours. It's really up to you.

The examples are only there to get you started. They don't represent
the only way to do things and they don't illustrate all that is
possible. The idea is for you to study them, along with the wiki and
javadocs, and then experiment with your own hacking.

Hope this helps.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
i build my code like that michael. i modified the class like this

void selectFeatures(double [] posisix, double [] posisiy) {
for (int i=0;i<posisix.length;i++)
        {
        Geometry point = geomFactory.createPoint(new Coordinate(posisix[i], posisiy[i]));
        ...
        FeatureIterator<SimpleFeature> iter = selectedFeatures.features();
           
        Set<FeatureId> IDs = new HashSet<FeatureId>();  
        ...

        selectedIds.addAll(IDs);
        }
        displaySelectedFeatures(selectedIds);
}

so in displaySelectedFeatures i have only selectedIds. so how can i get the IDs within selected so i can set the rule??

"Or if you want to make it more flexible you might give is a Map
argument where the keys are feature IDs and the values are numbers or
names of feature categories that you want to display in separate
colours. It's really up to you."
what do you mean about this?

Darmawand

mbedward wrote:
Hi Darmawan,

> hmm can you give me an example code for it?

You really have all the example code that you need. I'm afraid that
none of us here can write your app for you - at least not for free :-)

> but the IDs and IDs2 is in selectedIDs so how i set it. that's what i mean

They are in the example code but they don't have to be in _your_ code.
Simply modify the method. Give the method an extra Set argument if you
like.  Or if you want to make it more flexible you might give is a Map
argument where the keys are feature IDs and the values are numbers or
names of feature categories that you want to display in separate
colours. It's really up to you.

The examples are only there to get you started. They don't represent
the only way to do things and they don't illustrate all that is
possible. The idea is for you to study them, along with the wiki and
javadocs, and then experiment with your own hacking.

Hope this helps.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
> so in displaySelectedFeatures i have only selectedIds. so how can i get the
> IDs within selected so i can set the rule??

You are allowed to modify the displaySelectedFeatures method you know :-)

You can change it to whatever is appropriate, for instance:

displaySelectedFeatures(Set<FeatureId> set1, Set<FeatureId> set2)

or

displaySelectedFeatures( Map<FeatureId, Integer> featureGroups )

or anything else you like. This is what I was referring to in the last post.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
actually i want to create array of Set<FeatureId> so i can set and create the style.
but i don't know how to declare it. jody tell me using addAll function.
how if i want to create array of Set<FeatureId>??
or is there any way to extract the IDs from selectedIds??

oh and where can i get example to put label in some area ?

Darmawan

mbedward wrote:
> so in displaySelectedFeatures i have only selectedIds. so how can i get the
> IDs within selected so i can set the rule??

You are allowed to modify the displaySelectedFeatures method you know :-)

You can change it to whatever is appropriate, for instance:

displaySelectedFeatures(Set<FeatureId> set1, Set<FeatureId> set2)

or

displaySelectedFeatures( Map<FeatureId, Integer> featureGroups )

or anything else you like. This is what I was referring to in the last post.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
2009/10/20 dadar wrote:
>
> actually i want to create array of Set<FeatureId> so i can set and create the
> style.
> but i don't know how to declare it. jody tell me using addAll function.
> how if i want to create array of Set<FeatureId>??

That's a basic Java question - not a GeoTools question. I suggest you
use google or consult one of the many good introductory Java
textbooks.

In order to be able to use GeoTools you really need to understand
fundamental Java concepts and techniques such as working with
Collections, otherwise none of the answers that people give you on
this list will make any sense to you.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: Get the data from Info tools in MapDisplayLab

Reply Threaded More More options
Print post
Permalink
Yess!!
finally the problem is solved. i modified the createSelectedStyle and not using displaySelectedFeatures
it worked :)

btw where i can get example like MapDisplayLab for putting label or somthing above the map?

Darmawan

mbedward wrote:
2009/10/20 dadar wrote:
>
> actually i want to create array of Set<FeatureId> so i can set and create the
> style.
> but i don't know how to declare it. jody tell me using addAll function.
> how if i want to create array of Set<FeatureId>??

That's a basic Java question - not a GeoTools question. I suggest you
use google or consult one of the many good introductory Java
textbooks.

In order to be able to use GeoTools you really need to understand
fundamental Java concepts and techniques such as working with
Collections, otherwise none of the answers that people give you on
this list will make any sense to you.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users