Changeset 33518 in osm for applications/editors/josm/plugins/opendata/modules/fr.toulouse
- Timestamp:
- 2017-08-25T22:50:43+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/ToulouseModule.java
r30701 r33518 6 6 import java.util.TreeSet; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.osm.DataSet; 10 9 import org.openstreetmap.josm.data.osm.Relation; 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 12 12 import org.openstreetmap.josm.io.OsmTransferException; … … 109 109 handlers.add(PointsLumineuxHandler.class); 110 110 } 111 111 112 112 public static final DataSet data = new DataSet(); 113 113 114 114 private static final Collection<Relation> getBoundaries(int admin_level) { 115 115 Collection<Relation> result = new TreeSet<>(new Comparator<Relation>() { … … 127 127 synchronized (data) { 128 128 for (Relation r : data.getRelations()) { 129 if (r.hasTag("admin_level", Integer.toString(admin_level)) && 129 if (r.hasTag("admin_level", Integer.toString(admin_level)) && 130 130 (r.hasKey("name") || r.hasKey("ref") || r.hasKey("description"))) { 131 131 result.add(r); … … 135 135 return result; 136 136 } 137 137 138 138 public static final void downloadData() { 139 139 synchronized (data) { … … 141 141 for (final ToulouseDataSetHandler handler : new ToulouseDataSetHandler[]{ 142 142 new CommuneHandler(), new SecteursHandler(), new QuartiersHandler()}) { 143 Main .worker.submit(new Runnable() {143 MainApplication.worker.submit(new Runnable() { 144 144 @Override 145 145 public void run() { … … 160 160 } 161 161 } 162 162 163 163 public static final Collection<Relation> getMunicipalities() { 164 164 return getBoundaries(8); 165 165 } 166 166 167 167 public static final Collection<Relation> getSectors() { 168 168 return getBoundaries(10); -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/ToulouseDataSetHandler.java
r32934 r33518 10 10 import java.util.Collections; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.actions.JosmAction; 14 13 import org.openstreetmap.josm.data.osm.DataSet; … … 27 26 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 28 27 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 28 import org.openstreetmap.josm.gui.MainApplication; 29 29 import org.openstreetmap.josm.plugins.opendata.OdPlugin; 30 30 import org.openstreetmap.josm.plugins.opendata.core.datasets.DataSetCategory; … … 142 142 public void actionPerformed(ActionEvent e) { 143 143 final String baseName = OdPlugin.getInstance().getDialog().getDataLayer().getName(); 144 final DataSet baseDs = Main .getLayerManager().getEditDataSet();144 final DataSet baseDs = MainApplication.getLayerManager().getEditDataSet(); 145 145 for (OsmPrimitive boundary : getBoundaries()) { 146 146 DataSet data = new DataSet(); … … 162 162 name = boundary.get("description"); 163 163 } 164 Main .getLayerManager().addLayer(new OdDataLayer(data, baseName+"/"+name, null, ToulouseDataSetHandler.this));164 MainApplication.getLayerManager().addLayer(new OdDataLayer(data, baseName+"/"+name, null, ToulouseDataSetHandler.this)); 165 165 } 166 166 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/associations/Club3eAgeHandler.java
r30340 r33518 2 2 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.associations; 3 3 4 import org.apache.commons. lang3.text.WordUtils;4 import org.apache.commons.text.WordUtils; 5 5 import org.openstreetmap.josm.data.osm.DataSet; 6 6 import org.openstreetmap.josm.data.osm.Node; … … 14 14 setCategory(CAT_ASSOCIATIONS); 15 15 } 16 16 17 17 @Override 18 18 public boolean acceptsFilename(String filename) { -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/culture/MuseeHandler.java
r30340 r33518 2 2 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.culture; 3 3 4 import org.apache.commons. lang3.text.WordUtils;4 import org.apache.commons.text.WordUtils; 5 5 import org.openstreetmap.josm.data.osm.DataSet; 6 6 import org.openstreetmap.josm.data.osm.Node; -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/enfance/CrechesHandler.java
r30340 r33518 2 2 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.enfance; 3 3 4 import org.apache.commons. lang3.text.WordUtils;4 import org.apache.commons.text.WordUtils; 5 5 import org.openstreetmap.josm.data.osm.DataSet; 6 6 import org.openstreetmap.josm.data.osm.Node; -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/enfance/EcoleElementaireHandler.java
r30340 r33518 2 2 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.enfance; 3 3 4 import org.apache.commons. lang3.text.WordUtils;4 import org.apache.commons.text.WordUtils; 5 5 import org.openstreetmap.josm.data.osm.DataSet; 6 6 import org.openstreetmap.josm.data.osm.Node; … … 13 13 setWikiPage("Écoles élémentaires publiques"); 14 14 setCategory(CAT_ENFANCE); 15 for (String forbidden : new String[]{"maternelle", "primaire","collège","lycée","secondaire"}) {15 for (String forbidden : new String[]{"maternelle", "primaire", "collège", "lycée", "secondaire"}) { 16 16 addForbiddenTag("school:FR="+forbidden); 17 17 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/services/MarchesPleinVentHandler.java
r30340 r33518 2 2 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.services; 3 3 4 import org.apache.commons. lang3.text.WordUtils;4 import org.apache.commons.text.WordUtils; 5 5 import org.openstreetmap.josm.data.osm.DataSet; 6 6 import org.openstreetmap.josm.data.osm.Node; … … 29 29 @Override public String replace(String value) { 30 30 return WordUtils.capitalizeFully(value).replace(", ", "").replace("MarchÉ", "Marché"); 31 } });31 } }); 32 32 n.put("amenity", "marketplace"); 33 33 replace(n, "Type", "note"); 34 34 String hours = ""; 35 35 for (String[] day : new String[][]{ 36 new String[]{"Lundi", "Mo"},37 new String[]{"mardi", "Tu"},38 new String[]{"mercredi", "We"},39 new String[]{"jeudi", "Th"},40 new String[]{"vendredi", "Fr"},41 new String[]{"samedi", "Sa"},42 new String[]{"dimanche", "Su"}36 new String[]{"Lundi", "Mo"}, 37 new String[]{"mardi", "Tu"}, 38 new String[]{"mercredi", "We"}, 39 new String[]{"jeudi", "Th"}, 40 new String[]{"vendredi", "Fr"}, 41 new String[]{"samedi", "Sa"}, 42 new String[]{"dimanche", "Su"} 43 43 }) { 44 44 String value = n.get(day[0]); -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/HorodateurHandler.java
r30920 r33518 5 5 import java.util.regex.Pattern; 6 6 7 import org.apache.commons. lang3.text.WordUtils;7 import org.apache.commons.text.WordUtils; 8 8 import org.openstreetmap.josm.data.osm.DataSet; 9 9 import org.openstreetmap.josm.data.osm.Node; … … 23 23 return acceptsCsvKmzTabFilename(filename, "Horodateur"); 24 24 } 25 25 26 26 private String parseHour(String hour) { 27 27 String s = hour.replaceFirst("[hH]", ":"); … … 31 31 return s; 32 32 } 33 33 34 34 protected String parseOpeningHours(String horaire) { 35 35 final String hour = "\\p{Digit}{1,2}[hH]\\p{Digit}{0,2}"; -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/VeloToulouseHandler.java
r30340 r33518 2 2 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.transport; 3 3 4 import org.apache.commons. lang3.text.WordUtils;4 import org.apache.commons.text.WordUtils; 5 5 import org.openstreetmap.josm.data.osm.DataSet; 6 6 import org.openstreetmap.josm.data.osm.Node;
Note:
See TracChangeset
for help on using the changeset viewer.