Changeset 33959 for other-projects
- Timestamp:
- 2020-02-20T20:06:41+13:00 (4 years ago)
- Location:
- other-projects/maori-lang-detection/src/org/greenstone/atea
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/src/org/greenstone/atea/CountryCodeCountsMapData.java
r33938 r33959 116 116 static private final String DATA_STR = "#data=data:application/json,"; 117 117 118 // "http://geojson.io" has a URL API to programmatically access 119 /* 118 /* "http://geojson.io" has a URL API to programmatically get it to generate 119 a map from a geojson URL parameter. 120 120 121 See http://geojson.io/ -> Help 121 122 … … 140 141 141 142 http://geojson.io/#data=data:application/json,%7B%22type%22%3A%22LineString%22%2C%22coordinates%22%3A%5B%5B0%2C0%5D%2C%5B10%2C10%5D%5D%7D 143 144 The above uses JavaScript's encodeURIComponent(). Although partly different from 145 URL.encode() in Java, it's not different in our case. 146 However, using URL.encode() does end up producing a string that is not recognised by 147 geojson.io's parser. Unencoded, the string is recognised fine. 142 148 */ 143 149 … … 635 641 // https://stackoverflow.com/questions/607176/java-equivalent-to-javascripts-encodeuricomponent-that-produces-identical-outpu 636 642 featuresGeojsonString = URLEncoder.encode(featuresGeojsonString); 637 638 643 } 639 644 return featuresGeojsonString; … … 641 646 642 647 public String getAsMapURL() { 643 boolean uriEncoded = true; 648 // geojson.io advises to call JavaScript's encodeURIComponent() on the string 649 // which for the geojson strings we're dealing with is the same as Java's URI.encode(). 650 // But uriEncoding our geojson produces a string unparseable by geojson.io, 651 // whereas the unencoded string is recognised. Not sure why. Turning off uriEncoding. 652 boolean uriEncoded = false; 644 653 String url = GEOJSON_MAP_TOOL_URL + DATA_STR + getFeaturesGeoJsonString(uriEncoded); 645 654 … … 682 691 // https://bitsofco.de/using-a-headless-browser-to-capture-page-screenshots/ 683 692 // https://developers.google.com/web/updates/2017/04/headless-chrome 693 684 694 685 695 String[] cmdArgs = { -
other-projects/maori-lang-detection/src/org/greenstone/atea/ManualURLInspection.java
r33952 r33959 58 58 public static final String POEMS_OR_SONGS = "POEMS_OR_SONGS"; 59 59 public static final String SINGLE_MRI_SENTENCE = "SINGLE_MRI_SENTENCE"; // TODO: REVIEW 60 // TODO: ADD NEW String "POS_TITLES_OR_LINK_TEXT" for work designations and link text 60 public static final String LINK_TEXT = "LINK_TEXT"; 61 // TODO: ADD NEW String "POS_TITLES_OR_LINK_TEXT" for office designations and link text 61 62 62 63
Note:
See TracChangeset
for help on using the changeset viewer.