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