Changeset 8198 in josm for trunk/src/org
- Timestamp:
- 2015-04-15T22:31:53+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/search
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r8131 r8198 435 435 .addKeyword("role:", "role:", tr("objects with given role in a relation")) 436 436 .addKeyword("areasize:<i>-100</i>", "areasize:", tr("closed ways with an area of 100 m\u00b2")) 437 .addKeyword("waylength:<i>200-</i>", "waylength:", tr("ways with a length of 200 m or more")) 437 438 , GBC.eol()); 438 439 right.add(new SearchKeywordRow(hcbSearchString) -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r7509 r8198 99 99 public class CoreSimpleMatchFactory implements SimpleMatchFactory { 100 100 private Collection<String> keywords = Arrays.asList("id", "version", 101 "changeset", "nodes", "tags", "areasize", " modified", "selected",101 "changeset", "nodes", "tags", "areasize", "waylength", "modified", "selected", 102 102 "incomplete", "untagged", "closed", "new", "indownloadedarea", 103 103 "allindownloadedarea", "inview", "allinview", "timestamp", "nth", "nth%"); … … 141 141 case "areasize": 142 142 return new AreaSize(tokenizer); 143 case "waylength": 144 return new WayLength(tokenizer); 143 145 case "nth": 144 146 return new Nth(tokenizer, false); … … 1115 1117 1116 1118 /** 1119 * Matches if the length of a way is within the given range 1120 */ 1121 private static class WayLength extends RangeMatch { 1122 1123 public WayLength(Range range) { 1124 super(range); 1125 } 1126 1127 public WayLength(PushbackTokenizer tokenizer) throws ParseError { 1128 this(tokenizer.readRange(tr("Range of numbers expected"))); 1129 } 1130 1131 @Override 1132 protected Long getNumber(OsmPrimitive osm) { 1133 if (!(osm instanceof Way)) 1134 return null; 1135 Way way = (Way) osm; 1136 return (long) way.getLength(); 1137 } 1138 1139 @Override 1140 protected String getString() { 1141 return "waylength"; 1142 } 1143 } 1144 1145 /** 1117 1146 * Matches objects within the given bounds. 1118 1147 */
Note:
See TracChangeset
for help on using the changeset viewer.