Changeset 30731 in osm for applications/editors/josm/plugins/opendata/modules/be.bruxelles/src
- Timestamp:
- 2014-10-18T15:31:53+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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 9 10 11 12 13 14 15 16 17 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 11 12 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 15 16 17 18 13 14 private Integer localPortalId; 15 16 public BruxellesDataSetHandler() { 17 init(null, null); 18 } 19 19 20 21 22 20 public BruxellesDataSetHandler(Integer portalId) { 21 init(portalId, null); 22 } 23 23 24 25 26 24 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection) { 25 init(portalId, singleProjection); 26 } 27 27 28 29 30 31 28 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection, String relevantTag) { 29 super(relevantTag); 30 init(portalId, singleProjection); 31 } 32 32 33 34 35 36 33 public BruxellesDataSetHandler(Integer portalId, String relevantTag) { 34 super(relevantTag); 35 init(portalId, null); 36 } 37 37 38 39 40 41 38 private void init(Integer portalId, Projection singleProjection) { 39 setSingleProjection(singleProjection); 40 this.localPortalId = portalId; 41 } 42 42 43 44 45 46 43 @Override 44 public String getSource() { 45 return SOURCE_BRUXELLES; 46 } 47 47 48 49 50 51 52 53 54 55 56 57 58 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 62 63 64 65 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 11 12 13 14 15 16 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 20 21 22 23 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.