Hi,
Here are some hints about the pb
It happens because the selection is done on "cloned" features, not on
source features
You can see it on line 199 in SpatialQueryExecutor.
Just removing the clone part of the function will fix the bug... but it
will have a side effect that may be considered as worst as the bug :-(
If you don't clone the feature and the user ask for a new layer, you
will have references to the same java object in both layers, which is
probably not very safe (1).
Returning the source feature or a copy will depend on what did the user ask.
selection --> no clone
new layer --> clone
You may need to pass a new parameter in SpatialQueryExecutor to achieve that
Michaël
(1) in fact, I'm not sure if having the same feature in several layers
(without clone) is a good or a dangerous idea. I think it could be nice
to have a kind of "view" (like in database) to be able to work easily on
a small part of a large featurecollection or to apply different styles
to a featureCollection without cloning objects...
Sunburned Surveyor a écrit :
> Before I examined the source code for the spatial query bug, I decided
> to see if I could duplicate the incorrect behavior.
>
> I was not able to do this.
>
> I successfully executed a spatial query and was able to copy & cut the
> resulting selection from the source layer, pasting the selected
> features to a destination layer.
>
> Has anyone else been able to duplicate this bug? As far as I can tell,
> the selections created by the spatial query tool behave like all other
> JUMP selections.
>
> If someone can confirm this isn't a real bug, I will close the bug
> report. In this case, I will take a look at the other bug that Stefan
> mentioned.
>
> The Sunburned Surveyor
>
> On Fri, Mar 6, 2009 at 2:51 PM, Sunburned Surveyor
> <sunburned.surveyor@...> wrote:
>
>> I meant to say "check with you on the desired behavior of the plug-in"...
>>
>> SS
>>
>> On Fri, Mar 6, 2009 at 1:51 PM, Sunburned Surveyor
>> <sunburned.surveyor@...> wrote:
>>
>>> Thanks for the help Stefan. I hope to start work on this bug next
>>> week. I may need to check on the desired behavior of the plug-in again
>>> after I have looked at the code.
>>>
>>> SS
>>>
>>> On Fri, Mar 6, 2009 at 12:09 PM, Stefan Steiniger <sstein@...> wrote:
>>>
>>>> Hei,
>>>>
>>>> so I just had to check... it is the plugin:
>>>> ui.plugin.analysis.SpatialQueryPlugIn of the original JUMP
>>>>
>>>> the case where the selection is needed is for instance if feature in one
>>>> layer appear also in a second layer and one wants to find those using
>>>> "equal".
>>>> Then the goal would be to delete or modify the features that appear in both
>>>> layers (e.g. "cut selected items" doesn't work) - I attach two datasets.
>>>>
>>>> stefan
>>>>
>>>> Sunburned Surveyor wrote:
>>>>
>>>>> Here is the link to the bug tracker page for the bug I am talking about:
>>>>>
>>>>>
>>>>> http://sourceforge.net/tracker/index.php?func=detail&aid=2660272&group_id=118054&atid=679906
>>>>>
>>>>> SS
>>>>>
>>>>> On Fri, Mar 6, 2009 at 11:08 AM, Sunburned Surveyor
>>>>> <sunburned.surveyor@...> wrote:
>>>>>
>>>>>> I will start work on squishing the bug that has to do with "phantom"
>>>>>> feature selections produced by the spatial query functionality in
>>>>>> OpenJUMP.
>>>>>>
>>>>>> Can anyone tell me if the spatial query functionality is part of the
>>>>>> core program, or part of a plug-in? That will help me track down the
>>>>>> source code so I can get started.
>>>>>>
>>>>>> SS
>>>>>>
>>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>>>>> CA
>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>>>>> Enterprise
>>>>> -Strategies to boost innovation and cut costs with open source
>>>>> participation
>>>>> -Receive a $600 discount off the registration fee with the source code:
>>>>> SFAD
>>>>> http://p.sf.net/sfu/XcvMzF8H
>>>>> _______________________________________________
>>>>> Jump-pilot-devel mailing list
>>>>> Jump-pilot-devel@...
>>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>>
>>>>>
>>>>>
>>>> ------------------------------------------------------------------------------
>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>>>> -Strategies to boost innovation and cut costs with open source participation
>>>> -Receive a $600 discount off the registration fee with the source code: SFAD
>>>> http://p.sf.net/sfu/XcvMzF8H
>>>> _______________________________________________
>>>> Jump-pilot-devel mailing list
>>>> Jump-pilot-devel@...
>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>
>>>>
>>>>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@...
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>

Hei Ravi,
so .. I checked what is going on with your dataset when applying the
function Intersect Polygon Layers.
The reason while it fails and the error message appears[1] is that the
"strbuffer" file contains features that overlay each other (you see the
overlay if you use the "union by attribute" function on strbuffer). If
they overlay the algorithm does not know what attribute values to chose
as there are two or more source objects.
The only thing I have done now, is to set the values that could have
come from 2 source features in a single layer to "NaN" for the resulting
layer.
The only way to solve the problem is by separating the features in
strBuffer that overlay and have different "dist" values into 2 (or more)
different layers. So that one layer - after applying an union by
attribute - would contain no overlaying features.
Note, you can get a intersection layer of strbuffer by
I) using "Union by Attribute" on strbuffer
II) using the union result with "Planar Graph" (but disabling the option
of attribute transfer since this would not work.. same problem as above)[2]
III) clean up the layer that contains the faces from newly generated
polygons and assign the correct attribute values [2]
VI) use this one as input for the intersection
stefan
[1]: error msg:'Found more than one source feature in Layer B'
[2]: @ALL: Thinking about that, it seems like a polygon intersection
function is missing that works on a single layer. Or does anybody know a
function that would do that. [I guess I have the code probably
somwhere... But this is won't go into OJ 1.3]
RAVI KUMAR schrieb:
> Hi Stefan,
> 'waiting for the OJ 'Intersection of Polygon Layers', the shape files I have emailed you.
>
> My notes for 'OJ - Mineral Prognostication', is nearly ready.
> Hope this may be considered for suitability for a lab at the following.
> 'OGRS2009 Call For Research Papers, Showcases and Labs
> France July 8 to 10'.
>
> Cheers
> Ravi Kumar
>
>
>
>
>

I think it is a bug - since you can not delete the selected features
stefan
Sunburned Surveyor schrieb:
> Before I examined the source code for the spatial query bug, I decided
> to see if I could duplicate the incorrect behavior.
>
> I was not able to do this.
>
> I successfully executed a spatial query and was able to copy & cut the
> resulting selection from the source layer, pasting the selected
> features to a destination layer.
>
> Has anyone else been able to duplicate this bug? As far as I can tell,
> the selections created by the spatial query tool behave like all other
> JUMP selections.
>
> If someone can confirm this isn't a real bug, I will close the bug
> report. In this case, I will take a look at the other bug that Stefan
> mentioned.
>
> The Sunburned Surveyor
>
> On Fri, Mar 6, 2009 at 2:51 PM, Sunburned Surveyor
> <sunburned.surveyor@...> wrote:
>> I meant to say "check with you on the desired behavior of the plug-in"...
>>
>> SS
>>
>> On Fri, Mar 6, 2009 at 1:51 PM, Sunburned Surveyor
>> <sunburned.surveyor@...> wrote:
>>> Thanks for the help Stefan. I hope to start work on this bug next
>>> week. I may need to check on the desired behavior of the plug-in again
>>> after I have looked at the code.
>>>
>>> SS
>>>
>>> On Fri, Mar 6, 2009 at 12:09 PM, Stefan Steiniger <sstein@...> wrote:
>>>> Hei,
>>>>
>>>> so I just had to check... it is the plugin:
>>>> ui.plugin.analysis.SpatialQueryPlugIn of the original JUMP
>>>>
>>>> the case where the selection is needed is for instance if feature in one
>>>> layer appear also in a second layer and one wants to find those using
>>>> "equal".
>>>> Then the goal would be to delete or modify the features that appear in both
>>>> layers (e.g. "cut selected items" doesn't work) - I attach two datasets.
>>>>
>>>> stefan
>>>>
>>>> Sunburned Surveyor wrote:
>>>>> Here is the link to the bug tracker page for the bug I am talking about:
>>>>>
>>>>>
>>>>> http://sourceforge.net/tracker/index.php?func=detail&aid=2660272&group_id=118054&atid=679906
>>>>>
>>>>> SS
>>>>>
>>>>> On Fri, Mar 6, 2009 at 11:08 AM, Sunburned Surveyor
>>>>> <sunburned.surveyor@...> wrote:
>>>>>> I will start work on squishing the bug that has to do with "phantom"
>>>>>> feature selections produced by the spatial query functionality in
>>>>>> OpenJUMP.
>>>>>>
>>>>>> Can anyone tell me if the spatial query functionality is part of the
>>>>>> core program, or part of a plug-in? That will help me track down the
>>>>>> source code so I can get started.
>>>>>>
>>>>>> SS
>>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>>>>> CA
>>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>>>>> Enterprise
>>>>> -Strategies to boost innovation and cut costs with open source
>>>>> participation
>>>>> -Receive a $600 discount off the registration fee with the source code:
>>>>> SFAD
>>>>> http://p.sf.net/sfu/XcvMzF8H
>>>>> _______________________________________________
>>>>> Jump-pilot-devel mailing list
>>>>> Jump-pilot-devel@...
>>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>>
>>>>>
>>>> ------------------------------------------------------------------------------
>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>>>> -Strategies to boost innovation and cut costs with open source participation
>>>> -Receive a $600 discount off the registration fee with the source code: SFAD
>>>> http://p.sf.net/sfu/XcvMzF8H
>>>> _______________________________________________
>>>> Jump-pilot-devel mailing list
>>>> Jump-pilot-devel@...
>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>
>>>>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@...
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>

Before I examined the source code for the spatial query bug, I decided
to see if I could duplicate the incorrect behavior.
I was not able to do this.
I successfully executed a spatial query and was able to copy & cut the
resulting selection from the source layer, pasting the selected
features to a destination layer.
Has anyone else been able to duplicate this bug? As far as I can tell,
the selections created by the spatial query tool behave like all other
JUMP selections.
If someone can confirm this isn't a real bug, I will close the bug
report. In this case, I will take a look at the other bug that Stefan
mentioned.
The Sunburned Surveyor
On Fri, Mar 6, 2009 at 2:51 PM, Sunburned Surveyor
<sunburned.surveyor@...> wrote:
> I meant to say "check with you on the desired behavior of the plug-in"...
>
> SS
>
> On Fri, Mar 6, 2009 at 1:51 PM, Sunburned Surveyor
> <sunburned.surveyor@...> wrote:
>> Thanks for the help Stefan. I hope to start work on this bug next
>> week. I may need to check on the desired behavior of the plug-in again
>> after I have looked at the code.
>>
>> SS
>>
>> On Fri, Mar 6, 2009 at 12:09 PM, Stefan Steiniger <sstein@...> wrote:
>>> Hei,
>>>
>>> so I just had to check... it is the plugin:
>>> ui.plugin.analysis.SpatialQueryPlugIn of the original JUMP
>>>
>>> the case where the selection is needed is for instance if feature in one
>>> layer appear also in a second layer and one wants to find those using
>>> "equal".
>>> Then the goal would be to delete or modify the features that appear in both
>>> layers (e.g. "cut selected items" doesn't work) - I attach two datasets.
>>>
>>> stefan
>>>
>>> Sunburned Surveyor wrote:
>>>>
>>>> Here is the link to the bug tracker page for the bug I am talking about:
>>>>
>>>>
>>>> http://sourceforge.net/tracker/index.php?func=detail&aid=2660272&group_id=118054&atid=679906
>>>>
>>>> SS
>>>>
>>>> On Fri, Mar 6, 2009 at 11:08 AM, Sunburned Surveyor
>>>> <sunburned.surveyor@...> wrote:
>>>>>
>>>>> I will start work on squishing the bug that has to do with "phantom"
>>>>> feature selections produced by the spatial query functionality in
>>>>> OpenJUMP.
>>>>>
>>>>> Can anyone tell me if the spatial query functionality is part of the
>>>>> core program, or part of a plug-in? That will help me track down the
>>>>> source code so I can get started.
>>>>>
>>>>> SS
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>>>> CA
>>>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>>>> Enterprise
>>>> -Strategies to boost innovation and cut costs with open source
>>>> participation
>>>> -Receive a $600 discount off the registration fee with the source code:
>>>> SFAD
>>>> http://p.sf.net/sfu/XcvMzF8H
>>>> _______________________________________________
>>>> Jump-pilot-devel mailing list
>>>> Jump-pilot-devel@...
>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>>> -Strategies to boost innovation and cut costs with open source participation
>>> -Receive a $600 discount off the registration fee with the source code: SFAD
>>> http://p.sf.net/sfu/XcvMzF8H
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@...
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>
>>>
>>
>