Changeset 11575 in josm


Ignore:
Timestamp:
2017-02-18T12:34:15+01:00 (8 years ago)
Author:
stoecker
Message:

see #12313 - add best marking and show it in image preferences

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/maps.xsd

    r9610 r11575  
    661661                                                        <!-- A base64-encoded image that is displayed as menu/toolbar icon -->
    662662                                                        <xs:element name="icon" minOccurs="0" maxOccurs="1" type="xs:string" />
     663                                                        <!-- Date in form YYYY-MM-DD;YYYY-MM-DD (each element after first year is optional -->
     664                                                        <xs:element name="date" minOccurs="0" maxOccurs="1" type="xs:string" />
    663665                                                        <xs:element name="mirror" minOccurs="0">
    664666                                                                <xs:complexType>
     
    703705                                        </xs:sequence>
    704706                                        <xs:attribute name="last-check" type="xs:date" use="optional" />
     707                                        <xs:attribute name="eli-best" type="xs:boolean" use="optional" />
    705708                                </xs:complexType>
    706709                        </xs:element>
  • trunk/scripts/SyncEditorImageryIndex.groovy

    r11574 r11575  
    564564    }
    565565    static String getQuality(Object e) {
    566         //if (e instanceof ImageryInfo) return "".equals(e.getQuality()) ? null : e.getQuality()
    567         if (e instanceof ImageryInfo) return null
    568         return e.get("properties").get("best") ? "best" : null
     566        if (e instanceof ImageryInfo) return e.isBestMarked() ? "eli-best" : null
     567        return e.get("properties").get("best") ? "eli-best" : null
    569568    }
    570569    static String getIcon(Object e) {
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r11572 r11575  
    194194      */
    195195    private String date;
     196    /**
     197      * marked as best in other editors
     198      * @since 11575
     199      */
     200    private boolean bestMarked = false;
    196201    /** mirrors of different type for this entry */
    197202    private List<ImageryInfo> mirrors;
    198203    /** icon used in menu */
    199204    private String icon;
     205    /** is the geo reference correct - don't offer offset handling */
    200206    private boolean isGeoreferenceValid;
     207    /** does the EPSG:4326 to mercator woraround work as expected */
    201208    private boolean isEpsg4326To3857Supported;
    202209    /** which layers should be activated by default on layer addition. **/
     
    237244        @pref Map<String, String> metadataHeaders;
    238245        @pref boolean valid_georeference;
     246        @pref boolean bestMarked;
    239247        @pref boolean supports_epsg_4326_to_3857_conversion;
    240248        // TODO: disabled until change of layers is implemented
     
    262270            attribution_url = i.attributionLinkURL;
    263271            date = i.date;
     272            bestMarked = i.bestMarked;
    264273            logo_image = i.attributionImage;
    265274            logo_url = i.attributionImageURL;
     
    418427        attributionImageURL = e.logo_url;
    419428        date = e.date;
     429        bestMarked = e.bestMarked;
    420430        termsOfUseText = e.terms_of_use_text;
    421431        termsOfUseURL = e.terms_of_use_url;
     
    444454        this.origName = i.origName;
    445455        this.langName = i.langName;
     456        this.bestMarked = i.bestMarked;
    446457        this.defaultEntry = i.defaultEntry;
    447458        this.cookies = i.cookies;
     
    494505                Objects.equals(this.id, other.id) &&
    495506                Objects.equals(this.url, other.url) &&
     507                Objects.equals(this.bestMarked, other.bestMarked) &&
     508                Objects.equals(this.isEpsg4326To3857Supported, other.isEpsg4326To3857Supported) &&
     509                Objects.equals(this.isGeoreferenceValid, other.isGeoreferenceValid) &&
    496510                Objects.equals(this.cookies, other.cookies) &&
    497511                Objects.equals(this.eulaAcceptanceRequired, other.eulaAcceptanceRequired) &&
     
    852866            html = true;
    853867        }
     868        if (bestMarked) {
     869            res += "<br>" + tr("This imagery is marked as best in this region in other editors.");
     870        }
    854871        String desc = getDescription();
    855872        if (desc != null && !desc.isEmpty()) {
     
    11541171    public void setGeoreferenceValid(boolean isGeoreferenceValid) {
    11551172        this.isGeoreferenceValid = isGeoreferenceValid;
     1173    }
     1174
     1175    /**
     1176     * Returns the status of "best" marked status in other editors.
     1177     * @return <code>true</code> if it is marked as best.
     1178     * @since 11575
     1179     */
     1180    public boolean isBestMarked() {
     1181        return bestMarked;
     1182    }
     1183
     1184    /**
     1185     * Sets an indicator that in other editors it is marked as best imagery
     1186     * @param bestMarked <code>true</code> if it is marked as best in other editors.
     1187     * @since 11575
     1188     */
     1189    public void setBestMarked(boolean bestMarked) {
     1190        this.bestMarked = bestMarked;
    11561191    }
    11571192
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r11570 r11575  
    154154                    noTileChecksums = new MultiMap<>();
    155155                    metadataHeaders = new HashMap<>();
     156                    String best = atts.getValue("eli-best");
     157                    if ("true".equals(best)) {
     158                        entry.setBestMarked(true);
     159                    }
    156160                }
    157161                break;
Note: See TracChangeset for help on using the changeset viewer.