Changeset 28113 in osm for applications/editors/josm/plugins/opendata/modules/fr.sncf/src
- Timestamp:
- 2012-03-19T00:23:49+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.