Opened 19 years ago
Last modified 15 years ago
#1103 new defect
Layer tolerance default value — at Version 21
Reported by: | jlacroix | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 6.0 release |
Component: | MapServer C Library | Version: | 4.4 |
Severity: | normal | Keywords: | |
Cc: | jmckenna@… |
Description (last modified by )
The tolerance default value in the layer is 0. This works well with polygon layers since this value will return query result for a click inside the polygon. However for line and point layers a tolerance of 0 seems always return nothing (It's the like the layer is not queryable). In the documentation the default tolerance is marked as 3, but in the code it's 0. Should we update the documentation or update the tolerance value? Steve?
Change History (21)
comment:2 by , 19 years ago
Cc: | added |
---|
I agree with you on this one. Since we don't know the layer type at the beginning we can't set the default tolerance. I will add Jeff in CC to update the Doc. Jeff: The Layer TOLERANCE default value is 0, not 3 like stated in the doc. Steve: Maybe we can reuse the same trick for layer tolerance default value that we use for the symbol default size. Set it to -1 by default. When doing a query, use the tolerance value or a default value based on the layer type if it's -1. Just want to have a thought on this.
comment:3 by , 19 years ago
Julien: Good idea on setting tolerance in the query functions. Let's pursue that for 4.6, but update the documentation now. Steve
comment:4 by , 19 years ago
Milestone: | → 4.6 release |
---|
Aiming 4.6 for the dynamic tolerance default value. I may take care of this one if I have time.
comment:5 by , 19 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Reassign to me, I will start working on this today.
comment:6 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I implemented this. The default is now -1. When doing a query, it check for the layer type. If it's a POINT or a LINE, the default is 3. For all other layer types, the default is 0. Marking as FIXED. Reopen if you see any other issue.
comment:7 by , 19 years ago
Where specifically is the default being set now? Queries are notoriously complex and you would've had to modify a number of functions. Just want to make sure nothing was missed... Steve
comment:8 by , 19 years ago
It seems that the query stuff was only using the tolerance value from the layer object only at 4 places. you can grep on "layer_tolerance" to see where this is. If I forgot something, please reopen and I will try to fix it.
comment:10 by , 19 years ago
dependson: | → 1323 |
---|
comment:11 by , 19 years ago
Sorry for the late answer jeff. I opened bug 1323 for updating the documentation about this. Just to know, where are the files to update for the doc?
comment:12 by , 19 years ago
no problem :pserver:msdoc@cvs.gis.umn.edu:/data2/cvsroot module: mapserver_docs file: mapfile-reference.xml i'm on it
comment:14 by , 19 years ago
Keywords: | VERIFIED removed |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
I think we may need to re-examine this. I just ran into a situation where these mods didn't make sense. Specifically with the query by shape functions. I'm not sure anything but a default tolerance of 0 for all layer types makes sense for these functions. If you're not careful it's easy to over select points with polygons by default. To me if I'm using a polygon to select points the default should be only the points in the polygon. That's not the case now. I'm of the opinion now that that default of 3 for points and lines makes sense with point based queries only but in all other cases the default should be 0. Thoughts? Steve
comment:15 by , 19 years ago
Any thoughts on this guys? It's really a problem because in some cases because you can end up with more results than you should have. Depending on the situation that's a very subtle error. I prefer less subtle errors like no points found. I think we can do better. A default tolerance of 0 should be used for points and lines when using doing box or polygon queries. A tolerance of 3 makes sense with point or line-based queries. Steve
comment:16 by , 18 years ago
i was just trying to test comment#13. I tested with cgi (itasca demo, rubberband box query) and phpmapscript (gmap demo, box query) and could not over-select points (and i removed tolerance values set in mapfile) I tested with 4.8.0-rc2. sorry.
comment:17 by , 18 years ago
The place I ran into this with was when querying by shape within MapScript and it wreaked havoc trying to debug because points outside the query shape were being selected and the number selected varied by image resolution (where the tolerance is computed). The persons doing the development were expecting strict intersection when using non-point based selection and that's not that case. The software is working correctly, just not in the way the user expects. On one hand this is simply a RTFM problem. On the otherhand a tolerance other than 0 only makes sense for point-based queries of points and lines. Steve
comment:19 by , 18 years ago
Steve do you think it's possible to use different default values only in case of point and line queries? I think only in case of point query is feasible since it got its own function.
comment:20 by , 18 years ago
Milestone: | 4.6 release → FUTURE |
---|
Yup, I think it's possible. The only place right now we should set a default tolerance other than zero would be in msQueryByPoint(). We could also do something in msQueryByFeature and msQueryByShape based on feature/shape type but those functions only support polygon selection shapes. Mind you, this is nothing that needs to be fixed ASAP so I'm marking as future... Steve
comment:21 by , 15 years ago
Description: | modified (diff) |
---|---|
Milestone: | FUTURE → 6.0 release |
This just bit a user from MapScript. The msQueryByShape function
Note:
See TracTickets
for help on using tickets.