Changeset 30731 in osm for applications/editors/josm/plugins/opendata/modules/be.bruxelles
- Timestamp:
- 2014-10-18T15:31:53+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/opendata/modules/be.bruxelles
- Files:
-
- 5 edited
-
build.xml (modified) (1 diff)
-
src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/BruxellesConstants.java (modified) (1 diff)
-
src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/BruxellesModule.java (modified) (1 diff)
-
src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/BruxellesDataSetHandler.java (modified) (1 diff)
-
src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/culture/BDHandler.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/be.bruxelles/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 <!-- conditions -->16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/BruxellesConstants.java
r30563 r30731 4 4 5 5 public interface BruxellesConstants { 6 7 /**8 * Source9 */10 public static final String SOURCE_BRUXELLES = "Ville de Bruxelles";11 12 /**13 * Portal14 */15 public static final String PORTAL_EN = "http://www.brussels.be";16 public static final String PORTAL_FR = "http://www.bruxelles.be";17 public static final String PORTAL_NL = "http://www.brussel.be";6 7 /** 8 * Source 9 */ 10 public static final String SOURCE_BRUXELLES = "Ville de Bruxelles"; 11 12 /** 13 * Portal 14 */ 15 public static final String PORTAL_EN = "http://www.brussels.be"; 16 public static final String PORTAL_FR = "http://www.bruxelles.be"; 17 public static final String PORTAL_NL = "http://www.brussel.be"; 18 18 } -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/BruxellesModule.java
r30340 r30731 8 8 public class BruxellesModule extends AbstractModule { 9 9 10 public BruxellesModule(ModuleInformation info) {11 super(info);12 handlers.add(BDHandler.class);10 public BruxellesModule(ModuleInformation info) { 11 super(info); 12 handlers.add(BDHandler.class); 13 13 } 14 14 } -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/BruxellesDataSetHandler.java
r30340 r30731 11 11 12 12 public abstract class BruxellesDataSetHandler extends BelgianDataSetHandler implements BruxellesConstants { 13 14 private Integer localPortalId;15 16 public BruxellesDataSetHandler() {17 init(null, null);18 }13 14 private Integer localPortalId; 15 16 public BruxellesDataSetHandler() { 17 init(null, null); 18 } 19 19 20 public BruxellesDataSetHandler(Integer portalId) {21 init(portalId, null);22 }20 public BruxellesDataSetHandler(Integer portalId) { 21 init(portalId, null); 22 } 23 23 24 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection) {25 init(portalId, singleProjection);26 }24 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection) { 25 init(portalId, singleProjection); 26 } 27 27 28 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection, String relevantTag) {29 super(relevantTag);30 init(portalId, singleProjection);31 }28 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection, String relevantTag) { 29 super(relevantTag); 30 init(portalId, singleProjection); 31 } 32 32 33 public BruxellesDataSetHandler(Integer portalId, String relevantTag) {34 super(relevantTag);35 init(portalId, null);36 }33 public BruxellesDataSetHandler(Integer portalId, String relevantTag) { 34 super(relevantTag); 35 init(portalId, null); 36 } 37 37 38 private void init(Integer portalId, Projection singleProjection) {39 setSingleProjection(singleProjection);40 this.localPortalId = portalId;41 }38 private void init(Integer portalId, Projection singleProjection) { 39 setSingleProjection(singleProjection); 40 this.localPortalId = portalId; 41 } 42 42 43 @Override44 public String getSource() {45 return SOURCE_BRUXELLES;46 }43 @Override 44 public String getSource() { 45 return SOURCE_BRUXELLES; 46 } 47 47 48 @Override49 public URL getLocalPortalURL() {50 String basePortal = null;51 String lang = OdUtils.getJosmLanguage();52 53 if (lang.startsWith("fr")) {54 basePortal = PORTAL_FR;55 } else if (lang.startsWith("nl")) {56 basePortal = PORTAL_NL;57 } else {58 basePortal = PORTAL_EN;59 }48 @Override 49 public URL getLocalPortalURL() { 50 String basePortal = null; 51 String lang = OdUtils.getJosmLanguage(); 52 53 if (lang.startsWith("fr")) { 54 basePortal = PORTAL_FR; 55 } else if (lang.startsWith("nl")) { 56 basePortal = PORTAL_NL; 57 } else { 58 basePortal = PORTAL_EN; 59 } 60 60 61 try {62 return new URL(basePortal + "/artdet.cfm?id=" + localPortalId);63 } catch (MalformedURLException e) {64 e.printStackTrace();65 return null;66 }67 }61 try { 62 return new URL(basePortal + "/artdet.cfm?id=" + localPortalId); 63 } catch (MalformedURLException e) { 64 e.printStackTrace(); 65 return null; 66 } 67 } 68 68 } -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/culture/BDHandler.java
r30340 r30731 8 8 public class BDHandler extends BruxellesDataSetHandler { 9 9 10 public BDHandler() {11 getCsvHandler().setSeparator(",");12 }13 14 @Override15 public boolean acceptsFilename(String filename) {16 return acceptsCsvFilename(filename, "textfile");17 }10 public BDHandler() { 11 getCsvHandler().setSeparator(","); 12 } 13 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsCsvFilename(filename, "textfile"); 17 } 18 18 19 @Override20 public void updateDataSet(DataSet ds) {21 for (Node n : ds.getNodes()) {22 n.put("tourism", "artwork");23 replace(n, "Description", "name");24 }25 }19 @Override 20 public void updateDataSet(DataSet ds) { 21 for (Node n : ds.getNodes()) { 22 n.put("tourism", "artwork"); 23 replace(n, "Description", "name"); 24 } 25 } 26 26 }
Note:
See TracChangeset
for help on using the changeset viewer.
