source: osm/applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/EtabSupHandler.java@ 28054

Last change on this file since 28054 was 28054, checked in by donvip, 13 years ago

opendata: various download improvements

File size: 2.1 KB
Line 
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/>.
16package org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.education;
17
18import org.openstreetmap.josm.data.coor.EastNorth;
19import org.openstreetmap.josm.data.coor.LatLon;
20import org.openstreetmap.josm.data.osm.DataSet;
21import org.openstreetmap.josm.data.osm.Node;
22import org.openstreetmap.josm.plugins.opendata.modules.fr.datagouvfr.datasets.DataGouvDataSetHandler;
23
24public class EtabSupHandler extends DataGouvDataSetHandler {
25
26 public EtabSupHandler() {
27 super("Etablissements-d'enseignement-supérieur-30382046", wgs84);
28 setName("Établissements d'enseignement supérieur");
29 setDownloadFileName("livraison ETALAB 28 11 2011.xls");
30 }
31
32 @Override
33 public boolean acceptsFilename(String filename) {
34 return acceptsXlsFilename(filename, "livraison ETALAB .. .. 20..(\\.xls-fr)?");
35 }
36
37 @Override
38 public void updateDataSet(DataSet ds) {
39 for (Node n : ds.getNodes()) {
40 replace(n, "NOM_ETABLISSEMENT", "name");
41 n.put("amenity", "university");
42 }
43 }
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 @Override
49 public LatLon getSpreadSheetCoor(EastNorth en, String[] fields) {
50 // X/Y sont inversees dans le fichier
51 return wgs84.eastNorth2latlon(new EastNorth(en.north(), en.east()));
52 }
53}
Note: See TracBrowser for help on using the repository browser.