Changeset 28113 in osm for applications/editors/josm/plugins/opendata/modules
- Timestamp:
- 2012-03-19T00:23:49+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/opendata/modules
- Files:
-
- 3 added
- 23 edited
-
be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/BruxellesDataSetHandler.java (modified) (2 diffs)
-
be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/culture/BDHandler.java (modified) (2 diffs)
-
be.datagovbe/src/org/openstreetmap/josm/plugins/opendata/modules/be/datagovbe/datasets/DataGovDataSetHandler.java (modified) (2 diffs)
-
fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/datasets/Cg41DataSetHandler.java (modified) (4 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/DataGouvDataSetHandler.java (modified) (3 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/administration/GeoFlaHandler.java (modified) (2 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/culture/BibliothequesHandler.java (modified) (3 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/diplomatie/EtabAEFEHandler.java (modified) (2 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/AssainissementHandler.java (modified) (2 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/Etab1er2ndDegreHandler.java (modified) (2 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/EtabSupHandler.java (modified) (2 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java (modified) (3 diffs)
-
fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/transport/PassageNiveauHandler.java (modified) (3 diffs)
-
fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/LeMansDataSetHandler.java (modified) (4 diffs)
-
fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/ParisLicense.java (added)
-
fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/ParisDataSetHandler.java (modified) (3 diffs)
-
fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/SanisettesHandler.java (modified) (2 diffs)
-
fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/SncfLicense.java (added)
-
fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/datasets/EquipementsHandler.java (modified) (3 diffs)
-
fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/datasets/SncfDataSetHandler.java (modified) (3 diffs)
-
fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/ToulouseConstants.java (modified) (1 diff)
-
fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/ToulouseLicense.java (added)
-
fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/ToulouseDataSetHandler.java (modified) (3 diffs)
-
fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/ChantiersPonctuelsHandler.java (modified) (3 diffs)
-
fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/PistesCyclablesHandler.java (modified) (3 diffs)
-
fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/ReseauTisseoHandler.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/BruxellesDataSetHandler.java
r28000 r28113 18 18 import java.net.MalformedURLException; 19 19 import java.net.URL; 20 import java.util.Locale;21 20 22 import org.openstreetmap.josm.Main;23 21 import org.openstreetmap.josm.data.projection.Projection; 24 22 import org.openstreetmap.josm.plugins.opendata.core.datasets.be.BelgianDataSetHandler; 23 import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils; 25 24 import org.openstreetmap.josm.plugins.opendata.modules.be.bruxelles.BruxellesConstants; 26 25 … … 70 69 public URL getLocalPortalURL() { 71 70 String basePortal = null; 72 String lang = Main.pref.get("language"); 73 if (lang == null || lang.isEmpty()) { 74 lang = Locale.getDefault().toString(); 75 } 71 String lang = OdUtils.getJosmLanguage(); 76 72 77 73 if (lang.startsWith("fr")) { -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/culture/BDHandler.java
r28000 r28113 7 7 public class BDHandler extends BruxellesDataSetHandler { 8 8 9 public BDHandler() { 10 getCsvHandler().setSeparator(","); 11 } 12 9 13 @Override 10 14 public boolean acceptsFilename(String filename) { … … 19 23 } 20 24 } 21 22 /* (non-Javadoc)23 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvSeparator()24 */25 @Override26 public String getCsvSeparator() {27 return ",";28 }29 25 } -
applications/editors/josm/plugins/opendata/modules/be.datagovbe/src/org/openstreetmap/josm/plugins/opendata/modules/be/datagovbe/datasets/DataGovDataSetHandler.java
r28000 r28113 15 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 16 package org.openstreetmap.josm.plugins.opendata.modules.be.datagovbe.datasets; 17 18 import java.net.URL;19 17 20 18 import org.openstreetmap.josm.data.projection.Projection; … … 58 56 return SOURCE_DATAGOVBE; 59 57 } 60 61 /* (non-Javadoc)62 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLocalPortalURL()63 */64 @Override65 public URL getLocalPortalURL() {66 return null;67 }68 58 } -
applications/editors/josm/plugins/opendata/modules/fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/datasets/Cg41DataSetHandler.java
r28000 r28113 2 2 3 3 import java.net.MalformedURLException; 4 import java.net.URL;5 4 6 5 import org.openstreetmap.josm.data.osm.Tag; … … 9 8 10 9 public abstract class Cg41DataSetHandler extends FrenchDataSetHandler implements Cg41Constants { 11 12 private int portalId;13 10 14 11 public Cg41DataSetHandler(int portalId, String nationalPath) { … … 36 33 37 34 private final void init(int portalId, String nationalPath) { 38 this.portalId = portalId;39 35 setNationalPortalPath(nationalPath); 36 try { 37 if (portalId > 0) { 38 setLocalPortalURL(PORTAL_CG41 + portalId); 39 } 40 } catch (MalformedURLException e) { 41 e.printStackTrace(); 42 } 43 40 44 } 41 45 … … 63 67 return ICON_CG41_16; 64 68 } 65 66 public final URL getLocalPortalURL() {67 try {68 if (portalId > 0) {69 return new URL(PORTAL_CG41 + portalId);70 }71 } catch (MalformedURLException e) {72 e.printStackTrace();73 }74 return null;75 }76 69 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/DataGouvDataSetHandler.java
r28054 r28113 17 17 18 18 import java.net.MalformedURLException; 19 import java.net.URL;20 19 21 20 import org.openstreetmap.josm.data.projection.Projection; 22 21 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDataSetHandler; 22 import org.openstreetmap.josm.plugins.opendata.core.licenses.License; 23 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.DataGouvFrConstants; 24 24 … … 50 50 setNationalPortalPath(portalPath); 51 51 setSingleProjection(singleProjection); 52 setLicense(License.LOOL); 52 53 } 53 54 … … 58 59 public String getSource() { 59 60 return SOURCE_DATAGOUVFR; 60 }61 62 /* (non-Javadoc)63 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLocalPortalURL()64 */65 @Override66 public URL getLocalPortalURL() {67 return null;68 }69 70 /* (non-Javadoc)71 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLicenseURL()72 */73 @Override74 public URL getLicenseURL() {75 try {76 return new URL(FRENCH_PORTAL+"Licence-Ouverte-Open-Licence");77 } catch (MalformedURLException e) {78 e.printStackTrace();79 }80 return null;81 61 } 82 62 -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/administration/GeoFlaHandler.java
r28050 r28113 37 37 super(); 38 38 setName("GEOFLA®"); 39 } 40 41 /* (non-Javadoc) 42 * @see org.openstreetmap.josm.plugins.opendata.portals.fr.datagouvfr.datasets.DataGouvDataSetHandler#getLocalPortalURL() 43 */ 44 @Override 45 public URL getLocalPortalURL() { 39 getShpHandler().setPreferMultipolygonToSimpleWay(true); 46 40 try { 47 return newURL("http://professionnels.ign.fr/ficheProduitCMS.do?idDoc=6185461");41 setLocalPortalURL("http://professionnels.ign.fr/ficheProduitCMS.do?idDoc=6185461"); 48 42 } catch (MalformedURLException e) { 49 System.err.println(e.getMessage()); 50 return null; 43 e.printStackTrace(); 51 44 } 52 45 } … … 79 72 protected boolean isArrondissementFile(String filename) { 80 73 return acceptsShpFilename(filename, "ARRONDISSEMENT") || acceptsShpFilename(filename, "LIMITE_ARRONDISSEMENT"); 81 }82 83 @Override84 public boolean preferMultipolygonToSimpleWay() {85 return true;86 74 } 87 75 -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/culture/BibliothequesHandler.java
r28054 r28113 16 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.culture; 17 17 18 import java.nio.charset.Charset;19 20 18 import org.openstreetmap.josm.data.osm.DataSet; 21 19 import org.openstreetmap.josm.data.osm.Node; … … 28 26 setName("Bibliothèques municipales"); 29 27 setDownloadFileName("lieux de lecture_geoloc.txt"); 28 getCsvHandler().setCharset(ISO8859_15); 30 29 } 31 30 … … 41 40 } 42 41 } 43 44 /* (non-Javadoc)45 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvCharset()46 */47 @Override48 public Charset getCsvCharset() {49 return Charset.forName(ISO8859_15);50 }51 42 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/diplomatie/EtabAEFEHandler.java
r28054 r28113 26 26 setName("Établissements du réseau d'enseignement de l'AEFE"); 27 27 setDownloadFileName("ETALAB_MAEE_Extraction_LDAP_geoloc_AEFE_2011-10-13.csv"); 28 getCsvHandler().setSeparator(","); 28 29 } 29 30 … … 44 45 } 45 46 } 46 47 /* (non-Javadoc)48 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvSeparator()49 */50 @Override51 public String getCsvSeparator() {52 return ",";53 }54 47 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/AssainissementHandler.java
r28050 r28113 30 30 super("assainissement-collectif-30381843"); 31 31 setName("Assainissement collectif"); 32 getSpreadSheetHandler().setSheetNumber(1); 32 33 } 33 34 … … 40 41 public void updateDataSet(DataSet ds) { 41 42 // TODO Auto-generated method stub 42 }43 44 /* (non-Javadoc)45 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getSheetNumber()46 */47 @Override48 public int getSheetNumber() {49 return 1;50 43 } 51 44 -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/Etab1er2ndDegreHandler.java
r28054 r28113 16 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.education; 17 17 18 import java.nio.charset.Charset;19 20 18 import org.openstreetmap.josm.data.coor.EastNorth; 21 19 import org.openstreetmap.josm.data.coor.LatLon; 22 20 import org.openstreetmap.josm.data.osm.DataSet; 23 21 import org.openstreetmap.josm.data.osm.Node; 22 import org.openstreetmap.josm.plugins.opendata.core.io.tabular.DefaultCsvHandler; 24 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.DataGouvDataSetHandler; 25 24 26 25 public class Etab1er2ndDegreHandler extends DataGouvDataSetHandler { 27 26 27 private class EtabCsvHandler extends DefaultCsvHandler { 28 29 public EtabCsvHandler() { 30 setCharset(ISO8859_15); 31 setHandlesProjection(true); 32 } 33 34 @Override 35 public LatLon getCoor(EastNorth en, String[] fields) { 36 return getLatLonByDptCode(en, fields[0].substring(0, 3), false); 37 } 38 } 39 28 40 public Etab1er2ndDegreHandler() { 29 41 super("Géolocalisation-des-établissements-d'enseignement-du-premier-degré-et-du-second-degré-du-ministère-d-30378093"); 30 42 setName("Établissements d'enseignement du premier degré et du second degré"); 31 43 setDownloadFileName("MENJVA_etab_geoloc.csv"); 44 setCsvHandler(new EtabCsvHandler()); 32 45 } 33 46 … … 53 66 } 54 67 } 55 56 /* (non-Javadoc)57 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#handlesCsvProjection()58 */59 @Override60 public boolean handlesSpreadSheetProjection() {61 return true;62 }63 64 /* (non-Javadoc)65 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvCoor(org.openstreetmap.josm.data.coor.EastNorth, java.lang.String[])66 */67 @Override68 public LatLon getSpreadSheetCoor(EastNorth en, String[] fields) {69 return getLatLonByDptCode(en, fields[0].substring(0, 3), false);70 }71 72 /* (non-Javadoc)73 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvCharset()74 */75 @Override76 public Charset getCsvCharset() {77 return Charset.forName(ISO8859_15);78 }79 68 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/EtabSupHandler.java
r28054 r28113 24 24 public class EtabSupHandler extends DataGouvDataSetHandler { 25 25 26 private class EtabSupCsvHandler extends InternalCsvHandler { 27 @Override 28 public LatLon getCoor(EastNorth en, String[] fields) { 29 // X/Y sont inversees dans le fichier 30 return wgs84.eastNorth2latlon(new EastNorth(en.north(), en.east())); 31 } 32 } 33 26 34 public EtabSupHandler() { 27 35 super("Etablissements-d'enseignement-supérieur-30382046", wgs84); 28 36 setName("Établissements d'enseignement supérieur"); 29 37 setDownloadFileName("livraison ETALAB 28 11 2011.xls"); 38 setCsvHandler(new EtabSupCsvHandler()); 30 39 } 31 40 … … 42 51 } 43 52 } 44 45 /* (non-Javadoc)46 * @see org.openstreetmap.josm.plugins.opendata.portals.fr.datagouvfr.datasets.DataGouvDataSetHandler#getSpreadSheetCoor(org.openstreetmap.josm.data.coor.EastNorth, java.lang.String[])47 */48 @Override49 public LatLon getSpreadSheetCoor(EastNorth en, String[] fields) {50 // X/Y sont inversees dans le fichier51 return wgs84.eastNorth2latlon(new EastNorth(en.north(), en.east()));52 }53 53 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java
r28055 r28113 29 29 30 30 import org.openstreetmap.josm.data.osm.DataSet; 31 import org.openstreetmap.josm.plugins.opendata.core.io.archive.DefaultZipHandler; 31 32 import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.DataGouvDataSetHandler; 32 33 import org.openstreetmap.josm.tools.Pair; … … 65 66 public EauxDeSurfaceHandler() { 66 67 setName("Eaux de surface"); 68 setZipHandler(new InternalZipHandler()); 67 69 } 68 70 … … 123 125 return new Pair<String, URL>(a.name, new URL("http://www.rapportage.eaufrance.fr/sites/default/files/SIG/FR"+a.code+"_SW.zip")); 124 126 } 125 126 /* (non-Javadoc) 127 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#notifyTempFileWritten(java.io.File) 128 */ 129 @Override 130 public void notifyTempFileWritten(File file) { 131 if (file.getName().matches(SHP_PATTERN.replace("(.*)", "F")+"\\.prj")) { // Adour-Garonne .prj files cannot be parsed because they do not contain quotes... 132 try { 133 BufferedReader reader = new BufferedReader(new FileReader(file)); 134 String line = reader.readLine(); 135 reader.close(); 136 if (!line.contains("\"")) { 137 for (String term : new String[]{"GCS_ETRS_1989", "D_ETRS_1989", "GRS_1980", "Greenwich", "Degree"}) { 138 line = line.replace(term, "\""+term+"\""); 127 128 private class InternalZipHandler extends DefaultZipHandler { 129 @Override 130 public void notifyTempFileWritten(File file) { 131 if (file.getName().matches(SHP_PATTERN.replace("(.*)", "F")+"\\.prj")) { // Adour-Garonne .prj files cannot be parsed because they do not contain quotes... 132 try { 133 BufferedReader reader = new BufferedReader(new FileReader(file)); 134 String line = reader.readLine(); 135 reader.close(); 136 if (!line.contains("\"")) { 137 for (String term : new String[]{"GCS_ETRS_1989", "D_ETRS_1989", "GRS_1980", "Greenwich", "Degree"}) { 138 line = line.replace(term, "\""+term+"\""); 139 } 140 BufferedWriter writer = new BufferedWriter(new FileWriter(file)); 141 writer.write(line); 142 writer.close(); 139 143 } 140 BufferedWriter writer = new BufferedWriter(new FileWriter(file)); 141 writer.write(line); 142 writer.close(); 144 } catch (Exception e) { 145 e.printStackTrace(); 143 146 } 144 } catch (Exception e) {145 e.printStackTrace();146 147 } 147 148 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/transport/PassageNiveauHandler.java
r28054 r28113 16 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.transport; 17 17 18 import java.nio.charset.Charset;19 20 18 import org.openstreetmap.josm.data.osm.DataSet; 21 19 import org.openstreetmap.josm.data.osm.Node; … … 28 26 setName("Passages à niveau"); 29 27 setDownloadFileName("passage_a_niveau.csv"); 28 getCsvHandler().setCharset(ISO8859_15); 30 29 } 31 30 … … 41 40 } 42 41 } 43 44 /* (non-Javadoc)45 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvCharset()46 */47 @Override48 public Charset getCsvCharset() {49 return Charset.forName(ISO8859_15);50 }51 42 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/LeMansDataSetHandler.java
r28091 r28113 23 23 import org.openstreetmap.josm.data.osm.Tag; 24 24 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDataSetHandler; 25 import org.openstreetmap.josm.plugins.opendata.core.licenses.License; 25 26 import org.openstreetmap.josm.plugins.opendata.modules.fr.lemans.LeMansConstants; 26 27 import org.openstreetmap.josm.tools.Pair; 27 28 28 29 public abstract class LeMansDataSetHandler extends FrenchDataSetHandler implements LeMansConstants { 29 30 private String uuid;31 30 32 31 private String kmzUuid; … … 58 57 59 58 private final void init(String uuid) { 60 this.uuid = uuid; 59 try { 60 setLicense(License.ODbL); 61 if (uuid != null && !uuid.isEmpty()) { 62 setLocalPortalURL(PORTAL + "page.do?t=2&uuid=" + uuid); 63 } 64 } catch (MalformedURLException e) { 65 e.printStackTrace(); 66 } 61 67 } 62 68 … … 73 79 return SOURCE_LE_MANS; 74 80 } 75 76 public final URL getLocalPortalURL() {77 try {78 if (uuid != null && !uuid.isEmpty()) {79 return new URL(PORTAL + "page.do?t=2&uuid=" + uuid);80 }81 } catch (MalformedURLException e) {82 e.printStackTrace();83 }84 return null;85 }86 81 87 82 /* (non-Javadoc) 88 83 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLicenseURL() 89 84 */ 90 @Override 85 /*@Override 91 86 public URL getLicenseURL() { 92 87 try { … … 96 91 } 97 92 return null; 98 } 99 93 }*/ 94 100 95 /* (non-Javadoc) 101 96 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getDataURLs() -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/ParisDataSetHandler.java
r28044 r28113 22 22 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDataSetHandler; 23 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.ParisConstants; 24 import org.openstreetmap.josm.plugins.opendata.modules.fr.paris.ParisLicense; 24 25 25 26 public abstract class ParisDataSetHandler extends FrenchDataSetHandler implements ParisConstants { … … 53 54 private final void init(int documentId) { 54 55 this.documentId = documentId; 56 setLicense(new ParisLicense()); 57 try { 58 if (documentId > 0) { 59 setLocalPortalURL(PORTAL + "jsp/site/Portal.jsp?document_id="+documentId + "&portlet_id="+portletId); 60 } 61 } catch (MalformedURLException e) { 62 e.printStackTrace(); 63 } 55 64 } 56 65 … … 69 78 public String getLocalPortalIconName() { 70 79 return ICON_PARIS_24; 71 }72 73 public final URL getLocalPortalURL() {74 try {75 if (documentId > 0) {76 return new URL(PORTAL + "jsp/site/Portal.jsp?document_id="+documentId + "&portlet_id="+portletId);77 }78 } catch (MalformedURLException e) {79 e.printStackTrace();80 }81 return null;82 80 } 83 81 -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/SanisettesHandler.java
r28044 r28113 32 32 super(93); 33 33 setName("Sanisettes"); 34 getShpHandler().setCheckNodeProximity(true); 34 35 } 35 36 … … 116 117 return PORTAL+"hn/sanisettes.zip"; 117 118 } 118 119 /* (non-Javadoc)120 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#checkShpNodeProximity()121 */122 @Override123 public boolean checkShpNodeProximity() {124 return true;125 }126 119 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/datasets/EquipementsHandler.java
r28044 r28113 1 // JOSM opendata plugin. 2 // Copyright (C) 2011-2012 Don-vip 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 1 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.sncf.datasets; 2 17 … … 8 23 public class EquipementsHandler extends SncfDataSetHandler { 9 24 25 private class LambertIICsvHandler extends InternalCsvHandler { 26 @Override 27 public LatLon getCoor(EastNorth en, String[] fields) { 28 // Lambert II coordinates offset by 2000000 (see http://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert#Projections_officielles_en_France_métropolitaine) 29 return super.getCoor(new EastNorth(en.getX(), en.getY()-2000000), fields); 30 } 31 } 32 10 33 public EquipementsHandler() { 11 34 super("equipementsgares"); 35 setCsvHandler(new LambertIICsvHandler()); 12 36 setSingleProjection(lambert4Zones[1]); // Lambert II 13 37 } … … 25 49 } 26 50 } 27 28 /* (non-Javadoc)29 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDataSetHandler#getSpreadSheetCoor(org.openstreetmap.josm.data.coor.EastNorth, java.lang.String[])30 */31 @Override32 public LatLon getSpreadSheetCoor(EastNorth en, String[] fields) {33 // Lambert II coordinates offset by 2000000 (see http://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert#Projections_officielles_en_France_métropolitaine)34 return super.getSpreadSheetCoor(new EastNorth(en.getX(), en.getY()-2000000), fields);35 }36 51 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/datasets/SncfDataSetHandler.java
r28044 r28113 1 // JOSM opendata plugin. 2 // Copyright (C) 2011-2012 Don-vip 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 1 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.sncf.datasets; 2 17 3 18 import java.net.MalformedURLException; 4 import java.net.URL;5 19 6 20 import org.openstreetmap.josm.data.osm.Tag; 7 21 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDataSetHandler; 8 22 import org.openstreetmap.josm.plugins.opendata.modules.fr.sncf.SncfConstants; 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.sncf.SncfLicense; 9 24 10 25 public abstract class SncfDataSetHandler extends FrenchDataSetHandler implements SncfConstants { 11 12 private String portalId;13 26 14 27 public SncfDataSetHandler(String portalId) { … … 45 58 46 59 private final void init(String portalId) { 47 this.portalId = portalId; 60 setLicense(new SncfLicense()); 61 if (portalId != null && !portalId.isEmpty()) { 62 try { 63 setLocalPortalURL(PORTAL + portalId); 64 } catch (MalformedURLException e) { 65 e.printStackTrace(); 66 } 67 } 48 68 } 49 69 … … 71 91 return ICON_16; 72 92 } 73 74 public final URL getLocalPortalURL() {75 try {76 if (portalId != null) {77 return new URL(PORTAL + portalId);78 }79 } catch (MalformedURLException e) {80 e.printStackTrace();81 }82 return null;83 }84 85 /* (non-Javadoc)86 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLicenseURL()87 */88 @Override89 public URL getLicenseURL() {90 try {91 return new URL("http://test.data-sncf.com/licence");92 } catch (MalformedURLException e) {93 e.printStackTrace();94 }95 return null;96 }97 93 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/ToulouseConstants.java
r28044 r28113 35 35 * Portal 36 36 */ 37 public static final String PORTAL = "http://data.grandtoulouse.fr /les-donnees/-/opendata/card/";37 public static final String PORTAL = "http://data.grandtoulouse.fr"; 38 38 39 39 /** -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/ToulouseDataSetHandler.java
r28044 r28113 1 // JOSM opendata plugin. 2 // Copyright (C) 2011-2012 Don-vip 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 1 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets; 2 17 3 18 import java.net.MalformedURLException; 4 import java.net.URL;5 19 6 20 import org.openstreetmap.josm.data.osm.Tag; 7 21 import org.openstreetmap.josm.plugins.opendata.core.datasets.fr.FrenchDataSetHandler; 8 22 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.ToulouseConstants; 23 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.ToulouseLicense; 9 24 10 25 public abstract class ToulouseDataSetHandler extends FrenchDataSetHandler implements ToulouseConstants { 11 12 private int portalId;13 private String wikiPage;14 26 15 27 public ToulouseDataSetHandler(int portalId) { … … 46 58 47 59 private final void init(int portalId) { 48 this.portalId = portalId; 60 try { 61 setLicense(new ToulouseLicense()); 62 if (portalId > 0) { 63 String url = PORTAL + "/les-donnees/-/opendata/card/" + portalId + "--"; 64 setLocalPortalURL(url); 65 //setLicenseURL(url+"/license"); 66 setDataURL(url+"/resource/document"); 67 } 68 } catch (MalformedURLException e) { 69 e.printStackTrace(); 70 } 49 71 } 50 72 … … 72 94 return ICON_CROIX_16; 73 95 } 74 75 public final URL getLocalPortalURL() {76 try {77 if (portalId > 0) {78 return new URL(PORTAL + portalId + "--");79 }80 } catch (MalformedURLException e) {81 e.printStackTrace();82 }83 return null;84 }85 86 /* (non-Javadoc)87 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getLicenseURL()88 */89 @Override90 public URL getLicenseURL() {91 try {92 return new URL(getLocalPortalURL().toString()+"/license");93 } catch (MalformedURLException e) {94 e.printStackTrace();95 }96 return null;97 }98 99 /* (non-Javadoc)100 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getDataURL()101 */102 @Override103 public URL getDataURL() {104 try {105 return new URL(getLocalPortalURL().toString()+"/resource/document");106 } catch (MalformedURLException e) {107 e.printStackTrace();108 }109 return null;110 }111 112 /* (non-Javadoc)113 * @see org.openstreetmap.josm.plugins.fr.opendata.datasets.AbstractDataSetHandler#getWikiURL()114 */115 @Override116 public URL getWikiURL() {117 try {118 if (wikiPage != null && !wikiPage.isEmpty()) {119 return new URL(WIKI + "/" + wikiPage);120 }121 } catch (MalformedURLException e) {122 e.printStackTrace();123 }124 return null;125 }126 96 127 97 protected final void setWikiPage(String wikiPage) { 128 this.wikiPage = wikiPage.replace(" ", "_"); 129 setName(wikiPage.replace("_", " ")); 98 if (wikiPage != null && !wikiPage.isEmpty()) { 99 setName(wikiPage.replace("_", " ")); 100 try { 101 setWikiURL(WIKI + "/" + wikiPage.replace(" ", "_")); 102 } catch (MalformedURLException e) { 103 e.printStackTrace(); 104 } 105 } 130 106 } 131 107 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/ChantiersPonctuelsHandler.java
r28096 r28113 16 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.transport; 17 17 18 import java.nio.charset.Charset;19 18 20 19 public class ChantiersPonctuelsHandler extends ChantiersHandler { … … 22 21 public ChantiersPonctuelsHandler() { 23 22 super(14071, "Chantiers en cours (ponctuel)"); 23 getCsvHandler().setCharset(ISO8859_15); 24 24 } 25 25 … … 28 28 return acceptsCsvKmzTabFilename(filename, "Chantiers_Ponctuels"); 29 29 } 30 31 /* (non-Javadoc)32 * @see org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler#getCsvCharset()33 */34 @Override35 public Charset getCsvCharset() {36 return Charset.forName(ISO8859_15);37 }38 30 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/PistesCyclablesHandler.java
r28044 r28113 16 16 package org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.transport; 17 17 18 import static org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler.OaQueryType.NODE;19 import static org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler.OaQueryType.WAY;20 import static org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler.OaRecurseType.NODE_RELATION;21 import static org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler.OaRecurseType.RELATION_WAY;22 import static org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler.OaRecurseType.WAY_NODE;23 import static org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler.OaRecurseType.WAY_RELATION;24 25 18 import java.util.Arrays; 26 19 import java.util.Collection; … … 31 24 import org.openstreetmap.josm.data.osm.IPrimitive; 32 25 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi; 33 27 import org.openstreetmap.josm.plugins.opendata.modules.fr.toulouse.datasets.ToulouseDataSetHandler; 28 29 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaQueryType.*; 30 import static org.openstreetmap.josm.plugins.opendata.core.io.OverpassApi.OaRecurseType.*; 34 31 35 32 public class PistesCyclablesHandler extends ToulouseDataSetHandler { … … 65 62 @Override 66 63 protected String getOverpassApiQueries(String bbox, String... conditions) { 67 return oaQuery(bbox, NODE, conditions) + "\n" +68 oaRecurse(NODE_RELATION, RELATION_WAY, WAY_NODE) + "\n" +69 oaQuery(bbox, WAY, conditions) + "\n" +70 oaRecurse(WAY_NODE, "nodes") + "\n" +71 oaRecurse(WAY_RELATION);64 return OverpassApi.query(bbox, NODE, conditions) + "\n" + 65 OverpassApi.recurse(NODE_RELATION, RELATION_WAY, WAY_NODE) + "\n" + 66 OverpassApi.query(bbox, WAY, conditions) + "\n" + 67 OverpassApi.recurse(WAY_NODE, "nodes") + "\n" + 68 OverpassApi.recurse(WAY_RELATION); 72 69 } 73 70 -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/transport/ReseauTisseoHandler.java
r28054 r28113 34 34 setName("Réseau Tisséo (Métro, Bus, Tram)"); 35 35 setCategory(CAT_TRANSPORT); 36 setSkipXsdValidation InZipReading(true);36 getZipHandler().setSkipXsdValidation(true); 37 37 } 38 38
Note:
See TracChangeset
for help on using the changeset viewer.
