Changeset 16127 in josm
- Timestamp:
- 2020-03-15T00:03:59+01:00 (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/resources/data/maps.xsd
r16117 r16127 665 665 <!-- The area of use, e.g. <bounds min-lat='45.7' min-lon='5.9' max-lat='55.0' max-lon='17.3'/> --> 666 666 <xs:element name="bounds" minOccurs="0" maxOccurs="1" type="tns:bounds" /> 667 <!-- A link to the privacy policy of the operator --> 668 <xs:element name="privacy-policy-url" minOccurs="0" maxOccurs="1" type="xs:anyURI" /> 667 669 <!-- Provide a source that this background can be used for OSM. A page on the OSM-wiki with additional explanation and further references is preferred, but other sources (for example the license text) can also be linked. --> 668 670 <xs:element name="permission-ref" minOccurs="0" maxOccurs="1" type="xs:anyURI" /> -
trunk/scripts/SyncEditorLayerIndex.java
r16098 r16127 442 442 if (isNotBlank(t = getPermissionReferenceUrl(e))) 443 443 stream.write(" <permission-ref>"+cdata(t)+"</permission-ref>\n"); 444 if (isNotBlank(t = getPrivacyPolicyUrl(e))) 445 stream.write(" <privacy-policy-url>"+cdata(t)+"</privacy-policy-url>\n"); 444 446 if ((getValidGeoreference(e))) 445 447 stream.write(" <valid-georeference>true</valid-georeference>\n"); … … 757 759 758 760 compareDescriptions(e, j); 761 comparePrivacyPolicyUrls(e, j); 759 762 comparePermissionReferenceUrls(e, j); 760 763 compareAttributionUrls(e, j); … … 777 780 } else if (!optionNoEli) { 778 781 myprintln("+ Missing ELI description ('"+jt+"'): "+getDescription(j)); 782 } 783 } 784 } 785 786 void comparePrivacyPolicyUrls(JsonObject e, ImageryInfo j) { 787 String et = getPrivacyPolicyUrl(e); 788 String jt = getPrivacyPolicyUrl(j); 789 if (!Objects.equals(et, jt)) { 790 if (isBlank(jt)) { 791 myprintln("- Missing JOSM privacy policy URL ("+et+"): "+getDescription(j)); 792 } else if (isNotBlank(et)) { 793 myprintln("+ Privacy policy URL differs ('"+et+"' != '"+jt+"'): "+getDescription(j)); 794 } else if (!optionNoEli) { 795 myprintln("+ Missing ELI privacy policy URL ('"+jt+"'): "+getDescription(j)); 779 796 } 780 797 } … … 1449 1466 } 1450 1467 1468 static String getPrivacyPolicyUrl(Object e) { 1469 if (e instanceof ImageryInfo) return ((ImageryInfo) e).getPrivacyPolicyURL(); 1470 return ((Map<String, JsonObject>) e).get("properties").getString("privacy_policy_url", null); 1471 } 1472 1451 1473 static Map<String, Set<String>> getNoTileHeader(Object e) { 1452 1474 if (e instanceof ImageryInfo) return ((ImageryInfo) e).getNoTileHeaders(); -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r16101 r16127 260 260 /** Text of a text attribution displayed when using the imagery */ 261 261 private String attributionText; 262 /** Link to the privacy policy of the operator */ 263 private String privacyPolicyURL; 262 264 /** Link to a reference stating the permission for OSM usage */ 263 265 private String permissionReferenceURL; … … 828 830 } 829 831 832 /** 833 * Return the privacy policy URL. 834 * @return The url 835 * @see #setPrivacyPolicyURL 836 * @since 16127 837 */ 838 public String getPrivacyPolicyURL() { 839 return privacyPolicyURL; 840 } 841 830 842 @Override 831 843 public Image getAttributionImage() { … … 905 917 public void setPermissionReferenceURL(String url) { 906 918 permissionReferenceURL = url; 919 } 920 921 /** 922 * Sets the privacy policy URL. 923 * @param url The url. 924 * @see #getPrivacyPolicyURL() 925 * @since 16127 926 */ 927 public void setPrivacyPolicyURL(String url) { 928 privacyPolicyURL = url; 907 929 } 908 930 -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r15716 r16127 220 220 "terms-of-use-text", 221 221 "terms-of-use-url", 222 "privacy-policy-url", 222 223 "permission-ref", 223 224 "country-code", … … 485 486 entry.setTermsOfUseText(accumulator.toString()); 486 487 break; 488 case "privacy-policy-url": 489 entry.setPrivacyPolicyURL(accumulator.toString()); 490 break; 487 491 case "permission-ref": 488 492 entry.setPermissionReferenceURL(accumulator.toString());
Note:
See TracChangeset
for help on using the changeset viewer.