Changeset 30731 in osm for applications/editors
- Timestamp:
- 2014-10-18T15:31:53+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/opendata
- Files:
-
- 1 added
- 78 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/.project
r28000 r30731 13 13 </buildSpec> 14 14 <natures> 15 <nature>org.sonar.ide.eclipse.core.sonarNature</nature> 15 16 <nature>org.eclipse.jdt.core.javanature</nature> 16 17 </natures> -
applications/editors/josm/plugins/opendata/modules/00_module_dir_template/build.xml
r30416 r30731 37 37 <property name="module.dist.dir" value="../../dist"/> 38 38 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 39 39 <!-- conditions --> 40 40 <condition property="resources.exist"> 41 41 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/BruxellesConstants.java
r30563 r30731 4 4 5 5 public interface BruxellesConstants { 6 7 8 9 10 11 12 13 14 15 16 17 6 7 /** 8 * Source 9 */ 10 public static final String SOURCE_BRUXELLES = "Ville de Bruxelles"; 11 12 /** 13 * Portal 14 */ 15 public static final String PORTAL_EN = "http://www.brussels.be"; 16 public static final String PORTAL_FR = "http://www.bruxelles.be"; 17 public static final String PORTAL_NL = "http://www.brussel.be"; 18 18 } -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/BruxellesModule.java
r30340 r30731 8 8 public class BruxellesModule extends AbstractModule { 9 9 10 11 12 10 public BruxellesModule(ModuleInformation info) { 11 super(info); 12 handlers.add(BDHandler.class); 13 13 } 14 14 } -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/BruxellesDataSetHandler.java
r30340 r30731 11 11 12 12 public abstract class BruxellesDataSetHandler extends BelgianDataSetHandler implements BruxellesConstants { 13 14 15 16 17 18 13 14 private Integer localPortalId; 15 16 public BruxellesDataSetHandler() { 17 init(null, null); 18 } 19 19 20 21 22 20 public BruxellesDataSetHandler(Integer portalId) { 21 init(portalId, null); 22 } 23 23 24 25 26 24 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection) { 25 init(portalId, singleProjection); 26 } 27 27 28 29 30 31 28 public BruxellesDataSetHandler(Integer portalId, Projection singleProjection, String relevantTag) { 29 super(relevantTag); 30 init(portalId, singleProjection); 31 } 32 32 33 34 35 36 33 public BruxellesDataSetHandler(Integer portalId, String relevantTag) { 34 super(relevantTag); 35 init(portalId, null); 36 } 37 37 38 39 40 41 38 private void init(Integer portalId, Projection singleProjection) { 39 setSingleProjection(singleProjection); 40 this.localPortalId = portalId; 41 } 42 42 43 44 45 46 43 @Override 44 public String getSource() { 45 return SOURCE_BRUXELLES; 46 } 47 47 48 49 50 51 52 53 54 55 56 57 58 59 48 @Override 49 public URL getLocalPortalURL() { 50 String basePortal = null; 51 String lang = OdUtils.getJosmLanguage(); 52 53 if (lang.startsWith("fr")) { 54 basePortal = PORTAL_FR; 55 } else if (lang.startsWith("nl")) { 56 basePortal = PORTAL_NL; 57 } else { 58 basePortal = PORTAL_EN; 59 } 60 60 61 62 63 64 65 66 67 61 try { 62 return new URL(basePortal + "/artdet.cfm?id=" + localPortalId); 63 } catch (MalformedURLException e) { 64 e.printStackTrace(); 65 return null; 66 } 67 } 68 68 } -
applications/editors/josm/plugins/opendata/modules/be.bruxelles/src/org/openstreetmap/josm/plugins/opendata/modules/be/bruxelles/datasets/culture/BDHandler.java
r30340 r30731 8 8 public class BDHandler extends BruxellesDataSetHandler { 9 9 10 11 12 13 14 15 16 17 10 public BDHandler() { 11 getCsvHandler().setSeparator(","); 12 } 13 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsCsvFilename(filename, "textfile"); 17 } 18 18 19 20 21 22 23 24 25 19 @Override 20 public void updateDataSet(DataSet ds) { 21 for (Node n : ds.getNodes()) { 22 n.put("tourism", "artwork"); 23 replace(n, "Description", "name"); 24 } 25 } 26 26 } -
applications/editors/josm/plugins/opendata/modules/be.datagovbe/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/be.datagovbe/src/org/openstreetmap/josm/plugins/opendata/modules/be/datagovbe/DataGovBeConstants.java
r30563 r30731 4 4 5 5 public interface DataGovBeConstants { 6 7 8 9 10 6 7 /** 8 * Source 9 */ 10 public static final String SOURCE_DATAGOVBE = "data.gov.be"; 11 11 } -
applications/editors/josm/plugins/opendata/modules/be.datagovbe/src/org/openstreetmap/josm/plugins/opendata/modules/be/datagovbe/DataGovBeModule.java
r30340 r30731 8 8 public class DataGovBeModule extends AbstractModule { 9 9 10 11 12 10 public DataGovBeModule(ModuleInformation info) { 11 super(info); 12 handlers.add(ArchitecturalHeritageHandler.class); 13 13 } 14 14 } -
applications/editors/josm/plugins/opendata/modules/be.datagovbe/src/org/openstreetmap/josm/plugins/opendata/modules/be/datagovbe/datasets/DataGovDataSetHandler.java
r30340 r30731 7 7 8 8 public abstract class DataGovDataSetHandler extends BelgianDataSetHandler implements DataGovBeConstants { 9 10 11 12 9 10 public DataGovDataSetHandler() { 11 init(null, null, null, null, null); 12 } 13 13 14 15 16 14 public DataGovDataSetHandler(String portalPathDe, String portalPathEn, String portalPathFr, String portalPathNl) { 15 init(portalPathDe, portalPathEn, portalPathFr, portalPathNl, null); 16 } 17 17 18 19 20 18 public DataGovDataSetHandler(String portalPathDe, String portalPathEn, String portalPathFr, String portalPathNl, Projection singleProjection) { 19 init(portalPathDe, portalPathEn, portalPathFr, portalPathNl, singleProjection); 20 } 21 21 22 23 24 25 22 public DataGovDataSetHandler(String portalPathDe, String portalPathEn, String portalPathFr, String portalPathNl, Projection singleProjection, String relevantTag) { 23 super(relevantTag); 24 init(portalPathDe, portalPathEn, portalPathFr, portalPathNl, singleProjection); 25 } 26 26 27 28 29 30 27 public DataGovDataSetHandler(String portalPathDe, String portalPathEn, String portalPathFr, String portalPathNl, String relevantTag) { 28 super(relevantTag); 29 init(portalPathDe, portalPathEn, portalPathFr, portalPathNl, null); 30 } 31 31 32 33 34 35 32 private void init(String portalPathDe, String portalPathEn, String portalPathFr, String portalPathNl, Projection singleProjection) { 33 setNationalPortalPath(portalPathDe, portalPathEn, portalPathFr, portalPathNl); 34 setSingleProjection(singleProjection); 35 } 36 36 37 38 39 40 37 @Override 38 public String getSource() { 39 return SOURCE_DATAGOVBE; 40 } 41 41 } -
applications/editors/josm/plugins/opendata/modules/be.datagovbe/src/org/openstreetmap/josm/plugins/opendata/modules/be/datagovbe/datasets/culture/ArchitecturalHeritageHandler.java
r30340 r30731 7 7 public class ArchitecturalHeritageHandler extends DataGovDataSetHandler { 8 8 9 10 11 9 public ArchitecturalHeritageHandler() { 10 super("inventar-des-architektonischen-erbes", "inventory-architectural-heritage", "iventaire-heritage-architectural", "inventaris-bouwkundig-erfgoed"); 11 } 12 12 13 14 15 16 13 @Override 14 public boolean acceptsFilename(String filename) { 15 return acceptsKmzFilename(filename, "dibe(_geheel)?") || acceptsZipFilename(filename, "dibegis") || acceptsShpFilename(filename, "dibe_(gehelen|orgels|relicten)"); 16 } 17 17 18 19 20 21 18 @Override 19 public void updateDataSet(DataSet ds) { 20 // TODO Auto-generated method stub 21 } 22 22 } -
applications/editors/josm/plugins/opendata/modules/build.xml
r28091 r30731 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <project name="josm-opendata-modules" default="dist" basedir="."> 3 3 <macrodef name="run_target"> 4 4 <attribute name="target" /> 5 5 <sequential> 6 6 <ant antfile="build.xml" target="@{target}" dir="be.bruxelles"/> 7 8 9 7 <ant antfile="build.xml" target="@{target}" dir="be.datagovbe"/> 8 <ant antfile="build.xml" target="@{target}" dir="fr.cg41"/> 9 <ant antfile="build.xml" target="@{target}" dir="fr.datagouvfr"/> 10 10 <ant antfile="build.xml" target="@{target}" dir="fr.lemans"/> 11 12 13 14 15 11 <ant antfile="build.xml" target="@{target}" dir="fr.paris"/> 12 <ant antfile="build.xml" target="@{target}" dir="fr.sncf"/> 13 <ant antfile="build.xml" target="@{target}" dir="fr.toulouse"/> 14 </sequential> 15 </macrodef> 16 16 <target name="dist"> 17 17 <mkdir dir="../dist"/> 18 19 18 <run_target target="dist"/> 19 <antcall target="list" /> 20 20 </target> 21 21 <target name="clean"> … … 25 25 <run_target target="install"/> 26 26 </target> 27 28 29 30 31 32 33 34 27 <target name="list"> 28 <mkdir dir="build"/> 29 <javac srcdir="../util" destdir="build" includes="opendata/**" includeantruntime="false" /> 30 <java classpath="build" classname="opendata.ModuleListGenerator"> 31 <arg line="../"/> 32 </java> 33 <delete dir="build" /> 34 </target> 35 35 </project> -
applications/editors/josm/plugins/opendata/modules/fr.cg41/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/Cg41Constants.java
r30340 r30731 5 5 6 6 public interface Cg41Constants extends FrenchConstants { 7 8 9 10 11 7 8 /** 9 * Source 10 */ 11 public static final String SOURCE_CG41 = "Conseil général du Loir-et-Cher"; 12 12 13 14 15 16 17 18 19 20 21 22 13 /** 14 * Icons 15 */ 16 public static final String ICON_CG41_16 = "data.fr.cg41_16.png"; 17 public static final String ICON_CG41_24 = "data.fr.cg41_24.png"; 18 19 /** 20 * Portal 21 */ 22 public static final String PORTAL_CG41 = "http://www.pilote41.fr/geosource/srv/fr/metadata.show?id="; 23 23 } -
applications/editors/josm/plugins/opendata/modules/fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/Cg41Module.java
r30340 r30731 9 9 public class Cg41Module extends AbstractModule { 10 10 11 12 13 14 11 public Cg41Module(ModuleInformation info) { 12 super(info); 13 handlers.add(ArretsBusHandler.class); 14 handlers.add(ZonesInondablesBrayeHandler.class); 15 15 } 16 16 } -
applications/editors/josm/plugins/opendata/modules/fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/datasets/Cg41DataSetHandler.java
r30340 r30731 9 9 10 10 public abstract class Cg41DataSetHandler extends FrenchDataSetHandler implements Cg41Constants { 11 12 13 14 15 16 17 18 19 20 21 22 23 24 11 12 public Cg41DataSetHandler(int portalId, String nationalPath) { 13 init(portalId, nationalPath); 14 } 15 16 public Cg41DataSetHandler(int portalId, String nationalPath, String relevantTag) { 17 super(relevantTag); 18 init(portalId, nationalPath); 19 } 20 21 public Cg41DataSetHandler(int portalId, String nationalPath, boolean relevantUnion, String ... relevantTags) { 22 super(relevantUnion, relevantTags); 23 init(portalId, nationalPath); 24 } 25 25 26 27 28 26 public Cg41DataSetHandler(int portalId, String nationalPath, String ... relevantTags) { 27 this(portalId, nationalPath, false, relevantTags); 28 } 29 29 30 31 32 33 30 public Cg41DataSetHandler(int portalId, String nationalPath, boolean relevantUnion, Tag ... relevantTags) { 31 super(relevantUnion, relevantTags); 32 init(portalId, nationalPath); 33 } 34 34 35 36 37 38 39 40 41 42 43 35 private final void init(int portalId, String nationalPath) { 36 setNationalPortalPath(nationalPath); 37 try { 38 if (portalId > 0) { 39 setLocalPortalURL(PORTAL_CG41 + portalId); 40 } 41 } catch (MalformedURLException e) { 42 e.printStackTrace(); 43 } 44 44 45 45 } 46 46 47 48 49 50 47 @Override 48 public String getSource() { 49 return SOURCE_CG41; 50 } 51 51 52 53 54 55 52 @Override 53 public String getLocalPortalIconName() { 54 return ICON_CG41_24; 55 } 56 56 57 58 59 60 57 @Override 58 public String getDataLayerIconName() { 59 return ICON_CG41_16; 60 } 61 61 } -
applications/editors/josm/plugins/opendata/modules/fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/datasets/environnement/ZonesInondablesBrayeHandler.java
r30340 r30731 6 6 7 7 public class ZonesInondablesBrayeHandler extends Cg41DataSetHandler { 8 9 10 8 public ZonesInondablesBrayeHandler() { 9 super(14624, "Zone-inondable-de-la-Braye-au-1-25000-(partie-Loir-et-Cher)-30383255"); 10 } 11 11 12 13 14 15 12 @Override 13 public boolean acceptsFilename(String filename) { 14 return acceptsMifFilename(filename, "aleas_braye"); 15 } 16 16 17 18 19 20 17 @Override 18 public void updateDataSet(DataSet ds) { 19 // TODO Auto-generated method stub 20 } 21 21 } -
applications/editors/josm/plugins/opendata/modules/fr.cg41/src/org/openstreetmap/josm/plugins/opendata/modules/fr/cg41/datasets/transport/ArretsBusHandler.java
r30340 r30731 7 7 public class ArretsBusHandler extends Cg41DataSetHandler { 8 8 9 10 11 9 public ArretsBusHandler() { 10 super(14615, "Points-d'arrêt-du-réseau-de-transport-départemental-\"Route41\"-30383156"); 11 } 12 12 13 14 15 16 13 @Override 14 public boolean acceptsFilename(String filename) { 15 return acceptsShpFilename(filename, "Points_ROUTE41"); 16 } 17 17 18 19 20 21 18 @Override 19 public void updateDataSet(DataSet ds) { 20 // TODO Auto-generated method stub 21 } 22 22 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/DataGouvFrConstants.java
r30340 r30731 5 5 6 6 public interface DataGouvFrConstants extends FrenchConstants { 7 8 9 10 11 7 8 /** 9 * Wiki 10 */ 11 public static final String WIKI = "http://wiki.openstreetmap.org/wiki/WikiProject_France/data.gouv.fr"; 12 12 13 14 15 16 17 18 19 20 21 13 /** 14 * Source 15 */ 16 public static final String SOURCE_DATAGOUVFR = "data.gouv.fr"; 17 18 /** 19 * Icons 20 */ 21 public static final String ICON_IGN_24 = "data.fr.ign_24.png"; 22 22 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/DataGouvFrModule.java
r30340 r30731 22 22 public class DataGouvFrModule extends AbstractModule { 23 23 24 25 24 public DataGouvFrModule(ModuleInformation info) { 25 super(info); 26 26 handlers.add(Etab1er2ndDegreHandler.class); 27 27 handlers.add(EtabAEFEHandler.class); -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/DataGouvDataSetHandler.java
r30340 r30731 10 10 11 11 public abstract class DataGouvDataSetHandler extends FrenchDataSetHandler implements DataGouvFrConstants { 12 13 14 15 12 13 public DataGouvDataSetHandler() { 14 init(null, null); 15 } 16 16 17 18 19 17 public DataGouvDataSetHandler(String portalPath) { 18 init(portalPath, null); 19 } 20 20 21 22 23 21 public DataGouvDataSetHandler(String portalPath, Projection singleProjection) { 22 init(portalPath, singleProjection); 23 } 24 24 25 26 27 28 25 public DataGouvDataSetHandler(String portalPath, Projection singleProjection, String relevantTag) { 26 super(relevantTag); 27 init(portalPath, singleProjection); 28 } 29 29 30 31 32 33 30 public DataGouvDataSetHandler(String portalPath, String relevantTag) { 31 super(relevantTag); 32 init(portalPath, null); 33 } 34 34 35 36 37 38 39 35 private void init(String portalPath, Projection singleProjection) { 36 setNationalPortalPath(portalPath); 37 setSingleProjection(singleProjection); 38 setLicense(License.LOOL); 39 } 40 40 41 42 43 44 45 46 47 48 49 50 51 52 41 @Override 42 public String getSource() { 43 return SOURCE_DATAGOUVFR; 44 } 45 46 protected final void setDownloadFileName(String filename) { 47 try { 48 setDataURL(FRENCH_PORTAL+"var/download/"+filename); 49 } catch (MalformedURLException e) { 50 e.printStackTrace(); 51 } 52 } 53 53 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/administration/GeoFlaHandler.java
r30701 r30731 19 19 20 20 public class GeoFlaHandler extends DataGouvDataSetHandler { 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 21 22 public GeoFlaHandler() { 23 super(); 24 setName("GEOFLA®"); 25 getShpHandler().setPreferMultipolygonToSimpleWay(true); 26 try { 27 setLocalPortalURL("http://professionnels.ign.fr/geofla#tab-3"); 28 } catch (MalformedURLException e) { 29 e.printStackTrace(); 30 } 31 } 32 33 @Override 34 public String getLocalPortalIconName() { 35 return ICON_IGN_24; 36 } 37 38 @Override 39 public boolean acceptsFilename(String filename) { 40 return isDepartementFile(filename) || isCommuneFile(filename) || isCantonFile(filename) || isArrondissementFile(filename); 41 } 42 43 protected boolean isDepartementFile(String filename) { 44 return acceptsShpMifFilename(filename, "DEPARTEMENT") || acceptsShpMifFilename(filename, "LIMITE_DEPARTEMENT"); 45 } 46 47 protected boolean isCommuneFile(String filename) { 48 return acceptsShpFilename(filename, "COMMUNE") || acceptsShpFilename(filename, "LIMITE_COMMUNE"); 49 } 50 51 protected boolean isCantonFile(String filename) { 52 return acceptsShpFilename(filename, "CANTON") || acceptsShpFilename(filename, "LIMITE_CANTON"); 53 } 54 55 protected boolean isArrondissementFile(String filename) { 56 return acceptsShpFilename(filename, "ARRONDISSEMENT") || acceptsShpFilename(filename, "LIMITE_ARRONDISSEMENT"); 57 } 58 59 @Override 60 public void updateDataSet(DataSet ds) { 61 final String filename = getAssociatedFile().getName(); 62 if (isDepartementFile(filename)) { 63 setNationalPortalPath("GEOFLA®-Départements-30383060"); 64 } else if (isCommuneFile(filename)) { 65 setNationalPortalPath("GEOFLA®-Communes-30383083"); 66 } 67 for (OsmPrimitive p : ds.allPrimitives()) { 68 if (hasKeyIgnoreCase(p, "Id_geofla", "Id_GéoFLA")) { 69 String deptName = WordUtils.capitalizeFully(getAndRemoveIgnoreCase(p, "Nom_dept", "Nom_Département")); 70 if ("Reunion".equals(deptName)) { 71 deptName = "La Réunion"; 72 } 73 if (isDepartementFile(filename)) { 74 p.put("name", deptName); 75 } else if (isCommuneFile(filename)) { 76 p.put("name", WordUtils.capitalizeFully(getAndRemoveIgnoreCase(p, "NOM_COMM"))); 77 replace(p, "INSEE_COM", "ref:INSEE"); 78 } 79 p.put("boundary", "administrative"); 80 String nature = getIgnoreCase(p, "Nature"); 81 if ("Frontière internationale".equalsIgnoreCase(nature) || "Limite côtière".equalsIgnoreCase(nature)) { 82 p.put("admin_level", "2"); 83 } else if ("Limite de région".equalsIgnoreCase(nature)) { 84 p.put("admin_level", "4"); 85 } else if (isDepartementFile(filename) || "Limite de département".equalsIgnoreCase(nature)) { 86 p.put("admin_level", "6"); 87 } else if(isArrondissementFile(filename) || "Limite d'arrondissement".equalsIgnoreCase(nature)) { 88 p.put("admin_level", "7"); 89 } else if(isCommuneFile(filename)) { 90 p.put("admin_level", "8"); 91 } 92 if (p instanceof Relation) { 93 p.put("type", "boundary"); 94 } 95 LatLon llCentroid = getLatLon(p, deptName, "centroid", "Centroïde"); 96 if (llCentroid != null) { 97 Node centroid = new Node(llCentroid); 98 ds.addPrimitive(centroid); 99 //centroid.put("name", p.get("name")); 100 if (p instanceof Relation) { 101 ((Relation) p).addMember(new RelationMember("centroid", centroid)); 102 } 103 } 104 LatLon llChefLieu = getLatLon(p, deptName, "chf_lieu", "Chef_Lieu"); 105 if (llChefLieu != null) { 106 Node chefLieu = new Node(llChefLieu); 107 ds.addPrimitive(chefLieu); 108 //chefLieu.put("Code_chf", getAndRemoveIgnoreCase(p, "Code_chf", "Code_Chef_Lieu")); 109 String name = WordUtils.capitalizeFully(getAndRemoveIgnoreCase(p, "Nom_chf", "Nom_Chef_lieu")); 110 if (isArrondissementFile(filename)) { 111 p.put("name", name); 112 } 113 chefLieu.put("name", name); 114 if (p instanceof Relation) { 115 ((Relation) p).addMember(new RelationMember("admin_centre", chefLieu)); 116 } 117 } 118 } 119 } 120 } 121 122 protected static boolean hasKeyIgnoreCase(OsmPrimitive p, String ... strings) { 123 return getIgnoreCase(p, strings) != null; 124 } 125 126 protected static String getIgnoreCase(OsmPrimitive p, String ... strings) { 127 String result = null; 128 for (String s : strings) { 129 if (result == null) result = p.get(s); 130 if (result == null) result = p.get(s.toUpperCase()); 131 if (result == null) result = p.get(s.toLowerCase()); 132 } 133 return result; 134 } 135 136 protected static void removeIgnoreCase(OsmPrimitive p, String ... strings) { 137 for (String s : strings) { 138 p.remove(s); 139 p.remove(s.toUpperCase()); 140 p.remove(s.toLowerCase()); 141 } 142 } 143 144 protected static String getAndRemoveIgnoreCase(OsmPrimitive p, String ... strings) { 145 String result = getIgnoreCase(p, strings); 146 removeIgnoreCase(p, strings); 147 return result; 148 } 149 150 protected static LatLon getLatLon(OsmPrimitive p, String dptName, String shortAttribute, String longAttribute) { 151 String x = getAndRemoveIgnoreCase(p, "X_"+shortAttribute, "Abscisse_"+longAttribute); 152 String y = getAndRemoveIgnoreCase(p, "Y_"+shortAttribute, "Ordonnée_"+longAttribute); 153 if (x != null && y != null) { 154 try { 155 String dptCode = getIgnoreCase(p, "Code_dept", "Code_Département"); 156 if (dptCode != null && dptCode.equals("97") && dptName != null) { 157 if (dptName.equals("Guadeloupe")) { 158 dptCode = "971"; 159 } else if (dptName.equals("Martinique")) { 160 dptCode = "972"; 161 } else if (dptName.equals("Guyane")) { 162 dptCode = "973"; 163 } else if (dptName.equals("La Réunion")) { 164 dptCode = "974"; 165 } else if (dptName.equals("Mayotte")) { 166 dptCode = "976"; 167 } else { 168 System.err.println("Unknown French department: "+dptName); 169 } 170 } 171 return getLatLonByDptCode(new EastNorth(Double.parseDouble(x)*100.0, Double.parseDouble(y)*100.0), dptCode, false); 172 } catch (NumberFormatException e) { 173 System.err.println(e.getMessage()); 174 } 175 } 176 return null; 177 } 178 179 private Pair<String, URL> getGeoflaURL(String name, String urlSuffix) throws MalformedURLException { 180 return new Pair<>(name, new URL("http://professionnels.ign.fr/sites/default/files/"+urlSuffix)); 181 } 182 183 @Override 184 public List<Pair<String, URL>> getDataURLs() { 185 List<Pair<String, URL>> result = new ArrayList<>(); 186 try { 187 result.add(getGeoflaURL("Départements France métropolitaine et Corse", "GEOFLADept_FR_Corse_AV_L93.zip")); 188 result.add(getGeoflaURL("Départements France entière", "FR_DOM_Mayotte_shp_WGS84.zip")); 189 // FIXME: tar.gz files 190 /*result.add(getGeoflaURL("Communes France métropolitaine", "531/266/5312664/GEOFLA_1-1_SHP_LAMB93_FR-ED111.tar.gz")); 191 result.add(getGeoflaURL("Communes Guadeloupe", "531/265/5312650/GEOFLA_1-1_SHP_UTM20W84_GP-ED111.tar.gz")); 192 result.add(getGeoflaURL("Communes Martinique", "531/265/5312653/GEOFLA_1-1_SHP_UTM20W84_MQ-ED111.tar.gz")); 193 result.add(getGeoflaURL("Communes Guyane", "531/265/5312657/GEOFLA_1-1_SHP_UTM22RGFG95_GF-ED111.tar.gz")); 194 result.add(getGeoflaURL("Communes Réunion", "531/266/5312660/GEOFLA_1-1_SHP_RGR92UTM40S_RE-ED111.tar.gz")); 195 result.add(getGeoflaURL("Communes Mayotte", "531/275/5312753/GEOFLA_1-1_SHP_RGM04UTM38S_YT-ED111.tar.gz"));*/ 196 } catch (MalformedURLException e) { 197 e.printStackTrace(); 198 } 199 return result; 200 } 201 201 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/agriculture/RegistreParcellaireHandler.java
r30701 r30731 15 15 16 16 public class RegistreParcellaireHandler extends DataGouvDataSetHandler { 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 17 18 protected static final int PAS_D_INFORMATION = 0; 19 protected static final int BLE_TENDRE = 1; 20 protected static final int MAIS_GRAIN_ET_ENSILAGE = 2; 21 protected static final int ORGE = 3; 22 protected static final int AUTRES_CEREALES = 4; 23 protected static final int COLZA = 5; 24 protected static final int TOURNESOL = 6; 25 protected static final int AUTRES_OLEAGINEUX = 7; 26 protected static final int PROTEAGINEUX = 8; 27 protected static final int PLANTES_A_FIBRES = 9; 28 protected static final int SEMENCES = 10; 29 protected static final int GEL_SURFACES_GELEES_SANS_PRODUCTION = 11; 30 protected static final int GEL_INDUSTRIEL = 12; 31 protected static final int AUTRES_GELS = 13; 32 protected static final int RIZ = 14; 33 protected static final int LEGUMINEUSES_A_GRAINS = 15; 34 protected static final int FOURRAGE = 16; 35 protected static final int ESTIVES_LANDES = 17; 36 protected static final int PRAIRIES_PERMANENTES = 18; 37 protected static final int PRAIRIES_TEMPORAIRES = 19; 38 protected static final int VERGERS = 20; 39 protected static final int VIGNES = 21; 40 protected static final int FRUITS_A_COQUE = 22; 41 protected static final int OLIVIERS = 23; 42 protected static final int AUTRES_CULTURES_INDUSTRIELLES = 24; 43 protected static final int LEGUMES_FLEURS = 25; 44 protected static final int CANNE_A_SUCRE = 26; 45 protected static final int ARBORICULTURE = 27; 46 protected static final int DIVERS = 28; 47 48 public RegistreParcellaireHandler() { 49 super(); 50 setName("Registre Parcellaire Graphique"); 51 } 52 52 53 54 55 56 53 @Override 54 public boolean acceptsFilename(String filename) { 55 return acceptsShpFilename(filename, "RPG_20.._..."); 56 } 57 57 58 59 60 61 58 @Override 59 public ExtendedSourceEntry getMapPaintStyle() { 60 return getMapPaintStyle("Registre Parcellaire Graphique (France)"); 61 } 62 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 63 @Override 64 public void updateDataSet(DataSet ds) { 65 for (OsmPrimitive p : ds.allPrimitives()) { 66 String code = p.get("CULT_MAJ"); 67 68 if (code != null && !code.isEmpty()) { 69 replace(p, "NUM_ILOT", "ref:FR:RPG"); 70 replace(p, "CULT_MAJ", "code:FR:RPG"); 71 72 switch (Integer.parseInt(code)) { 73 case ARBORICULTURE: 74 p.put("landuse", "forest"); 75 break; 76 case FOURRAGE: 77 case PRAIRIES_PERMANENTES: 78 case PRAIRIES_TEMPORAIRES: 79 case ESTIVES_LANDES: 80 case GEL_SURFACES_GELEES_SANS_PRODUCTION: 81 case GEL_INDUSTRIEL: 82 case AUTRES_GELS: 83 p.put("landuse", "meadow"); 84 break; 85 case OLIVIERS: 86 p.put("trees", "olive_tree"); 87 case VERGERS: 88 p.put("landuse", "orchard"); 89 break; 90 case VIGNES: 91 p.put("landuse", "vineyard"); 92 break; 93 case PAS_D_INFORMATION: 94 case BLE_TENDRE: 95 case MAIS_GRAIN_ET_ENSILAGE: 96 case ORGE: 97 case AUTRES_CEREALES: 98 case COLZA: 99 case TOURNESOL: 100 case AUTRES_OLEAGINEUX: 101 case PROTEAGINEUX: 102 case PLANTES_A_FIBRES: 103 case SEMENCES: 104 case RIZ: 105 case LEGUMINEUSES_A_GRAINS: 106 case FRUITS_A_COQUE: 107 case AUTRES_CULTURES_INDUSTRIELLES: 108 case LEGUMES_FLEURS: 109 case CANNE_A_SUCRE: 110 case DIVERS: 111 default: 112 p.put("landuse", "farm"); 113 } 114 } 115 } 116 } 117 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 118 private Pair<String, URL> getRpgURL(String number, String name) throws MalformedURLException { 119 return new Pair<>(number+" - "+name, new URL("http://www.data.gouv.fr/var/download/ign/RPG_2010_"+number+".ZIP")); 120 } 121 122 @Override 123 public List<Pair<String, URL>> getDataURLs() { 124 List<Pair<String, URL>> result = new ArrayList<>(); 125 try { 126 for (FrenchAdministrativeUnit dpt : FrenchAdministrativeUnit.allDepartments) { 127 result.add(getRpgURL(dpt.getCode(), dpt.getName())); 128 } 129 } catch (MalformedURLException e) { 130 e.printStackTrace(); 131 } 132 return result; 133 } 134 134 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/culture/BibliothequesHandler.java
r30563 r30731 9 9 public class BibliothequesHandler extends DataGouvDataSetHandler { 10 10 11 12 13 14 15 16 11 public BibliothequesHandler() { 12 super("Adresses-des-bibliothèques-municipales-30382179", lambert93); 13 setName("Bibliothèques municipales"); 14 setDownloadFileName("lieux de lecture_geoloc.txt"); 15 getCsvHandler().setCharset(OdConstants.ISO8859_15); 16 } 17 17 18 19 20 21 18 @Override 19 public boolean acceptsFilename(String filename) { 20 return acceptsCsvFilename(filename, "lieux de lecture_geoloc.txt-fr"); 21 } 22 22 23 24 25 26 27 28 23 @Override 24 public void updateDataSet(DataSet ds) { 25 for (Node n : ds.getNodes()) { 26 n.put("amenity", "library"); 27 } 28 } 29 29 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/diplomatie/EtabAEFEHandler.java
r30340 r30731 8 8 public class EtabAEFEHandler extends DataGouvDataSetHandler { 9 9 10 11 12 13 14 15 10 public EtabAEFEHandler() { 11 super("Géolocalisation-des-établissements-du-réseau-d'enseignement-de-l'AEFE-30382449", wgs84); 12 setName("Établissements du réseau d'enseignement de l'AEFE"); 13 setDownloadFileName("ETALAB_MAEE_Extraction_LDAP_geoloc_AEFE_2011-10-13.csv"); 14 getCsvHandler().setSeparator(","); 15 } 16 16 17 18 19 20 17 @Override 18 public boolean acceptsFilename(String filename) { 19 return acceptsCsvFilename(filename, "ETALAB_MAEE_Extraction_LDAP_geoloc_AEFE_20..-..-..(\\.csv-fr)?"); 20 } 21 21 22 23 24 25 26 27 28 29 30 31 32 22 @Override 23 public void updateDataSet(DataSet ds) { 24 for (Node n : ds.getNodes()) { 25 n.put("amenity", "school"); 26 replace(n, "code_etab", "ref"); 27 replace(n, "ENTStructureNomCourant", "name:fr"); 28 replace(n, "adresse", "addr"); 29 replace(n, "ENTStructureSiteWeb", "website"); 30 replace(n, "ENTStructureEmail", "contact:email"); 31 } 32 } 33 33 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/AssainissementHandler.java
r30701 r30731 20 20 public class AssainissementHandler extends DataGouvDataSetHandler { 21 21 22 23 24 25 26 22 public AssainissementHandler() { 23 super("assainissement-collectif-30381843"); 24 setName("Assainissement collectif"); 25 setSpreadSheetHandler(new InternalOdsHandler()); 26 } 27 27 28 29 30 31 28 @Override 29 public boolean acceptsFilename(String filename) { 30 return acceptsOdsFilename(filename, "Export_ERU_20.."); 31 } 32 32 33 34 35 36 33 @Override 34 public void updateDataSet(DataSet ds) { 35 // Implemented in InternalOdsHandler.nodesAdded() 36 } 37 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 38 @Override 39 public List<Pair<String, URL>> getDataURLs() { 40 List<Pair<String, URL>> result = new ArrayList<>(); 41 try { 42 result.add(new Pair<>("Données 2009", new URL("http://www.assainissement.developpement-durable.gouv.fr/telecharger2.php"))); 43 result.add(new Pair<>("Données 2010", new URL("http://www.assainissement.developpement-durable.gouv.fr/telecharger2_2010.php"))); 44 result.add(new Pair<>("Données 2011", new URL("http://www.assainissement.developpement-durable.gouv.fr/telecharger2_2011.php"))); 45 } catch (MalformedURLException e) { 46 e.printStackTrace(); 47 } 48 return result; 49 } 50 51 private final class InternalOdsHandler extends DefaultSpreadSheetHandler { 52 52 53 54 55 56 53 private Node nodeWithKeys; 54 55 private final Set<String> interestingKeys = new HashSet<>(); 56 57 57 public InternalOdsHandler() { 58 58 setSheetNumber(1); … … 123 123 removeUninterestingTags(); 124 124 } 125 125 } 126 126 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/ForetsPubliquesHandler.java
r30701 r30731 17 17 public class ForetsPubliquesHandler extends DataGouvDataSetHandler { 18 18 19 19 private static final String PATTERN = "for_publ_v20.._reg(..)"; 20 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 21 public ForetsPubliquesHandler() { 22 setName("Forêts publiques"); 23 } 24 25 @Override 26 public boolean acceptsFilename(String filename) { 27 boolean result = acceptsZipFilename(filename, PATTERN) || acceptsShpFilename(filename, PATTERN); 28 if (result) { 29 setNationalPortalPath(findPortalSuffix(filename)); 30 } 31 return result; 32 } 33 34 @Override 35 public boolean acceptsUrl(String url) { 36 boolean result = super.acceptsUrl(url); 37 if (result) { 38 setNationalPortalPath(findPortalSuffix(url)); 39 } 40 return result; 41 } 42 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 43 private final String findPortalSuffix(CharSequence filename) { 44 Matcher m = Pattern.compile(".*"+PATTERN+"\\....").matcher(filename); 45 if (m.matches()) { 46 String regionCode = m.group(1); 47 if (regionCode.equals("42")) { 48 return "Forêts-publiques-d’Alsace-30378695"; 49 } else if (regionCode.equals("72")) { 50 return "Forêts-publiques-d'Aquitaine-30378994"; 51 } else if (regionCode.equals("83")) { 52 return "Forêts-publiques-d'Auvergne-30379302"; 53 } else if (regionCode.equals("26")) { 54 return "Forêts-publiques-de-Bourgogne-30379206"; 55 } else if (regionCode.equals("53")) { 56 return "Forêts-publiques-de-Bretagne-30378874"; 57 } else if (regionCode.equals("24")) { 58 return "Forêts-publiques-du-Centre-30379134"; 59 } else if (regionCode.equals("21")) { 60 return "Forêts-publiques-de-Champagne-Ardenne-30378853"; 61 } else if (regionCode.equals("94")) { 62 return "Forêts-publiques-de-Corse-30379118"; 63 } else if (regionCode.equals("43")) { 64 return "Forêts-publiques-de-Franche-Comté-30378652"; 65 } else if (regionCode.equals("11")) { 66 return "Forêts-publiques-d’Île-de-France-30378829"; 67 } else if (regionCode.equals("91")) { 68 return "Forêts-publiques-de-Languedoc-Roussillon-30379312"; 69 } else if (regionCode.equals("74")) { 70 return "Forêts-publiques-du-Limousin-30378844"; 71 } else if (regionCode.equals("41")) { 72 return "Forêts-publiques-de-Lorraine-30378675"; 73 } else if (regionCode.equals("73")) { 74 return "Forêts-publiques-de-Midi-Pyrénées-30378665"; 75 } else if (regionCode.equals("31")) { 76 return "Forêts-publiques-du-Nord-Pas-de-Calais-30379095"; 77 } else if (regionCode.equals("25")) { 78 return "Forêts-publiques-de-Basse-Normandie-30378962"; 79 } else if (regionCode.equals("23")) { 80 return "Forêts-publiques-de-Haute-Normandie-30379164"; 81 } else if (regionCode.equals("52")) { 82 return "Forêts-publiques-des-Pays-de-la-Loire-30378999"; 83 } else if (regionCode.equals("22")) { 84 return "Forêts-publiques-de-Picardie-30379389"; 85 } else if (regionCode.equals("54")) { 86 return "Forêts-publiques-de-Poitou-Charente-30378900"; 87 } else if (regionCode.equals("93")) { 88 return "Forêts-publiques-de-PACA-30379322"; 89 } else if (regionCode.equals("82")) { 90 return "Forêts-publiques-de-Rhône-Alpes-30378732"; 91 } else { 92 System.err.println("Unknown French region code: "+regionCode); 93 } 94 } 95 return null; 96 } 97 97 98 99 100 101 102 103 104 105 106 107 98 @Override 99 public void updateDataSet(DataSet ds) { 100 for (OsmPrimitive p : ds.allPrimitives()) { 101 // For all identified objects (both closed ways and multipolygons) 102 if (p.hasKey("IIDTN_FRT")) { 103 p.put("landuse", "forest"); 104 replace(p, "LLIB_FRT", "name"); 105 } 106 } 107 } 108 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 109 @Override 110 public List<Pair<String, URL>> getDataURLs() { 111 List<Pair<String, URL>> result = new ArrayList<>(); 112 try { 113 for (FrenchAdministrativeUnit region : FrenchAdministrativeUnit.allRegions) { 114 if (!region.getCode().startsWith("0")) { // Skip DOM/TOM 115 result.add(getForetURL(region.getCode(), region.getName())); 116 } 117 } 118 } catch (MalformedURLException e) { 119 e.printStackTrace(); 120 } 121 return result; 122 } 123 123 124 125 126 124 private Pair<String, URL> getForetURL(String code, String regionName) throws MalformedURLException { 125 return new Pair<>("PublicForests_"+regionName, new URL(FRENCH_PORTAL+"var/download/"+"for_publ_v2011_reg"+code+".zip")); 126 } 127 127 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/InventaireForestierNationalHandler.java
r30701 r30731 15 15 public class InventaireForestierNationalHandler extends DataGouvDataSetHandler { 16 16 17 18 19 20 17 private static final String FORET = "foret"; 18 private static final String PEUPLERAIE = "peupleraie"; 19 20 private static final String PATTERN = "placettes_("+FORET+"|"+PEUPLERAIE+")_(20..)"; 21 21 22 23 24 25 26 27 28 29 30 31 32 33 34 22 public InventaireForestierNationalHandler() { 23 super(); 24 setName("Inventaire forestier national"); 25 } 26 27 @Override 28 public boolean acceptsFilename(String filename) { 29 boolean result = acceptsCsvFilename(filename, PATTERN); 30 if (result) { 31 setNationalPortalPath(findPortalSuffix(filename)); 32 } 33 return result; 34 } 35 35 36 37 38 39 40 41 42 43 36 @Override 37 public boolean acceptsUrl(String url) { 38 boolean result = super.acceptsUrl(url); 39 if (result) { 40 setNationalPortalPath(findPortalSuffix(url)); 41 } 42 return result; 43 } 44 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 45 private final String findPortalSuffix(CharSequence filename) { 46 Matcher m = Pattern.compile(".*"+PATTERN+"\\....").matcher(filename); 47 if (m.matches()) { 48 String type = m.group(1); 49 if (type.equals(FORET)) { 50 switch (Integer.parseInt(m.group(2))) { 51 case 2010: return "Données-points-forêt-2010-30379029"; 52 case 2009: return "Données-points-forêt-2009-30378890"; 53 case 2008: return "Données-points-forêt-2008-30378754"; 54 case 2007: return "Données-points-forêt-2007-30378682"; 55 case 2006: return "Données-points-forêt-2006-30379198"; 56 case 2005: return "Données-points-forêt-2005-30378933"; 57 default: System.err.println("Unknown IFN year: "+m.group(2)); 58 } 59 } else if (type.equals(PEUPLERAIE)) { 60 switch (Integer.parseInt(m.group(2))) { 61 case 2010: return "Données-points-peupleraie-2010-30379180"; 62 case 2009: return "Données-points-peupleraie-2009-30378848"; 63 case 2008: return "Données-points-peupleraie-2008-30378632"; 64 case 2007: return "Données-points-peupleraie-2007-30378611"; 65 case 2006: return "Données-points-peupleraie-2006-30378633"; 66 case 2005: return "Données-points-peupleraie-2005-30378717"; 67 default: System.err.println("Unknown IFN year: "+m.group(2)); 68 } 69 } else { 70 System.err.println("Unknown IFN type: "+type); 71 } 72 } 73 return null; 74 } 75 76 @Override 77 public void updateDataSet(DataSet ds) { 78 // TODO 79 } 80 81 @Override 82 public List<Pair<String, URL>> getDataURLs() { 83 List<Pair<String, URL>> result = new ArrayList<>(); 84 try { 85 for (int year = 2010; year >= 2005; year--) { 86 result.add(getIfnURL(year, "Peupleraies", PEUPLERAIE)); 87 result.add(getIfnURL(year, "Forêts", FORET)); 88 } 89 } catch (MalformedURLException e) { 90 e.printStackTrace(); 91 } 92 return result; 93 } 94 95 private Pair<String, URL> getIfnURL(int year, String name, String type) throws MalformedURLException { 96 return new Pair<>(name+" "+year, new URL("http://www.ifn.fr/spip/IMG/csv/placettes_"+type+"_"+year+".csv")); 97 } 98 98 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/ecologie/ReservesBiologiquesHandler.java
r30340 r30731 7 7 public class ReservesBiologiquesHandler extends DataGouvDataSetHandler { 8 8 9 10 11 12 13 14 15 16 17 18 9 public ReservesBiologiquesHandler() { 10 super("Réserves-biologiques-de-métropole-30378855"); 11 setName("Réserves biologiques de métropole"); 12 setDownloadFileName("ONF_RB_2011_Officielles_L93.zip"); 13 } 14 15 @Override 16 public boolean acceptsFilename(String filename) { 17 return acceptsZipFilename(filename, "ONF_RB_20.._Officielles_L93") || acceptsShpFilename(filename, "ONF_RB_20.._Officielles_L93"); 18 } 19 19 20 21 22 23 20 @Override 21 public void updateDataSet(DataSet ds) { 22 // TODO 23 } 24 24 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/Etab1er2ndDegreHandler.java
r30563 r30731 12 12 public class Etab1er2ndDegreHandler extends DataGouvDataSetHandler { 13 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 14 private class EtabCsvHandler extends DefaultCsvHandler { 15 16 public EtabCsvHandler() { 17 setCharset(OdConstants.ISO8859_15); 18 setHandlesProjection(true); 19 } 20 21 @Override 22 public LatLon getCoor(EastNorth en, String[] fields) { 23 return getLatLonByDptCode(en, fields[0].substring(0, 3), false); 24 } 25 } 26 27 public Etab1er2ndDegreHandler() { 28 super("Géolocalisation-des-établissements-d'enseignement-du-premier-degré-et-du-second-degré-du-ministère-d-30378093"); 29 setName("Établissements d'enseignement du premier degré et du second degré"); 30 setDownloadFileName("MENJVA_etab_geoloc.csv"); 31 setCsvHandler(new EtabCsvHandler()); 32 } 33 34 @Override 35 public boolean acceptsFilename(String filename) { 36 return acceptsCsvFilename(filename, "MENJVA_etab_geoloc(\\.csv-fr)?"); 37 } 38 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 39 @Override 40 public void updateDataSet(DataSet ds) { 41 for (Node n : ds.getNodes()) { 42 n.put("amenity", "school"); 43 replace(n, "numero_uai", "ref:FR:UAI"); 44 replace(n, "appellation_officielle_uai", "name"); 45 add(n, "lib_nature", "school:FR", 46 new String[]{".*MATERNELLE.*", ".*ELEMENTAIRE.*", "COLLEGE.*", "LYCEE.*"}, 47 new String[]{"maternelle", "élémentaire", "college", "lycée"}); 48 n.remove("etat_etablissement"); // Toujours a 1 49 n.remove("nature_uai"); // cle numerique associe au champ lib_nature, redondant, donc 50 n.remove("patronyme_uai"); // deja dans le nom 51 n.remove("sous_fic"); // cycle ? 1 pour ecoles, 3 pour colleges et lycees 52 // Voir http://www.infocentre.education.fr/bcn/domaine/voir/id/31 53 } 54 } 55 55 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/education/EtabSupHandler.java
r30340 r30731 10 10 public class EtabSupHandler extends DataGouvDataSetHandler { 11 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 12 private class EtabSupCsvHandler extends InternalCsvHandler { 13 @Override 14 public LatLon getCoor(EastNorth en, String[] fields) { 15 // X/Y sont inversees dans le fichier 16 return wgs84.eastNorth2latlon(new EastNorth(en.north(), en.east())); 17 } 18 } 19 20 public EtabSupHandler() { 21 super("Etablissements-d'enseignement-supérieur-30382046", wgs84); 22 setName("Établissements d'enseignement supérieur"); 23 setDownloadFileName("livraison ETALAB 28 11 2011.xls"); 24 setCsvHandler(new EtabSupCsvHandler()); 25 } 26 26 27 28 29 30 27 @Override 28 public boolean acceptsFilename(String filename) { 29 return acceptsXlsFilename(filename, "livraison ETALAB .. .. 20..(\\.xls-fr)?"); 30 } 31 31 32 33 34 35 36 37 38 32 @Override 33 public void updateDataSet(DataSet ds) { 34 for (Node n : ds.getNodes()) { 35 replace(n, "NOM_ETABLISSEMENT", "name"); 36 n.put("amenity", "university"); 37 } 38 } 39 39 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/EauxDeSurfaceHandler.java
r30701 r30731 21 21 public class EauxDeSurfaceHandler extends DataGouvDataSetHandler { 22 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 23 private static final String ZIP_PATTERN = "FR(.*)_SW"; 24 private static final String SHP_PATTERN = "FR_(.*)_SWB_.W_20......"; 25 26 private static final class WaterAgency { 27 public final String code; 28 public final String name; 29 public final String suffix; 30 public WaterAgency(String code, String name, String suffix) { 31 this.code = code; 32 this.name = name; 33 this.suffix = suffix; 34 } 35 } 36 37 private static final WaterAgency[] waterAgencies = new WaterAgency[]{ 38 new WaterAgency("A", "Escaut Somme", "Escaut-Somme-30381967"), 39 new WaterAgency("B1", "Meuse", "Meuse-30381855"), 40 new WaterAgency("B2", "Sambre", "Sambre-30381857"), 41 new WaterAgency("C", "Rhin", "Rhin-30381951"), 42 new WaterAgency("D", "Rhône Méditerranée", "Rhône-Méditerranée-30382014"), 43 new WaterAgency("E", "Corse", "Corse-30381905"), 44 new WaterAgency("F", "Adour Garonne", "Adour-Garonne-30381839"), 45 new WaterAgency("G", "Loire Bretagne", "Loire-Bretagne-30381904"), 46 new WaterAgency("I", "Guadeloupe", "Guadeloupe-30381899"), 47 new WaterAgency("J", "Martinique", "Martinique-30381935"), 48 new WaterAgency("K", "Guyane", "Guyane-30381988"), 49 new WaterAgency("L", "La Réunion", "Réunion-30381991"), 50 }; 51 52 public EauxDeSurfaceHandler() { 53 setName("Eaux de surface"); 54 setArchiveHandler(new InternalZipHandler()); 55 } 56 57 @Override 58 public boolean acceptsFilename(String filename) { 59 boolean result = acceptsZipFilename(filename, ZIP_PATTERN) || acceptsShpFilename(filename, SHP_PATTERN); 60 if (result) { 61 setNationalPortalPath(findPortalSuffix(filename)); 62 } 63 return result; 64 } 65 66 @Override 67 public boolean acceptsUrl(String url) { 68 boolean result = super.acceptsUrl(url); 69 if (result) { 70 setNationalPortalPath(findPortalSuffix(url)); 71 } 72 return result; 73 } 74 74 75 76 77 78 79 80 81 82 83 84 85 86 87 75 private String findPortalSuffix(String filename) { 76 for (String pattern : new String[]{ZIP_PATTERN, SHP_PATTERN}) { 77 Matcher m = Pattern.compile(".*"+pattern+"\\....").matcher(filename); 78 if (m.matches()) { 79 for (int i =0; i<waterAgencies.length; i++) { 80 if (waterAgencies[i].code.equals(m.group(1))) { 81 return "Couche-SIG-des-caractéristiques-des-bassins-2010-%3A-eaux-de-surface---"+waterAgencies[i].suffix; 82 } 83 } 84 } 85 } 86 return null; 87 } 88 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 89 @Override 90 public void updateDataSet(DataSet ds) { 91 // TODO Auto-generated method stub 92 } 93 94 @Override 95 public List<Pair<String, URL>> getDataURLs() { 96 List<Pair<String, URL>> result = new ArrayList<>(); 97 try { 98 for (WaterAgency wa : waterAgencies) { 99 result.add(getDownloadURL(wa)); 100 } 101 } catch (MalformedURLException e) { 102 e.printStackTrace(); 103 } 104 return result; 105 } 106 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 107 private Pair<String, URL> getDownloadURL(WaterAgency a) throws MalformedURLException { 108 return new Pair<>("SurfaceWater_"+a.name, new URL("http://www.rapportage.eaufrance.fr/sites/default/files/SIG/FR"+a.code+"_SW.zip")); 109 } 110 111 private class InternalZipHandler extends DefaultArchiveHandler { 112 @Override 113 public void notifyTempFileWritten(File file) { 114 if (file.getName().matches(SHP_PATTERN.replace("(.*)", "F")+"\\.prj")) { // Adour-Garonne .prj files cannot be parsed because they do not contain quotes... 115 try { 116 BufferedReader reader = new BufferedReader(new FileReader(file)); 117 String line = reader.readLine(); 118 reader.close(); 119 if (!line.contains("\"")) { 120 for (String term : new String[]{"GCS_ETRS_1989", "D_ETRS_1989", "GRS_1980", "Greenwich", "Degree"}) { 121 line = line.replace(term, "\""+term+"\""); 122 } 123 BufferedWriter writer = new BufferedWriter(new FileWriter(file)); 124 writer.write(line); 125 writer.close(); 126 } 127 } catch (Exception e) { 128 e.printStackTrace(); 129 } 130 } 131 } 132 } 133 133 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/hydrologie/ROEHandler.java
r30340 r30731 10 10 public class ROEHandler extends DataGouvDataSetHandler { 11 11 12 13 14 15 16 17 18 19 20 12 public ROEHandler() { 13 super("référentiel-des-obstacles-à-l'écoulement-30381987"); 14 setName("Référentiel des Obstacles à l’Écoulement"); 15 try { 16 setDataURL("http://www.eaufrance.fr/docs/ROE/donnee_obstacles_ecoulement_v3.zip"); 17 } catch (MalformedURLException e) { 18 e.printStackTrace(); 19 } 20 } 21 21 22 23 24 25 26 27 22 @Override 23 public boolean acceptsFilename(String filename) { 24 return acceptsMifTabFilename(filename, "roe_version._20......_wlatin1") 25 || acceptsShpFilename(filename, "roe_version._20......_system_L93") 26 || acceptsXlsFilename(filename, "roe_version._20......_wlatin1"); 27 } 28 28 29 30 31 32 33 34 35 36 37 38 39 40 41 29 @Override 30 public void updateDataSet(DataSet ds) { 31 for (Node n : ds.getNodes()) { 32 replace(n, "Id_ROE", "ref:FR:ROE"); 33 replace(n, "Nom", "name"); 34 n.remove("XL2e"); n.remove("YL2e"); 35 n.remove("XL93"); n.remove("YL93"); 36 replace(n, "typeCd", "waterway", new String[]{"1.1", "1.2", "1.6"}, new String[]{"dam", "weir", "lock_gate"}); 37 replace(n, "typeCd", "man_made", new String[]{"1.3", "1.5"}, new String[]{"dyke", "groyne"}); 38 replace(n, "typeCd", "bridge", new String[]{"1.4"}, new String[]{"yes"}); 39 n.remove("typeCd"); 40 } 41 } 42 42 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/transport/AeroportsHandler.java
r30340 r30731 15 15 public class AeroportsHandler extends DataGouvDataSetHandler { 16 16 17 18 19 20 21 22 23 24 25 17 private static final Pattern COOR_PATTERN = Pattern.compile( 18 "(-?\\p{Digit}+)°\\p{Space}*(\\p{Digit}+)'\\p{Space}*(\\p{Digit}+)\\p{Space}*((Nord|Sud|Est|Ouest)?)", Pattern.CASE_INSENSITIVE); 19 20 public AeroportsHandler() { 21 super("Aéroports-français-coordonnées-géographiques-30382044"); 22 setName("Aéroports"); 23 setDownloadFileName("coordonn_es g_ographiques a_roports fran_ais v2.xls"); 24 setSpreadSheetHandler(new InternalXlsHandler()); 25 } 26 26 27 28 29 30 27 @Override 28 public boolean acceptsFilename(String filename) { 29 return acceptsXlsFilename(filename, "coordonn_es g_ographiques a_roports fran_ais v2"); 30 } 31 31 32 33 34 35 36 37 38 39 32 @Override 33 public void updateDataSet(DataSet ds) { 34 for (Node n : ds.getNodes()) { 35 n.put("aeroway", "aerodrome"); 36 } 37 } 38 39 protected class InternalXlsHandler extends DefaultSpreadSheetHandler { 40 40 41 42 43 44 41 public InternalXlsHandler() { 42 setLineNumber(4); 43 setHandlesProjection(true); 44 } 45 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 46 @Override 47 public LatLon getCoor(EastNorth en, String[] fields) { 48 Matcher x = COOR_PATTERN.matcher(fields[getXCol()]); 49 Matcher y = COOR_PATTERN.matcher(fields[getYCol()]); 50 if (x.matches() && y.matches() && x.groupCount() >= 4 && y.groupCount() >= 4) { 51 return new LatLon(convertDegreeMinuteSecond(y), convertDegreeMinuteSecond(x)); 52 } 53 return null; 54 } 55 56 protected double convertDegreeMinuteSecond(Matcher m) { 57 Double deg = Double.parseDouble(m.group(1)); 58 Double min = Double.parseDouble(m.group(2)); 59 Double sec = Double.parseDouble(m.group(3)); 60 Double sign = deg < 0 61 || (m.groupCount() >= 5 && (m.group(4).equalsIgnoreCase("Sud") || m.group(4).equalsIgnoreCase("Ouest"))) 62 ? -1.0 : +1.0; 63 if (sign < 0) { 64 if (deg > 0) { 65 deg *= sign; 66 } 67 min *= sign; 68 sec *= sign; 69 } 70 return OdUtils.convertDegreeMinuteSecond(deg, min, sec); 71 } 72 } 73 73 } -
applications/editors/josm/plugins/opendata/modules/fr.datagouvfr/src/org/openstreetmap/josm/plugins/opendata/modules/fr/datagouvfr/datasets/transport/PassageNiveauHandler.java
r30563 r30731 9 9 public class PassageNiveauHandler extends DataGouvDataSetHandler { 10 10 11 12 13 14 15 16 11 public PassageNiveauHandler() { 12 super("Passages-à-niveau-30383135"); 13 setName("Passages à niveau"); 14 setDownloadFileName("passage_a_niveau.csv"); 15 getCsvHandler().setCharset(OdConstants.ISO8859_15); 16 } 17 17 18 19 20 21 18 @Override 19 public boolean acceptsFilename(String filename) { 20 return acceptsCsvFilename(filename, "passage_a_niveau(\\.csv-fr)?"); 21 } 22 22 23 24 25 26 27 28 23 @Override 24 public void updateDataSet(DataSet ds) { 25 for (Node n : ds.getNodes()) { 26 n.put("railway", "level_crossing"); 27 } 28 } 29 29 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/LeMansConstants.java
r30340 r30731 5 5 6 6 public interface LeMansConstants extends FrenchConstants { 7 8 9 10 11 12 13 14 15 16 7 8 /** 9 * Source 10 */ 11 public static final String SOURCE_LE_MANS = "Le Mans Métropole"; 12 13 /** 14 * Portal 15 */ 16 public static final String PORTAL = "http://www.lemans.fr/"; 17 17 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/LeMansModule.java
r30340 r30731 14 14 public class LeMansModule extends AbstractModule { 15 15 16 17 18 19 20 21 22 23 24 16 public LeMansModule(ModuleInformation info) { 17 super(info); 18 handlers.add(ServicesCommunautairesMunicipauxHandler.class); 19 handlers.add(CantonsSartheHandler.class); 20 handlers.add(CommunesHandler.class); 21 handlers.add(CodesPostauxHandler.class); 22 handlers.add(CirconscriptionsLegislativesHandler.class); 23 handlers.add(ConseilsQuartiersHandler.class); 24 handlers.add(PointsApportVolontaireHandler.class); 25 25 } 26 26 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/CantonsSartheHandler.java
r30340 r30731 7 7 public class CantonsSartheHandler extends LeMansDataSetHandler { 8 8 9 10 11 12 13 9 public CantonsSartheHandler() { 10 super("F7D936DF-550EA533-37695DD8-29CFF55B"); 11 setName("Cantons de la Sarthe"); 12 setKmzShpUuid("62DFCA8F-550EA533-7E7BB44A-7D1AA2D4", "62E017CA-550EA533-7E7BB44A-23772121"); 13 } 14 14 15 16 17 18 15 @Override 16 public boolean acceptsFilename(String filename) { 17 return acceptsKmzShpFilename(filename, "CANTONS_72") || acceptsZipFilename(filename, "Les cantons de la Sarthe .*"); 18 } 19 19 20 21 22 23 24 25 20 @Override 21 public void updateDataSet(DataSet ds) { 22 for (Node n : ds.getNodes()) { 23 replace(n, "NOM", "name"); 24 } 25 } 26 26 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/CirconscriptionsLegislativesHandler.java
r30340 r30731 6 6 public class CirconscriptionsLegislativesHandler extends LeMansDataSetHandler { 7 7 8 9 10 11 12 8 public CirconscriptionsLegislativesHandler() { 9 super("F7D06B39-550EA533-37695DD8-95CA6762"); 10 setName("Circonscriptions législatives"); 11 setKmzShpUuid("64468222-550EA533-7E7BB44A-39A6B127", "6447510C-550EA533-7E7BB44A-9971DB1A"); 12 } 13 13 14 15 16 17 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsKmzShpFilename(filename, "CIRCONSCRIPTIONS") || acceptsZipFilename(filename, "Les circonscriptions .*"); 17 } 18 18 19 20 21 22 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/CodesPostauxHandler.java
r30340 r30731 6 6 public class CodesPostauxHandler extends LeMansDataSetHandler { 7 7 8 9 10 11 12 8 public CodesPostauxHandler() { 9 super("F758F369-550EA533-37695DD8-84EB87F5"); 10 setName("Codes postaux"); 11 setKmzShpUuid("6449CF5B-550EA533-7E7BB44A-2DB0261B", "644A524A-550EA533-7E7BB44A-9B34A76A"); 12 } 13 13 14 15 16 17 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsKmzShpFilename(filename, "CODES_POSTAUX") || acceptsZipFilename(filename, "Les codes postaux .*"); 17 } 18 18 19 20 21 22 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/CommunesHandler.java
r30340 r30731 7 7 public class CommunesHandler extends LeMansDataSetHandler { 8 8 9 10 11 12 13 9 public CommunesHandler() { 10 super("F7B756B1-550EA533-37695DD8-FE094AE7"); 11 setName("Communes"); 12 setKmzShpUuid("64527774-550EA533-7E7BB44A-FD17EEF0", "6452D942-550EA533-7E7BB44A-C184920B"); 13 } 14 14 15 16 17 18 15 @Override 16 public boolean acceptsFilename(String filename) { 17 return acceptsKmzShpFilename(filename, "LIMITES_DE_COMMUNES") || acceptsZipFilename(filename, "Les limites de communes .*"); 18 } 19 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 20 @Override 21 public void updateDataSet(DataSet ds) { 22 for (OsmPrimitive p : ds.allPrimitives()) { 23 if (p.hasKey("CODCOM")) { 24 p.put("type", "boundary"); 25 p.put("boundary", "administrative"); 26 p.put("admin_level", "8"); 27 replace(p, "COMMUNE", "name"); 28 p.remove("COMMUNE_2"); 29 replace(p, "ID", "ref:INSEE"); 30 p.remove("CODCOM"); 31 } 32 } 33 } 34 34 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/ConseilsQuartiersHandler.java
r30340 r30731 6 6 public class ConseilsQuartiersHandler extends LeMansDataSetHandler { 7 7 8 9 10 11 12 8 public ConseilsQuartiersHandler() { 9 super("F7713FAB-550EA533-37695DD8-A9755461"); 10 setName("Conseils de quartiers"); 11 setKmzShpUuid("644BD601-550EA533-7E7BB44A-0B649A3D", "644C87D8-550EA533-7E7BB44A-6284E60D"); 12 } 13 13 14 15 16 17 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsKmzShpFilename(filename, "CONSEILS_DE_QUARTIER") || acceptsZipFilename(filename, "Les conseils de quartiers .*"); 17 } 18 18 19 20 21 22 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/LeMansDataSetHandler.java
r30701 r30731 14 14 15 15 public abstract class LeMansDataSetHandler extends FrenchDataSetHandler implements LeMansConstants { 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 16 17 private String kmzUuid; 18 private String shpUuid; 19 20 public LeMansDataSetHandler(String uuid) { 21 init(uuid); 22 } 23 24 public LeMansDataSetHandler(String uuid, String relevantTag) { 25 super(relevantTag); 26 init(uuid); 27 } 28 29 public LeMansDataSetHandler(String uuid, boolean relevantUnion, String ... relevantTags) { 30 super(relevantUnion, relevantTags); 31 init(uuid); 32 } 33 33 34 35 36 34 public LeMansDataSetHandler(String uuid, String ... relevantTags) { 35 this(uuid, false, relevantTags); 36 } 37 37 38 39 40 41 42 38 39 public LeMansDataSetHandler(String uuid, boolean relevantUnion, Tag ... relevantTags) { 40 super(relevantUnion, relevantTags); 41 init(uuid); 42 } 43 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 44 private final void init(String uuid) { 45 try { 46 setLicense(License.ODbL); 47 if (uuid != null && !uuid.isEmpty()) { 48 setLocalPortalURL(PORTAL + "page.do?t=2&uuid=" + uuid); 49 } 50 } catch (MalformedURLException e) { 51 e.printStackTrace(); 52 } 53 } 54 55 protected final void setKmzShpUuid(String kmzUuid, String shpUuid) { 56 this.kmzUuid = kmzUuid; 57 this.shpUuid = shpUuid; 58 } 59 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 60 @Override 61 public String getSource() { 62 return SOURCE_LE_MANS; 63 } 64 65 /*@Override 66 public URL getLicenseURL() { 67 try { 68 return new URL(PORTAL + "download.do?uuid=3E907F53-550EA533-5AE8381B-44AE9F93"); 69 } catch (MalformedURLException e) { 70 e.printStackTrace(); 71 } 72 return null; 73 }*/ 74 74 75 76 77 78 79 80 81 82 83 84 85 75 @Override 76 public List<Pair<String, URL>> getDataURLs() { 77 List<Pair<String, URL>> result = new ArrayList<>(); 78 try { 79 if (kmzUuid != null && !kmzUuid.isEmpty()) result.add(new Pair<>(getName() + " (KMZ)", new URL(PORTAL + "download.do?uuid=" + kmzUuid))); 80 if (shpUuid != null && !shpUuid.isEmpty()) result.add(new Pair<>(getName() + " (SHP)", new URL(PORTAL + "download.do?uuid=" + shpUuid))); 81 } catch (MalformedURLException e) { 82 e.printStackTrace(); 83 } 84 return result; 85 } 86 86 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/PointsApportVolontaireHandler.java
r30340 r30731 6 6 public class PointsApportVolontaireHandler extends LeMansDataSetHandler { 7 7 8 9 10 11 12 8 public PointsApportVolontaireHandler() { 9 super("F8213494-550EA533-37695DD8-28F0B08D"); 10 setName("Points d'apport volontaire"); 11 setKmzShpUuid("66972849-550EA533-7E7BB44A-7AB7F366", "66977265-550EA533-7E7BB44A-1859F0AC"); 12 } 13 13 14 15 16 17 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsKmzShpFilename(filename, "Points d'Apports Volontaires") || acceptsZipFilename(filename, "Les points dapport volontaire .*"); 17 } 18 18 19 20 21 22 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 } -
applications/editors/josm/plugins/opendata/modules/fr.lemans/src/org/openstreetmap/josm/plugins/opendata/modules/fr/lemans/datasets/ServicesCommunautairesMunicipauxHandler.java
r30340 r30731 7 7 public class ServicesCommunautairesMunicipauxHandler extends LeMansDataSetHandler { 8 8 9 10 11 12 13 9 public ServicesCommunautairesMunicipauxHandler() { 10 super("F7F65F15-550EA533-37695DD8-F7A74F05"); 11 setName("Services communautaires et municipaux"); 12 setKmzShpUuid("66C925DA-550EA533-7E7BB44A-BCF0B629", "66C972AD-550EA533-7E7BB44A-E842FFAD"); 13 } 14 14 15 16 17 18 15 @Override 16 public boolean acceptsFilename(String filename) { 17 return acceptsKmzShpFilename(filename, "SERVICES_VDM_LMM") || acceptsZipFilename(filename, "Les services de le Mans Métropole et de la Ville du Mans .*"); 18 } 19 19 20 21 22 23 24 25 20 @Override 21 public void updateDataSet(DataSet ds) { 22 for (Node n : ds.getNodes()) { 23 replace(n, "NOM", "name"); 24 } 25 } 26 26 } -
applications/editors/josm/plugins/opendata/modules/fr.paca/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/fr.paris/build.xml
r30416 r30731 16 16 <property name="module.dist.dir" value="../../dist"/> 17 17 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 18 18 <!-- conditions --> 19 19 <condition property="resources.exist"> 20 20 <available file="resources" type="dir" /> … … 96 96 <attribute name="Module-Date" value="${version.entry.commit.date}"/> 97 97 <attribute name="Module-Description" value="Paris"/> 98 98 <attribute name="Module-Icon" value="images/data.fr.paris_24.png"/> 99 99 <!--<attribute name="Module-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/OpenData/Paris"/>--> 100 100 <attribute name="Module-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/ParisConstants.java
r30563 r30731 4 4 5 5 public interface ParisConstants { 6 7 8 9 10 11 12 13 14 15 6 7 /** 8 * Source 9 */ 10 public static final String SOURCE = "opendataparis"; 11 12 /** 13 * Portal 14 */ 15 public static final String PORTAL = "http://opendata.paris.fr/opendata/"; 16 16 17 18 19 20 17 /** 18 * Icons 19 */ 20 public static final String ICON_PARIS_24 = "data.fr.paris_24.png"; 21 21 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/ParisLicense.java
r30340 r30731 6 6 public class ParisLicense extends ODbL { 7 7 8 9 10 11 12 13 14 15 8 public ParisLicense() { 9 // TODO: Paris license 10 /*try { 11 setURL(PORTAL + "/la-licence", "fr"); 12 } catch (MalformedURLException e) { 13 e.printStackTrace(); 14 }*/ 15 } 16 16 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/ParisModule.java
r30340 r30731 11 11 public class ParisModule extends AbstractModule { 12 12 13 14 13 public ParisModule(ModuleInformation info) { 14 super(info); 15 15 handlers.add(SanisettesHandler.class); 16 16 handlers.add(ArbresRemarquablesHandler.class); -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/ParisDataSetHandler.java
r30340 r30731 11 11 12 12 public abstract class ParisDataSetHandler extends FrenchDataSetHandler implements ParisConstants { 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 13 14 private int documentId; 15 private static final int portletId = 106; // FIXME 16 17 public ParisDataSetHandler(int documentId) { 18 init(documentId); 19 } 20 21 public ParisDataSetHandler(int documentId, String relevantTag) { 22 super(relevantTag); 23 init(documentId); 24 } 25 26 public ParisDataSetHandler(int documentId, boolean relevantUnion, String ... relevantTags) { 27 super(relevantUnion, relevantTags); 28 init(documentId); 29 } 30 30 31 32 33 31 public ParisDataSetHandler(int documentId, String ... relevantTags) { 32 this(documentId, false, relevantTags); 33 } 34 34 35 36 37 38 35 public ParisDataSetHandler(int documentId, boolean relevantUnion, Tag ... relevantTags) { 36 super(relevantUnion, relevantTags); 37 init(documentId); 38 } 39 39 40 41 42 43 44 45 46 47 48 49 50 40 private final void init(int documentId) { 41 this.documentId = documentId; 42 setLicense(new ParisLicense()); 43 try { 44 if (documentId > 0) { 45 setLocalPortalURL(PORTAL + "jsp/site/Portal.jsp?document_id="+documentId + "&portlet_id="+portletId); 46 } 47 } catch (MalformedURLException e) { 48 e.printStackTrace(); 49 } 50 } 51 51 52 53 54 55 52 @Override 53 public String getSource() { 54 return SOURCE; 55 } 56 56 57 58 59 60 61 62 57 @Override 58 public String getLocalPortalIconName() { 59 return ICON_PARIS_24; 60 } 61 62 protected abstract String getDirectLink(); 63 63 64 65 66 67 68 69 70 71 72 73 74 64 @Override 65 public URL getDataURL() { 66 try { 67 if (documentId > 0) { 68 return new URL(PORTAL + "rating/download/?id_resource="+documentId + "&type_resource=document&url="+getDirectLink()); 69 } 70 } catch (MalformedURLException e) { 71 e.printStackTrace(); 72 } 73 return null; 74 } 75 75 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/ParisShpHandler.java
r30563 r30731 18 18 19 19 public class ParisShpHandler extends FrenchShpHandler { 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 20 21 public final Map<String, Node> nodeMap = new HashMap<>(); 22 23 protected OsmPrimitive dataPrimitive; 24 protected Way closedWay; 25 protected List<Way> ways; 26 public List<Node> nodes; 27 28 public ParisShpHandler() { 29 setDbfCharset(Charset.forName(OdConstants.CP850)); 30 } 31 32 private Node getNode(EastNorth en, String key) { 33 Node n = nodeMap.get(key); 34 /*if (n == null) { 35 for (Node node : nodes.values()) { 36 if (node.getEastNorth().equalsEpsilon(en, 0.0000001)) { 37 return node; 38 } 39 } 40 }*/ 41 return n; 42 } 43 44 protected Node createOrGetNode(DataSet ds, EastNorth en) { 45 String key = en.getX()+"/"+en.getY(); 46 Node n = getNode(en, key); 47 if (n == null) { 48 n = new Node(en); 49 nodeMap.put(key, n); 50 ds.addPrimitive(n); 51 } 52 return n; 53 } 54 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 55 protected final void initFeaturesPrimitives(Set<OsmPrimitive> featurePrimitives) { 56 dataPrimitive = null; 57 closedWay = null; 58 ways = new ArrayList<>(); 59 nodes = new ArrayList<>(); 60 for (OsmPrimitive p : featurePrimitives) { 61 if (p.hasKeys()) { 62 dataPrimitive = p; 63 } 64 if (p instanceof Way) { 65 Way w = (Way) p; 66 ways.add(w); 67 if (w.isClosed()) { 68 closedWay = w; 69 } 70 } else if (p instanceof Node) { 71 nodes.add((Node) p); 72 } 73 } 74 } 75 76 protected final void removePrimitives(DataSet result) { 77 for (Way w : ways) { 78 w.setNodes(null); 79 result.removePrimitive(w); 80 } 81 for (Node n : nodes) { 82 result.removePrimitive(n); 83 } 84 } 85 85 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/deplacements/ElectriciteHandler.java
r30340 r30731 7 7 public class ElectriciteHandler extends ParisDataSetHandler { 8 8 9 10 11 12 9 public ElectriciteHandler() { 10 super(95); 11 setName("Électricité"); 12 } 13 13 14 15 16 17 18 19 20 21 22 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsShpFilename(filename, "electricite") || acceptsZipFilename(filename, "electricite"); 17 } 18 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 24 25 26 27 24 @Override 25 protected String getDirectLink() { 26 return PORTAL+"hn/electricite.zip"; 27 } 28 28 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/environnement/ArbresRemarquablesHandler.java
r30340 r30731 8 8 public class ArbresRemarquablesHandler extends ParisDataSetHandler { 9 9 10 11 12 13 10 public ArbresRemarquablesHandler() { 11 super(107); 12 setName("Arbres remarquables"); 13 } 14 14 15 16 17 18 19 20 21 22 23 24 25 26 15 @Override 16 public boolean acceptsFilename(String filename) { 17 return acceptsShpFilename(filename, "arbres_remarquables") || acceptsZipFilename(filename, "arbres_remarquables_20.."); 18 } 19 20 @Override 21 public void updateDataSet(DataSet ds) { 22 for (Node n : ds.getNodes()) { 23 n.put("natural", "tree"); 24 replace(n, "ANNEE__PLA", "start_date"); 25 } 26 } 27 27 28 29 30 31 28 @Override 29 protected String getDirectLink() { 30 return PORTAL+"hn/arbres_remarquables_2011.zip"; 31 } 32 32 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/environnement/MobilierVoiePubliqueHandler.java
r30340 r30731 14 14 public class MobilierVoiePubliqueHandler extends ParisDataSetHandler { 15 15 16 17 18 19 20 21 22 16 private final InternalShpHandler shpHandler = new InternalShpHandler(); 17 18 public MobilierVoiePubliqueHandler() { 19 super(96); 20 setName("Mobiliers sur voie publique"); 21 setShpHandler(shpHandler); 22 } 23 23 24 25 26 27 24 @Override 25 public boolean acceptsFilename(String filename) { 26 return acceptsShpFilename(filename, "environnement") || acceptsZipFilename(filename, "environnement"); 27 } 28 28 29 30 31 32 33 34 35 36 public void notifyFeatureParsed(Object feature, DataSet result,Set<OsmPrimitive> featurePrimitives) {37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 29 @Override 30 protected String getDirectLink() { 31 return PORTAL+"hn/environnement.zip"; 32 } 33 34 private final class InternalShpHandler extends ParisShpHandler { 35 @Override 36 public void notifyFeatureParsed(Object feature, DataSet result, Set<OsmPrimitive> featurePrimitives) { 37 initFeaturesPrimitives(featurePrimitives); 38 String type = dataPrimitive.get("Libelle"); 39 if (type.startsWith("Banc ")) { 40 if (closedWay == null && dataPrimitive instanceof Way && ((Way)dataPrimitive).getNodesCount() > 3) { 41 // Some benches can be converted to closed ways by removing some extra nodes at the beginning 42 Way copy = new Way((Way) dataPrimitive); 43 while (copy.getNodesCount() > 3 && !copy.isClosed()) { 44 copy.removeNode(copy.getNode(0)); 45 } 46 if (copy.isClosed()) { 47 closedWay = copy; 48 } else { 49 // Try in the opposite direction (remove nodes from the end) 50 copy = new Way((Way) dataPrimitive); 51 while (copy.getNodesCount() > 3 && !copy.isClosed()) { 52 copy.removeNode(copy.getNode(copy.getNodesCount()-1)); 53 } 54 if (copy.isClosed()) { 55 closedWay = copy; 56 } 57 } 58 } 59 if (closedWay != null) { 60 Node bench = createOrGetNode(result, Geometry.getCentroid(closedWay.getNodes())); 61 bench.put("amenity", "bench"); 62 bench.put("description", type); 63 removePrimitives(result); 64 } else { 65 System.err.println("Bench without closed area: "+type); 66 } 67 } else if (type.startsWith("Poubelle") || type.startsWith("Borne de propreté")) { 68 if (closedWay != null) { 69 Node basket = createOrGetNode(result, Geometry.getCentroid(closedWay.getNodes())); 70 basket.put("amenity", "waste_basket"); 71 basket.put("description", type); 72 removePrimitives(result); 73 } else { 74 System.err.println("Waste basket without closed area: "+type); 75 } 76 } else if (type.startsWith("Bac à sable")) { 77 if (closedWay == null && dataPrimitive instanceof Way && ((Way)dataPrimitive).getNodesCount() == 2) { 78 // Sandpits are badly built, fix them 79 closedWay = (Way) dataPrimitive; 80 for (Way w : ways) { 81 if (w.getNodesCount() == 4) { 82 Node n1 = w.getNode(1); 83 Node n2 = w.getNode(2); 84 if (closedWay.getNode(1).getCoor().distance(n1.getCoor()) < closedWay.getNode(1).getCoor().distance(n2.getCoor())) { 85 closedWay.addNode(n1); 86 closedWay.addNode(n2); 87 } else { 88 closedWay.addNode(n2); 89 closedWay.addNode(n1); 90 } 91 closedWay.addNode(closedWay.getNode(0)); 92 break; 93 } 94 } 95 } 96 if (closedWay != null) { 97 // FIXME: lines commented as "sandpits" in this data set seem to be false data 98 /*Node pg = createOrGetNode(result, Geometry.getCentroid(closedWay.getNodes())); 99 pg.put("leisure", "playground"); 100 pg.put("playground", "sandpit"); 101 pg.put("description", type);*/ 102 removePrimitives(result); 103 } else { 104 System.err.println("Sandpit without closed area: "+type); 105 } 106 } else if (type.startsWith("Corbeille florale")) { 107 if (closedWay != null) { 108 Node n = createOrGetNode(result, Geometry.getCentroid(closedWay.getNodes())); 109 n.put("man_made", "floral_basket"); 110 n.put("description", type); 111 removePrimitives(result); 112 } else { 113 System.err.println("Floral basket without closed area: "+type); 114 } 115 } else if (type.startsWith("Objet sans identification particulière")) { 116 //dataPrimitive.put("FIXME", "unknown object. DO NOT upload as it !"); 117 removePrimitives(result); 118 } else { 119 System.err.println("Unsupported object type: "+type); 120 } 121 } 122 } 123 124 @Override 125 public void updateDataSet(DataSet ds) { 126 // Done in notifyFeatureParsed() for drastic performance reasons 127 shpHandler.nodes.clear(); 128 } 129 129 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/EclairagePublicHandler.java
r30340 r30731 13 13 public class EclairagePublicHandler extends ParisDataSetHandler { 14 14 15 16 17 18 19 20 21 15 private final InternalShpHandler shpHandler = new InternalShpHandler(); 16 17 public EclairagePublicHandler() { 18 super(94); 19 setName("Éclairage public"); 20 setShpHandler(shpHandler); 21 } 22 22 23 24 25 26 23 @Override 24 public boolean acceptsFilename(String filename) { 25 return acceptsShpFilename(filename, "eclairage_public") || acceptsZipFilename(filename, "eclairage_public"); 26 } 27 27 28 29 30 31 32 33 34 35 36 public void notifyFeatureParsed(Object feature, DataSet result,Set<OsmPrimitive> featurePrimitives) {37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 } else if (dataPrimitive.get("Info").equals("LEA")) { //LEA;Lanterne électrique axiale;2834;eclairage_public.zip;Niveau 1868 } else if (dataPrimitive.get("Info").equals("LEL")) { //LEL;Lampadaire électrique;61337;eclairage_public.zip;Niveau 1869 } else if (dataPrimitive.get("Info").equals("LEM")) { //LEM;Lanterne électrique murale;789;eclairage_public.zip;Niveau 1870 } else if (dataPrimitive.get("Info").equals("LEMB")) { //LEMB;Lanterne électrique murale bord;14727;eclairage_public.zip;Niveau 1871 } else if (dataPrimitive.get("Info").equals("LEMRND")) { //LEMRND;Lanterne électrique murale renvoi à droite;5635;eclairage_public.zip;Niveau 1872 } else if (dataPrimitive.get("Info").equals("LEMRNG")) { //LEMRNG;Lanterne électrique murale renvoi à gauche;3822;eclairage_public.zip;Niveau 1873 } else if (dataPrimitive.get("Info").equals("LERRND")) { //LERRND;Lanterne électrique murale et boite raccord BT renvoi à droite;5657;eclairage_public.zip;Niveau 1874 } else if (dataPrimitive.get("Info").equals("LERRNG")) { //LERRNG;Lanterne électrique murale et boite raccord BT renvoi à gauche;3377;eclairage_public.zip;Niveau 1875 } else if (dataPrimitive.get("Info").equals("LSO")) { //LSO;Lanterne au sol;1337;eclairage_public.zip;Niveau 1876 } else if (dataPrimitive.get("Info").equals("PHO")) { //PHO;Poteau horaire;17;eclairage_public.zip;Niveau 1877 } else if (dataPrimitive.get("Info").equals("PPEP")) { //PPEP;Poteau provisoire d'éclairage public;181;eclairage_public.zip;Niveau 1878 } else if (dataPrimitive.get("Info").equals("PPR")) { //PPR;poteau à projecteur;67;eclairage_public.zip;Niveau 1879 } else if (dataPrimitive.get("Info").equals("PRJ")) { //PRJ;Projecteur au sol ou mural;1864;eclairage_public.zip;Niveau 1880 } else if (dataPrimitive.get("Info").equals("PRJRND")) { //PRJRND;Projecteur au sol ou mural renvoi à droite;42;eclairage_public.zip;Niveau 1881 } else if (dataPrimitive.get("Info").equals("PRJRNG")) { //PRJRNG;Projecteur au sol ou mural renvoi à gauche;57;eclairage_public.zip;Niveau 1882 83 84 85 86 87 88 89 90 91 92 93 28 @Override 29 protected String getDirectLink() { 30 return PORTAL+"hn/eclairage_public.zip"; 31 } 32 33 private final class InternalShpHandler extends ParisShpHandler { 34 35 @Override 36 public void notifyFeatureParsed(Object feature, DataSet result, Set<OsmPrimitive> featurePrimitives) { 37 initFeaturesPrimitives(featurePrimitives); 38 if (dataPrimitive == null) { 39 System.err.println("Found no primitive with tags"); 40 } else if (closedWay == null) { 41 // ;Objet sans identification particulière pour ce niveau et cette thématique;147;eclairage_public.zip;Niveau 18 42 dataPrimitive.put("FIXME", "This way is not closed and has not been recognized as highway=street_lamp."); 43 } else { 44 Node centroid = createOrGetNode(result, Geometry.getCentroid(closedWay.getNodes())); 45 if (!centroid.hasKeys()) { 46 centroid.setKeys(dataPrimitive.getKeys()); 47 centroid.put("highway", "street_lamp"); 48 replace(centroid, "Libelle", "lamp_model:fr"); 49 } else if (centroid.get("lamp_model:fr") != null && (dataPrimitive.get("Libelle") == null || !dataPrimitive.get("Libelle").equals(centroid.get("lamp_model:fr")))) { 50 System.err.println("Found 2 street lamps at the same position with different types: '"+centroid.get("lamp_model:fr")+"' and '"+dataPrimitive.get("Libelle")+"'."); 51 } 52 removePrimitives(result); 53 54 if (centroid.get("lamp_model:fr") != null) { 55 if (centroid.get("lamp_model:fr").contains("mural") && !centroid.get("lamp_model:fr").contains("au sol")) { 56 centroid.put("lamp_mount", "wall mounted"); 57 } else if (centroid.get("lamp_model:fr").contains("au sol") && !centroid.get("lamp_model:fr").contains("mural")) { 58 centroid.put("lamp_mount", "ground"); 59 } else { 60 centroid.put("lamp_mount", "pole"); 61 } 62 centroid.remove("Info"); 63 } 64 65 /*if (dataPrimitive.get("Info") == null) { 66 System.err.println("Found no primitive with tag 'Info'"); 67 } else if (dataPrimitive.get("Info").equals("LEA")) { // LEA;Lanterne électrique axiale;2834;eclairage_public.zip;Niveau 18 68 } else if (dataPrimitive.get("Info").equals("LEL")) { // LEL;Lampadaire électrique;61337;eclairage_public.zip;Niveau 18 69 } else if (dataPrimitive.get("Info").equals("LEM")) { // LEM;Lanterne électrique murale;789;eclairage_public.zip;Niveau 18 70 } else if (dataPrimitive.get("Info").equals("LEMB")) { // LEMB;Lanterne électrique murale bord;14727;eclairage_public.zip;Niveau 18 71 } else if (dataPrimitive.get("Info").equals("LEMRND")) { // LEMRND;Lanterne électrique murale renvoi à droite;5635;eclairage_public.zip;Niveau 18 72 } else if (dataPrimitive.get("Info").equals("LEMRNG")) { // LEMRNG;Lanterne électrique murale renvoi à gauche;3822;eclairage_public.zip;Niveau 18 73 } else if (dataPrimitive.get("Info").equals("LERRND")) { // LERRND;Lanterne électrique murale et boite raccord BT renvoi à droite;5657;eclairage_public.zip;Niveau 18 74 } else if (dataPrimitive.get("Info").equals("LERRNG")) { // LERRNG;Lanterne électrique murale et boite raccord BT renvoi à gauche;3377;eclairage_public.zip;Niveau 18 75 } else if (dataPrimitive.get("Info").equals("LSO")) { // LSO;Lanterne au sol;1337;eclairage_public.zip;Niveau 18 76 } else if (dataPrimitive.get("Info").equals("PHO")) { // PHO;Poteau horaire;17;eclairage_public.zip;Niveau 18 77 } else if (dataPrimitive.get("Info").equals("PPEP")) { // PPEP;Poteau provisoire d'éclairage public;181;eclairage_public.zip;Niveau 18 78 } else if (dataPrimitive.get("Info").equals("PPR")) { // PPR;poteau à projecteur;67;eclairage_public.zip;Niveau 18 79 } else if (dataPrimitive.get("Info").equals("PRJ")) { // PRJ;Projecteur au sol ou mural;1864;eclairage_public.zip;Niveau 18 80 } else if (dataPrimitive.get("Info").equals("PRJRND")) { // PRJRND;Projecteur au sol ou mural renvoi à droite;42;eclairage_public.zip;Niveau 18 81 } else if (dataPrimitive.get("Info").equals("PRJRNG")) { // PRJRNG;Projecteur au sol ou mural renvoi à gauche;57;eclairage_public.zip;Niveau 18 82 } else { 83 System.err.println("Unsupported Info: "+dataPrimitive.get("Info")); 84 }*/ 85 } 86 } 87 } 88 89 @Override 90 public void updateDataSet(DataSet ds) { 91 // Done in notifyFeatureParsed() for drastic performance reasons 92 shpHandler.nodes.clear(); 93 } 94 94 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/SanisettesHandler.java
r30701 r30731 15 15 public class SanisettesHandler extends ParisDataSetHandler { 16 16 17 18 19 20 21 17 public SanisettesHandler() { 18 super(93); 19 setName("Sanisettes"); 20 getShpHandler().setCheckNodeProximity(true); 21 } 22 22 23 24 25 26 23 @Override 24 public boolean acceptsFilename(String filename) { 25 return acceptsShpFilename(filename, "sanisettes") || acceptsZipFilename(filename, "sanisettes"); 26 } 27 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 28 private boolean wayBelongsTo(Way a, List<Way> ways) { 29 for (Way b : ways) { 30 if (a.getNode(0).equals(b.getNode(0)) || a.getNode(0).equals(b.getNode(b.getNodesCount()-1)) 31 || a.getNode(a.getNodesCount()-1).equals(b.getNode(0)) || a.getNode(a.getNodesCount()-1).equals(b.getNode(b.getNodesCount()-1))) { 32 return true; 33 } 34 } 35 return false; 36 } 37 38 private boolean wayProcessed(Way a, List<List<Way>> waysToCombine) { 39 for (List<Way> ways : waysToCombine) { 40 for (Way b : ways) { 41 if (a.equals(b)) { 42 return true; 43 } 44 } 45 } 46 return false; 47 } 48 49 @Override 50 public void updateDataSet(DataSet ds) { 51 52 List<Way> sourceWays = new ArrayList<>(ds.getWays()); 53 List<List<Way>> waysToCombine = new ArrayList<>(); 54 55 for (Iterator<Way> it = sourceWays.iterator(); it.hasNext();) { 56 Way w = it.next(); 57 it.remove(); 58 if (!wayProcessed(w, waysToCombine)) { 59 List<Way> list = new ArrayList<>(); 60 list.add(w); 61 boolean finished = false; 62 List<Way> sourceWays2 = new ArrayList<>(sourceWays); 63 while (!finished) { 64 int before = list.size(); 65 for (Iterator<Way> it2 = sourceWays2.iterator(); it2.hasNext();) { 66 Way w2 = it2.next(); 67 if (wayBelongsTo(w2, list)) { 68 list.add(w2); 69 it2.remove(); 70 } 71 } 72 int after = list.size(); 73 finished = (after == before); 74 } 75 if (list.size() > 1) { 76 waysToCombine.add(list); 77 } 78 } 79 } 80 81 for (List<Way> ways : waysToCombine) { 82 try { 83 WayCombiner.combineWays(ways); 84 } catch (UserCancelException e) { 85 return; 86 } 87 } 88 89 for (Way w : ds.getWays()) { 90 if (w.getNodesCount() <= 3) { 91 ds.removePrimitive(w); 92 for (Node n : w.getNodes()) { 93 ds.removePrimitive(n); 94 } 95 } else { 96 w.put("amenity", "toilets"); 97 } 98 } 99 } 100 100 101 102 103 104 101 @Override 102 protected String getDirectLink() { 103 return PORTAL+"hn/sanisettes.zip"; 104 } 105 105 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/VolumesBatisHandler.java
r30340 r30731 7 7 public class VolumesBatisHandler extends ParisDataSetHandler { 8 8 9 10 11 12 9 public VolumesBatisHandler() { 10 super(80); 11 setName("Volumes bâtis"); 12 } 13 13 14 15 16 17 18 19 20 21 22 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsShpFilename(filename, "VOL_BATI") || acceptsZipFilename(filename, "VOL_BATI"); 17 } 18 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 24 25 26 27 24 @Override 25 protected String getDirectLink() { 26 return PORTAL+"hn/VOL_BATI.zip"; 27 } 28 28 } -
applications/editors/josm/plugins/opendata/modules/fr.paris/src/org/openstreetmap/josm/plugins/opendata/modules/fr/paris/datasets/urbanisme/VolumesNonBatisHandler.java
r30340 r30731 7 7 public class VolumesNonBatisHandler extends ParisDataSetHandler { 8 8 9 10 11 12 9 public VolumesNonBatisHandler() { 10 super(106); 11 setName("Volumes non bâtis"); 12 } 13 13 14 15 16 17 18 19 20 21 22 14 @Override 15 public boolean acceptsFilename(String filename) { 16 return acceptsShpFilename(filename, "VOL_NBATI") || acceptsZipFilename(filename, "VOL_NBATI"); 17 } 18 19 @Override 20 public void updateDataSet(DataSet ds) { 21 // TODO 22 } 23 23 24 25 26 27 24 @Override 25 protected String getDirectLink() { 26 return PORTAL+"hn/VOL_NBATI.zip"; 27 } 28 28 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/build.xml
r30416 r30731 14 14 <property name="module.dist.dir" value="../../dist"/> 15 15 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 16 16 <!-- conditions --> 17 17 <condition property="resources.exist"> 18 18 <available file="resources" type="dir" /> -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/SncfConstants.java
r30340 r30731 5 5 6 6 public interface SncfConstants extends FrenchConstants { 7 8 9 10 11 12 13 14 15 16 7 8 /** 9 * Source 10 */ 11 public static final String SOURCE = "SNCF"; 12 13 /** 14 * Portal 15 */ 16 public static final String PORTAL = "http://opendata-test.tumblr.com/"; 17 17 18 19 20 21 22 18 /** 19 * Icons 20 */ 21 public static final String ICON_16 = "data.fr.sncf_16.png"; 22 public static final String ICON_24 = "data.fr.sncf_24.png"; 23 23 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/SncfLicense.java
r30340 r30731 8 8 public class SncfLicense extends License { 9 9 10 11 12 13 14 15 16 10 public SncfLicense() { 11 try { 12 setURL("http://test.data-sncf.com/licence", "fr"); 13 } catch (MalformedURLException e) { 14 e.printStackTrace(); 15 } 16 } 17 17 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/SncfModule.java
r30340 r30731 8 8 public class SncfModule extends AbstractModule { 9 9 10 11 12 10 public SncfModule(ModuleInformation info) { 11 super(info); 12 handlers.add(EquipementsHandler.class); 13 13 } 14 14 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/datasets/EquipementsHandler.java
r30340 r30731 9 9 public class EquipementsHandler extends SncfDataSetHandler { 10 10 11 12 13 14 15 16 17 18 19 20 21 22 23 11 private class LambertIICsvHandler extends InternalCsvHandler { 12 @Override 13 public LatLon getCoor(EastNorth en, String[] fields) { 14 // Lambert II coordinates offset by 2000000 (see https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert#Projections_officielles_en_France_métropolitaine) 15 return super.getCoor(new EastNorth(en.getX(), en.getY()-2000000), fields); 16 } 17 } 18 19 public EquipementsHandler() { 20 super("equipementsgares"); 21 setCsvHandler(new LambertIICsvHandler()); 22 setSingleProjection(lambert4Zones[1]); // Lambert II 23 } 24 24 25 26 27 28 25 @Override 26 public boolean acceptsFilename(String filename) { 27 return acceptsCsvXlsFilename(filename, "gare_20......"); 28 } 29 29 30 31 32 33 34 35 36 30 @Override 31 public void updateDataSet(DataSet ds) { 32 for (Node n : ds.getNodes()) { 33 replace(n, "nom gare", "name"); 34 n.put("railway", "station"); 35 } 36 } 37 37 } -
applications/editors/josm/plugins/opendata/modules/fr.sncf/src/org/openstreetmap/josm/plugins/opendata/modules/fr/sncf/datasets/SncfDataSetHandler.java
r30340 r30731 10 10 11 11 public abstract class SncfDataSetHandler extends FrenchDataSetHandler implements SncfConstants { 12 13 14 15 16 17 18 19 20 21 22 23 24 25 12 13 public SncfDataSetHandler(String portalId) { 14 init(portalId); 15 } 16 17 public SncfDataSetHandler(String portalId, String relevantTag) { 18 super(relevantTag); 19 init(portalId); 20 } 21 22 public SncfDataSetHandler(String portalId, boolean relevantUnion, String ... relevantTags) { 23 super(relevantUnion, relevantTags); 24 init(portalId); 25 } 26 26 27 28 29 30 31 32 33 34 27 public SncfDataSetHandler(String portalId, String ... relevantTags) { 28 this(portalId, false, relevantTags); 29 } 30 31 public SncfDataSetHandler(String portalId, boolean relevantUnion, Tag ... relevantTags) { 32 super(relevantUnion, relevantTags); 33 init(portalId); 34 } 35 35 36 37 38 39 40 41 42 43 44 45 36 private final void init(String portalId) { 37 setLicense(new SncfLicense()); 38 if (portalId != null && !portalId.isEmpty()) { 39 try { 40 setLocalPortalURL(PORTAL + portalId); 41 } catch (MalformedURLException e) { 42 e.printStackTrace(); 43 } 44 } 45 } 46 46 47 48 49 50 47 @Override 48 public String getSource() { 49 return SOURCE; 50 } 51 51 52 53 54 55 52 @Override 53 public String getLocalPortalIconName() { 54 return ICON_24; 55 } 56 56 57 58 59 60 57 @Override 58 public String getDataLayerIconName() { 59 return ICON_16; 60 } 61 61 } -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/build.xml
r30416 r30731 15 15 <property name="module.dist.dir" value="../../dist"/> 16 16 <property name="module.jar" value="${module.dist.dir}/${ant.project.name}.jar"/> 17 17 <!-- conditions --> 18 18 <condition property="resources.exist"> 19 19 <available file="resources" type="dir" /> … … 42 42 <pathelement location="${josm}"/> 43 43 <pathelement location="${opendata}"/> 44 44 <pathelement location="${utilsplugin2}"/> 45 45 </classpath> 46 46 <compilerarg value="-Xlint:deprecation"/> -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/resources/neptune_toulouse/acsb/acsb_passengerMobility-v0.3.xsd
r28018 r30731 2 2 <!-- edited with XMLSpy v2008 (http://www.altova.com) by Nicholas Knowles Knowles (Kizoom Ltd) --> 3 3 <xsd:schema 4 5 6 7 8 4 xmlns="http://www.ifopt.org.uk/acsb" 5 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 6 targetNamespace="http://www.ifopt.org.uk/acsb" 7 elementFormDefault="qualified" 8 attributeFormDefault="unqualified" version="0.3" id="passengerMobility"> 9 9 <xsd:annotation> 10 10 <xsd:appinfo> -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/resources/neptune_toulouse/neptune.xsd
r28018 r30731 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <!-- ========================================================================== 3 <!-- 4 <!-- CERTU 5 <!-- 6 <!-- projet chouette : Schema XSD 7 <!-- 8 <!-- neptune.xsd : Description XML du profil NEPTUNE 9 <!-- 10 <!-- Version : $Revision: 1.7 $ 11 <!-- 12 <!-- ========================================================================== 2 <!-- ========================================================================== --> 3 <!-- --> 4 <!-- CERTU --> 5 <!-- --> 6 <!-- projet chouette : Schema XSD --> 7 <!-- --> 8 <!-- neptune.xsd : Description XML du profil NEPTUNE --> 9 <!-- --> 10 <!-- Version : $Revision: 1.7 $ --> 11 <!-- --> 12 <!-- ========================================================================== --> 13 13 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 14 14 xmlns="http://www.trident.org/schema/trident" … … 19 19 elementFormDefault="qualified" version="1.00"> 20 20 21 22 21 <xsd:annotation> 22 <xsd:documentation xml:lang="en"> 23 23 TRIDENT exchange schema. 24 24 Request / Answer schema 25 25 Copyright (c) 2001 TRIDENT consortium, All Rights Reserved. 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 26 </xsd:documentation> 27 </xsd:annotation> 28 <!--.....Dépendance sur SIRI pour les équipements...--> 29 <xsd:import namespace="http://www.ifopt.org.uk/acsb" 30 schemaLocation="./acsb/acsb_passengerMobility-v0.3.xsd"/> 31 <xsd:import namespace="http://www.siri.org.uk/siri" 32 schemaLocation="./siri/siri_facilities-v1.2.xsd"/> 33 <!--.....Inclusion des éléments TRIDENT nécessaires...--> 34 35 <xsd:include schemaLocation="./trident/trident_Global_schema.xsd"/> 36 <xsd:include schemaLocation="./trident/trident_Location_schema.xsd"/> 37 <xsd:include schemaLocation="./trident/trident_PT_schema.xsd"/> 38 <!-- **************************************************************** --> 39 <xsd:complexType name="ITLType"> 40 <xsd:annotation> 41 <xsd:documentation>Interdiction de trafic local</xsd:documentation> 42 </xsd:annotation> 43 <xsd:sequence> 44 <xsd:element name="areaId" type="TridentIdType"/> 45 <xsd:element name="lineIdShortCut" type="TridentIdType" minOccurs="0"/> 46 <xsd:element name="name" type="xsd:string"/> 47 </xsd:sequence> 48 </xsd:complexType> 49 <xsd:complexType name="TimeSlotType"> 50 <xsd:annotation> 51 <xsd:documentation>Type pour les fréquences horaire</xsd:documentation> 52 </xsd:annotation> 53 <xsd:complexContent> 54 <xsd:extension base="trd:TridentObjectType"> 55 <xsd:sequence> 56 <xsd:element name="beginningSlotTime" type="xsd:time"/> 57 <xsd:element name="endSlotTime" type="xsd:time"/> 58 <xsd:element name="firstDepartureTimeInSlot" type="xsd:time"/> 59 <xsd:element name="lastDepartureTimeInSlot" type="xsd:time"/> 60 </xsd:sequence> 61 </xsd:extension> 62 </xsd:complexContent> 63 </xsd:complexType> 64 <xsd:complexType name="RouteExtension"> 65 <xsd:annotation> 66 <xsd:documentation>Extension d'itinéraire qui en précise le sens, aller ou retour</xsd:documentation> 67 </xsd:annotation> 68 <xsd:sequence> 69 <xsd:element name="wayBack" type="xsd:string"/> 70 </xsd:sequence> 71 </xsd:complexType> 72 <xsd:complexType name="StopAreaExtension"> 73 <xsd:annotation> 74 <xsd:documentation>Extension de zone d'arrêts qui précise notamment un code tarifaire et un identifiant fonctionnel</xsd:documentation> 75 </xsd:annotation> 76 <xsd:sequence> 77 <xsd:element name="areaType" type="ChouetteAreaType"/> 78 <xsd:element name="nearestTopicName" type="xsd:string" minOccurs="0"/> 79 <xsd:element name="fareCode" type="xsd:int" minOccurs="0"/> 80 <xsd:element name="registration" type="RegistrationType" minOccurs="0"/> 81 <xsd:element name="mobilityRestrictedSuitability" type="xsd:boolean" minOccurs="0"/> 82 <xsd:element name="accessibilitySuitabilityDetails" minOccurs="0"> 83 <xsd:complexType> 84 <xsd:sequence maxOccurs="unbounded"> 85 <xsd:group ref="ifopt:UserNeedGroup"/> 86 </xsd:sequence> 87 </xsd:complexType> 88 </xsd:element> 89 <xsd:element name="stairsAvailability" type="xsd:boolean" minOccurs="0"/> 90 <xsd:element name="liftAvailability" type="xsd:boolean" minOccurs="0"/> 91 </xsd:sequence> 92 </xsd:complexType> 93 <xsd:complexType name="ConnectionLinkExtensionType"> 94 <xsd:sequence> 95 <xsd:element name="accessibilitySuitabilityDetails" minOccurs="0"> 96 <xsd:complexType> 97 <xsd:sequence maxOccurs="unbounded"> 98 <xsd:group ref="ifopt:UserNeedGroup"/> 99 </xsd:sequence> 100 </xsd:complexType> 101 </xsd:element> 102 </xsd:sequence> 103 </xsd:complexType> 104 <xsd:complexType name="LineExtensionType"> 105 <xsd:annotation> 106 <xsd:documentation>Extension de ligne pour l'accessibilité aux PMR</xsd:documentation> 107 </xsd:annotation> 108 <xsd:sequence> 109 <xsd:element name="stableId" type="xsd:string" minOccurs="0"> 110 <xsd:annotation> 111 <xsd:documentation>Identifier of the line whose value will remain unchanged for the all line life time </xsd:documentation> 112 </xsd:annotation> 113 </xsd:element> 114 <xsd:element name="mobilityRestrictedSuitability" type="xsd:boolean" minOccurs="0"/> 115 <xsd:element name="accessibilitySuitabilityDetails" minOccurs="0"> 116 <xsd:complexType> 117 <xsd:sequence maxOccurs="unbounded"> 118 <xsd:group ref="ifopt:UserNeedGroup"/> 119 </xsd:sequence> 120 </xsd:complexType> 121 </xsd:element> 122 </xsd:sequence> 123 </xsd:complexType> 124 <xsd:complexType name="ChouetteFacilityType"> 125 <xsd:annotation> 126 <xsd:documentation>Description des equipement situés dans les zones d'arrêt ou les vehicules (via la ligne)</xsd:documentation> 127 </xsd:annotation> 128 <xsd:complexContent> 129 <xsd:extension base="trd:TridentObjectType"> 130 <xsd:sequence> 131 <xsd:element name="facilityLocation" minOccurs="0"> 132 <xsd:complexType> 133 <xsd:sequence> 134 <xsd:element name="longitude" type="trd:LongitudeType"/> 135 <xsd:element name="latitude" type="trd:LatitudeType"/> 136 <xsd:element name="longLatType" type="LongLatTypeType"/> 137 <xsd:element name="address" type="trd:AddressType" minOccurs="0"/> 138 <xsd:element name="projectedPoint" type="trd:ProjectedPointType" minOccurs="0"/> 139 <xsd:element name="containedIn" type="trd:TridentIdType"/> 140 <!-- REMARK : The IsContainedBy element refers to Area via Id --> 141 </xsd:sequence> 142 </xsd:complexType> 143 </xsd:element> 144 <xsd:choice> 145 <xsd:annotation> 146 <xsd:documentation>The facility has to be attached to a StopAres (Quay, BoardingPosition or Stop Place), a line (meaning vehicles operating this line), a connection link or a Stop Point on Route (stopPoint))</xsd:documentation> 147 </xsd:annotation> 148 <xsd:element name="stopAreaId" type="trd:TridentIdType"/> 149 <xsd:element name="lineId" type="trd:TridentIdType"/> 150 <xsd:element name="connectionLinkId" type="trd:TridentIdType"/> 151 <xsd:element name="stopPointId" type="trd:TridentIdType"/> 152 </xsd:choice> 153 <xsd:element name="facilityFeature" type="siri:AllFacilitiesFeatureStructure" maxOccurs="unbounded"> 154 <xsd:annotation> 155 <xsd:documentation>Description of the feauture of the facility. Several features may be associated to a single facility.</xsd:documentation> 156 </xsd:annotation> 157 </xsd:element> 158 <xsd:element name="name" type="xsd:string" minOccurs="0"> 159 <xsd:annotation> 160 <xsd:documentation>Name of the facility</xsd:documentation> 161 </xsd:annotation> 162 </xsd:element> 163 <xsd:element name="description" type="xsd:string" minOccurs="0"> 164 <xsd:annotation> 165 <xsd:documentation>Textual description of the facility</xsd:documentation> 166 </xsd:annotation> 167 </xsd:element> 168 <xsd:element name="freeAccess" type="xsd:boolean" minOccurs="0"> 169 <xsd:annotation> 170 <xsd:documentation>Is the access restricted or authorised to everybody</xsd:documentation> 171 </xsd:annotation> 172 </xsd:element> 173 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 174 </xsd:sequence> 175 </xsd:extension> 176 </xsd:complexContent> 177 </xsd:complexType> 178 <xsd:complexType name="ChouettePTNetworkType"> 179 <xsd:annotation> 180 <xsd:documentation>La strucutre d'échange d'une ligne de transport. 181 181 Cette strucuture contient la totalité des données qui décrivent la ligne.</xsd:documentation> 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 182 </xsd:annotation> 183 <xsd:sequence> 184 <xsd:element name="PTNetwork" type="trd:PTNetworkType"> 185 <xsd:annotation> 186 <xsd:documentation>Le réseau de la ligne</xsd:documentation> 187 </xsd:annotation> 188 </xsd:element> 189 <xsd:element name="GroupOfLine" type="GroupOfLineType" minOccurs="0"> 190 <xsd:annotation> 191 <xsd:documentation>Groupe de ligne auquel appartient la ligne décrite</xsd:documentation> 192 </xsd:annotation> 193 </xsd:element> 194 <xsd:element name="Company" type="trd:CompanyType" minOccurs="0" maxOccurs="unbounded"> 195 <xsd:annotation> 196 <xsd:documentation>La compagnie de transport qui assure l'exploitation de la ligne.</xsd:documentation> 197 </xsd:annotation> 198 </xsd:element> 199 <xsd:element name="ChouetteArea"> 200 <xsd:complexType> 201 <xsd:sequence> 202 <xsd:element name="StopArea" minOccurs="0" maxOccurs="unbounded"> 203 <xsd:annotation> 204 <xsd:documentation>La liste des zones dons le type figure sur l'extension</xsd:documentation> 205 </xsd:annotation> 206 <xsd:complexType> 207 <xsd:complexContent> 208 <xsd:extension base="StopAreaType"> 209 <xsd:sequence> 210 <xsd:element name="StopAreaExtension" type="StopAreaExtension" minOccurs="0"/> 211 </xsd:sequence> 212 </xsd:extension> 213 </xsd:complexContent> 214 </xsd:complexType> 215 </xsd:element> 216 <xsd:element name="AreaCentroid" minOccurs="0" maxOccurs="unbounded"> 217 <xsd:annotation> 218 <xsd:documentation>Liste de position géographiques</xsd:documentation> 219 </xsd:annotation> 220 <xsd:complexType> 221 <xsd:complexContent> 222 <xsd:extension base="PlaceType"/> 223 </xsd:complexContent> 224 </xsd:complexType> 225 </xsd:element> 226 </xsd:sequence> 227 </xsd:complexType> 228 </xsd:element> 229 <xsd:element name="ConnectionLink" minOccurs="0" maxOccurs="unbounded"> 230 <xsd:annotation> 231 <xsd:documentation>La liste de toutes les correspondances sur la ligne. 232 232 Les correspondances relient un arrêt de la ligne avec un autre arrêt de cette même ligne ou d'une autre ligne.</xsd:documentation> 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 233 </xsd:annotation> 234 <xsd:complexType> 235 <xsd:complexContent> 236 <xsd:extension base="ConnectionLinkType"> 237 <xsd:sequence> 238 <xsd:element name="ConnectionLinkExtension" type="ConnectionLinkExtensionType" minOccurs="0"/> 239 </xsd:sequence> 240 </xsd:extension> 241 </xsd:complexContent> 242 </xsd:complexType> 243 </xsd:element> 244 <xsd:element name="Timetable" type="TimetableType" minOccurs="0" maxOccurs="unbounded"> 245 <xsd:annotation> 246 <xsd:documentation>La liste des tableaux de marche.</xsd:documentation> 247 </xsd:annotation> 248 </xsd:element> 249 <xsd:element name="TimeSlot" type="TimeSlotType" minOccurs="0" maxOccurs="unbounded"/> 250 <xsd:element name="ChouetteLineDescription"> 251 <xsd:annotation> 252 <xsd:documentation>Structure qui regroupe les autres données de la ligne. 253 253 </xsd:documentation> 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 254 </xsd:annotation> 255 <xsd:complexType> 256 <xsd:sequence> 257 <xsd:element name="Line"> 258 <xsd:annotation> 259 <xsd:documentation>La ligne et ses références vers ses itinéraires et son réseau</xsd:documentation> 260 </xsd:annotation> 261 <xsd:complexType> 262 <xsd:complexContent> 263 <xsd:extension base="LineType"> 264 <xsd:sequence> 265 <xsd:element name="LineExtension" type="LineExtensionType" minOccurs="0"/> 266 </xsd:sequence> 267 </xsd:extension> 268 </xsd:complexContent> 269 </xsd:complexType> 270 </xsd:element> 271 <xsd:element name="ChouetteRoute" maxOccurs="unbounded"> 272 <xsd:annotation> 273 <xsd:documentation>La liste de tous les itinéraires de la ligne.</xsd:documentation> 274 </xsd:annotation> 275 <xsd:complexType> 276 <xsd:complexContent> 277 <xsd:extension base="RouteType"> 278 <xsd:sequence> 279 <xsd:element name="RouteExtension" type="RouteExtension" minOccurs="0"/> 280 </xsd:sequence> 281 </xsd:extension> 282 </xsd:complexContent> 283 </xsd:complexType> 284 </xsd:element> 285 <xsd:element name="StopPoint" minOccurs="2" maxOccurs="unbounded"> 286 <xsd:annotation> 287 <xsd:documentation>La liste de tous les arrêts parcourus par les tronçons des itinéraires de ligne. 288 288 289 289 </xsd:documentation> 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 290 </xsd:annotation> 291 <xsd:complexType> 292 <xsd:complexContent> 293 <xsd:extension base="StopPointType"/> 294 </xsd:complexContent> 295 </xsd:complexType> 296 </xsd:element> 297 <xsd:element name="ITL" type="ITLType" minOccurs="0" maxOccurs="unbounded"> 298 <xsd:annotation> 299 <xsd:documentation>Liste des interdictions de trafic local auxquelles doivent se conformer les voyageurs de la ligne</xsd:documentation> 300 </xsd:annotation> 301 </xsd:element> 302 <xsd:element name="PtLink" type="PTLinkType" maxOccurs="unbounded"> 303 <xsd:annotation> 304 <xsd:documentation>La liste de tous les tronçons des itinéraires de la ligne.</xsd:documentation> 305 </xsd:annotation> 306 </xsd:element> 307 <xsd:element name="JourneyPattern" type="JourneyPatternType" minOccurs="0" maxOccurs="unbounded"> 308 <xsd:annotation> 309 <xsd:documentation>La liste de toutes les missions des courses de la ligne.</xsd:documentation> 310 </xsd:annotation> 311 </xsd:element> 312 <xsd:element name="VehicleJourney" type="VehicleJourneyType" minOccurs="0" maxOccurs="unbounded"> 313 <xsd:annotation> 314 <xsd:documentation>La liste de toutes les courses de la ligne qui sont effectives pour au moins l'un des tableaux de marche de la ligne.</xsd:documentation> 315 </xsd:annotation> 316 </xsd:element> 317 </xsd:sequence> 318 </xsd:complexType> 319 </xsd:element> 320 <xsd:element name="Facility" type="ChouetteFacilityType" minOccurs="0" maxOccurs="unbounded"/> 321 <xsd:element name="AccessPoint" type="PTAccessPointType" minOccurs="0" maxOccurs="unbounded"/> 322 323 <xsd:element name="AccessLink" minOccurs="0" maxOccurs="unbounded"> 324 <xsd:annotation> 325 <xsd:documentation>La liste de toutes les correspondances sur la ligne. 326 326 Les correspondances relient un arrêt de la ligne avec un autre arrêt de cette même ligne ou d'une autre ligne.</xsd:documentation> 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 327 </xsd:annotation> 328 <xsd:complexType> 329 <xsd:complexContent> 330 <xsd:extension base="PTAccessLinkType"> 331 <xsd:sequence> 332 <xsd:element name="ConnectionLinkExtension" type="ConnectionLinkExtensionType" minOccurs="0"/> 333 </xsd:sequence> 334 </xsd:extension> 335 </xsd:complexContent> 336 </xsd:complexType> 337 </xsd:element> 338 </xsd:sequence> 339 </xsd:complexType> 340 <!-- Definition des instances --> 341 <xsd:element name="ChouettePTNetwork" type="ChouettePTNetworkType"> 342 <xsd:keyref name="fk_stoppoint_journey" refer="pk_stoppoint"> 343 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:JourneyPattern/trd:stopPointList"/> 344 <xsd:field xpath="."/> 345 </xsd:keyref> 346 <xsd:keyref name="fk_route_journey" refer="pk_route"> 347 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:JourneyPattern/trd:routeId"/> 348 <xsd:field xpath="."/> 349 </xsd:keyref> 350 <xsd:keyref name="fk_journey_vehicle" refer="pk_journey_pattern"> 351 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:VehicleJourney/trd:journeyPatternId"/> 352 <xsd:field xpath="."/> 353 </xsd:keyref> 354 <xsd:key name="pk_journey_pattern"> 355 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:JourneyPattern"/> 356 <xsd:field xpath="trd:objectId"/> 357 </xsd:key> 358 <xsd:keyref name="fk_vehicle_timetable" refer="pk_vehicle"> 359 <xsd:selector xpath=".//trd:Timetable/trd:vehicleJourneyId"/> 360 <xsd:field xpath="."/> 361 </xsd:keyref> 362 <xsd:keyref name="fk_vehicle_vehicleatstop" refer="pk_vehicle"> 363 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:VehicleJourney/trd:vehicleJourneyAtStop/trd:vehicleJourneyId"/> 364 <xsd:field xpath="."/> 365 </xsd:keyref> 366 <xsd:keyref name="fk_stoppoint_vehicleatstop" refer="pk_stoppoint"> 367 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:VehicleJourney/trd:vehicleJourneyAtStop/trd:stopPointId"/> 368 <xsd:field xpath="."/> 369 </xsd:keyref> 370 <xsd:keyref name="fk_route_vehicle" refer="pk_route"> 371 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:VehicleJourney/trd:routeId"/> 372 <xsd:field xpath="."/> 373 </xsd:keyref> 374 <xsd:keyref name="fk_stoppoint_ptlink" refer="pk_stoppoint"> 375 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:PtLink/trd:endOfLink|.//trd:ChouetteLineDescription/trd:PtLink/trd:startOfLink"/> 376 <xsd:field xpath="."/> 377 </xsd:keyref> 378 <xsd:key name="pk_vehicle"> 379 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:VehicleJourney"/> 380 <xsd:field xpath="trd:objectId"/> 381 </xsd:key> 382 <xsd:key name="pk_stoppoint"> 383 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:StopPoint"/> 384 <xsd:field xpath="trd:objectId"/> 385 </xsd:key> 386 <xsd:key name="pk_ptlink"> 387 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:PtLink"/> 388 <xsd:field xpath="trd:objectId"/> 389 </xsd:key> 390 <xsd:keyref name="fk_stoparea_centroid" refer="pk_stoparea"> 391 <xsd:selector xpath=".//trd:ChouetteArea/trd:AreaCentroid/trd:containedIn"/> 392 <xsd:field xpath="."/> 393 </xsd:keyref> 394 <xsd:keyref name="fk_stoparea_stoppoint" refer="pk_stoparea"> 395 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:StopPoint/trd:containedIn"/> 396 <xsd:field xpath="."/> 397 </xsd:keyref> 398 <xsd:key name="pk_stoparea"> 399 <xsd:selector xpath=".//trd:ChouetteArea/trd:StopArea"/> 400 <xsd:field xpath="trd:objectId"/> 401 </xsd:key> 402 <xsd:keyref name="fk_route_line" refer="pk_route"> 403 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:Line/trd:routeId"/> 404 <xsd:field xpath="."/> 405 </xsd:keyref> 406 <xsd:key name="pk_route"> 407 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:ChouetteRoute"/> 408 <xsd:field xpath="trd:objectId"/> 409 </xsd:key> 410 <xsd:keyref name="fk_line_ptnetwork" refer="pk_line"> 411 <xsd:selector xpath=".//trd:PTNetwork"/> 412 <xsd:field xpath="trd:lineId"/> 413 </xsd:keyref> 414 <xsd:key name="pk_line"> 415 <xsd:selector xpath=".//trd:ChouetteLineDescription/trd:Line"/> 416 <xsd:field xpath="trd:objectId"/> 417 </xsd:key> 418 <xsd:key name="pk_centroid"> 419 <xsd:selector xpath=".//trd:ChouetteArea/trd:AreaCentroid"/> 420 <xsd:field xpath="trd:objectId"/> 421 </xsd:key> 422 <xsd:keyref name="fk_centroid_stoparea" refer="pk_centroid"> 423 <xsd:selector xpath=".//trd:ChouetteArea/trd:StopArea/trd:centroidOfArea"/> 424 <xsd:field xpath="."/> 425 </xsd:keyref> 426 </xsd:element> 427 <xsd:simpleType name="ChouetteAreaType"> 428 <xsd:restriction base="xsd:string"> 429 <xsd:enumeration value="Quay"/> 430 <xsd:enumeration value="BoardingPosition"/> 431 <xsd:enumeration value="CommercialStopPoint"/> 432 <xsd:enumeration value="StopPlace"/> 433 <xsd:enumeration value="ITL"/> 434 </xsd:restriction> 435 </xsd:simpleType> 436 <xsd:complexType name="ChouetteRemoveLineType"> 437 <xsd:sequence> 438 <xsd:element name="Line" type="LineType"/> 439 </xsd:sequence> 440 </xsd:complexType> 441 <xsd:element name="ChouetteRemoveLine" type="ChouetteRemoveLineType"/> 442 442 </xsd:schema> -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/resources/neptune_toulouse/trident/trident_Global_schema.xsd
r28018 r30731 3 3 <!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Christophe Duquesne (Dryade) --> 4 4 <!-- File: trident_Global_schema.xsd --> 5 6 7 8 9 10 11 5 <xsd:schema 6 xmlns:trd="http://www.trident.org/schema/trident" 7 xmlns="http://www.trident.org/schema/trident" 8 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 9 targetNamespace="http://www.trident.org/schema/trident" 10 elementFormDefault="qualified" 11 version="2.0"> 12 12 <xsd:annotation> 13 13 <xsd:documentation xml:lang="en"> … … 25 25 <xsd:annotation> 26 26 <xsd:documentation> 27 28 29 27 Defines the way an TRIDENT ID has to be built: 28 {PeerID}:{Class name}:{Progressive integer} 29 For example: RATP:Event:12332 or ATAC:Line:9987 30 30 </xsd:documentation> 31 31 </xsd:annotation> … … 35 35 </xsd:simpleType> 36 36 <!-- REMARK : The following 2 types are not in the DM: they are technical 37 38 37 types used to ease construction_ it's just a list of 38 Trident Object Id --> 39 39 <xsd:simpleType name="TridentIdGeneralListType"> 40 40 <xsd:list itemType="TridentIdType"/> … … 61 61 </xsd:sequence> 62 62 <!-- REMARK: This object type is used for requests (to select 63 64 63 a specific Opbject from its Id), "minOccurs" has been set 64 to "0" for Version to be able to select the current Version 65 65 --> 66 66 </xsd:complexType> … … 90 90 <xsd:annotation> 91 91 <xsd:documentation> 92 92 Percentage: decimal between 0 and 100 93 93 </xsd:documentation> 94 94 </xsd:annotation> … … 104 104 <xsd:annotation> 105 105 <xsd:documentation> 106 106 Defines the list of the days of the week (in english!) 107 107 </xsd:documentation> 108 108 </xsd:annotation> … … 120 120 <xsd:annotation> 121 121 <xsd:documentation> 122 122 Enumeration containing all the possible units for measurement 123 123 </xsd:documentation> 124 124 </xsd:annotation> 125 125 <xsd:restriction base="xsd:string"> 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 126 <xsd:enumeration value="DegreesCelsius"/> 127 <xsd:enumeration value="Centimeter"/> 128 <xsd:enumeration value="Degree"/> 129 <xsd:enumeration value="Hour"/> 130 <xsd:enumeration value="Hectopascals"/> 131 <xsd:enumeration value="KilometersPerHour"/> 132 <xsd:enumeration value="Kilometer"/> 133 <xsd:enumeration value="CubicMeter"/> 134 <xsd:enumeration value="MillimetersPerHour"/> 135 <xsd:enumeration value="Millimeter"/> 136 <xsd:enumeration value="Meter"/> 137 <xsd:enumeration value="MetersPerSecond"/> 138 <xsd:enumeration value="Percentage"/> 139 <xsd:enumeration value="Second"/> 140 <xsd:enumeration value="Tonne"/> 141 <xsd:enumeration value="HrMinSec"/> 142 <xsd:enumeration value="PeriodOfTime"/> 143 </xsd:restriction> 144 </xsd:simpleType> 145 <!-- ============================================================== --> 146 <xsd:simpleType name="LocationTypeType"> 147 <xsd:annotation> 148 <xsd:documentation> 149 Enumeration containing all the possible location Type 150 </xsd:documentation> 151 </xsd:annotation> 152 <xsd:restriction base="xsd:string"> 153 <xsd:enumeration value="BusStopPoint"/> 154 <xsd:enumeration value="AriportStopPoint"/> 155 <xsd:enumeration value="TramStopPoint"/> 156 <xsd:enumeration value="MetroStopPoint"/> 157 <xsd:enumeration value="RailwayStopPoint"/> 158 <xsd:enumeration value="RoadJunction"/> 159 <xsd:enumeration value="Mixed"/> 160 <xsd:enumeration value="Address"/> 161 <xsd:enumeration value="IntermediateRoadPoint"/> 162 <xsd:enumeration value="StopArea"/> 163 <xsd:enumeration value="PointOfInterest"/> 164 </xsd:restriction> 165 </xsd:simpleType> 166 <xsd:simpleType name="LongLatTypeType"> 167 <xsd:annotation> 168 <xsd:documentation>Type of geodesic reference</xsd:documentation> 169 </xsd:annotation> 170 <xsd:restriction base="xsd:string"> 171 <xsd:enumeration value="WGS84"/> 172 <xsd:enumeration value="WGS92"/> 173 <xsd:enumeration value="Standard"/> 174 </xsd:restriction> 175 </xsd:simpleType> 176 <xsd:simpleType name="LocationReferencingMethodType"> 177 <xsd:annotation> 178 <xsd:documentation> 179 Enumeration containing all the possible location referencing 180 methods 181 </xsd:documentation> 182 </xsd:annotation> 183 <xsd:restriction base="xsd:string"> 184 <xsd:enumeration value="1"/> 185 <xsd:enumeration value="2"/> 186 <xsd:enumeration value="3"/> 187 <xsd:enumeration value="4"/> 188 <xsd:enumeration value="5"/> 189 <xsd:enumeration value="6"/> 190 <xsd:enumeration value="7"/> 191 <xsd:enumeration value="8"/> 192 <xsd:enumeration value="9"/> 193 <xsd:enumeration value="10"/> 194 <xsd:enumeration value="11"/> 195 </xsd:restriction> 196 </xsd:simpleType> 197 <xsd:simpleType name="WordOrderType"> 198 <xsd:annotation> 199 <xsd:documentation>Order of words in a ILOC descriptor</xsd:documentation> 200 </xsd:annotation> 201 <xsd:restriction base="xsd:string"> 202 <xsd:enumeration value="FromTheFirstToTheLastWord"/> 203 <xsd:enumeration value="FromTheLastToTheFirstWord"/> 204 </xsd:restriction> 205 </xsd:simpleType> 206 <xsd:simpleType name="POITypeType"> 207 <xsd:annotation> 208 <xsd:documentation>Different types for a point</xsd:documentation> 209 </xsd:annotation> 210 <xsd:restriction base="xsd:string"> 211 <xsd:enumeration value="AccommodationEatingAndDrinking"/> 212 <xsd:enumeration value="CommercialServices"/> 213 <xsd:enumeration value="Attraction"/> 214 <xsd:enumeration value="SportAndEntertainment"/> 215 <xsd:enumeration value="EducationAndHealth"/> 216 <xsd:enumeration value="PublicInfrastructure"/> 217 <xsd:enumeration value="ManufacturingAndProduction"/> 218 <xsd:enumeration value="Wholesale"/> 219 <xsd:enumeration value="Retail"/> 220 <xsd:enumeration value="Transport"/> 221 </xsd:restriction> 222 </xsd:simpleType> 223 <xsd:simpleType name="PtAccessPointTypeType"> 224 <xsd:annotation> 225 <xsd:documentation>Type of a PT acces</xsd:documentation> 226 </xsd:annotation> 227 <xsd:restriction base="xsd:string"> 228 <xsd:enumeration value="In"/> 229 <xsd:enumeration value="Out"/> 230 <xsd:enumeration value="InOut"/> 231 </xsd:restriction> 232 </xsd:simpleType> 233 <xsd:simpleType name="ConnectionLinkTypeType"> 234 <xsd:annotation> 235 <xsd:documentation>Type of connection</xsd:documentation> 236 </xsd:annotation> 237 <xsd:restriction base="xsd:string"> 238 <xsd:enumeration value="Underground"/> 239 <xsd:enumeration value="Mixed"/> 240 <xsd:enumeration value="Overground"/> 241 </xsd:restriction> 242 </xsd:simpleType> 243 <!-- ============================================================== --> 244 <xsd:simpleType name="TransportModeNameType"> 245 <xsd:annotation> 246 <xsd:documentation> 247 Enumeration containing all the possible transport modes 248 </xsd:documentation> 249 </xsd:annotation> 250 <xsd:restriction base="xsd:string"> 251 <xsd:enumeration value="Air"/> 252 <xsd:enumeration value="Train"/> 253 <xsd:enumeration value="LongDistanceTrain"/> 254 <xsd:enumeration value="LongDistanceTrain_2"/> 255 <xsd:enumeration value="LocalTrain"/> 256 <xsd:enumeration value="RapidTransit"/> 257 <xsd:enumeration value="Metro"/> 258 <xsd:enumeration value="Tramway"/> 259 <xsd:enumeration value="Coach"/> 260 <xsd:enumeration value="Bus"/> 261 <xsd:enumeration value="Ferry"/> 262 <xsd:enumeration value="Waterborne"/> 263 <xsd:enumeration value="PrivateVehicle"/> 264 <xsd:enumeration value="Walk"/> 265 <xsd:enumeration value="Trolleybus"/> 266 <xsd:enumeration value="Bicycle"/> 267 <xsd:enumeration value="Shuttle"/> 268 <xsd:enumeration value="Taxi"/> 269 <xsd:enumeration value="VAL"/> 270 <xsd:enumeration value="Other"/> 271 </xsd:restriction> 272 </xsd:simpleType> 273 <xsd:simpleType name="PTDirectionType"> 274 <xsd:annotation> 275 <xsd:documentation> 276 Enumeration containing all the possible directions on a PT Network 277 </xsd:documentation> 278 </xsd:annotation> 279 <xsd:restriction base="xsd:string"> 280 <xsd:enumeration value="North"/> 281 <xsd:enumeration value="NorthEast"/> 282 <xsd:enumeration value="East"/> 283 <xsd:enumeration value="SouthEast"/> 284 <xsd:enumeration value="South"/> 285 <xsd:enumeration value="SouthWest"/> 286 <xsd:enumeration value="West"/> 287 <xsd:enumeration value="NorthWest"/> 288 <xsd:enumeration value="ClockWise"/> 289 <xsd:enumeration value="CounterClockWise"/> 290 <xsd:enumeration value="A"/> 291 <xsd:enumeration value="R"/> 292 </xsd:restriction> 293 </xsd:simpleType> 294 <xsd:simpleType name="DayTypeType"> 295 <xsd:annotation> 296 <xsd:documentation> 297 Enumeration containing all defined Day Type 298 </xsd:documentation> 299 </xsd:annotation> 300 <xsd:restriction base="xsd:string"> 301 <xsd:enumeration value="WeekDay"/> 302 <xsd:enumeration value="WeekEnd"/> 303 <xsd:enumeration value="Monday"/> 304 <xsd:enumeration value="Tuesday"/> 305 <xsd:enumeration value="Wednesday"/> 306 <xsd:enumeration value="Thursday"/> 307 <xsd:enumeration value="Friday"/> 308 <xsd:enumeration value="Saturday"/> 309 <xsd:enumeration value="Sunday"/> 310 <xsd:enumeration value="SchoolHolliday"/> 311 <xsd:enumeration value="PublicHolliday"/> 312 <xsd:enumeration value="MarketDay"/> 313 </xsd:restriction> 314 </xsd:simpleType> 315 <xsd:simpleType name="BoardingAlightingPossibilityType"> 316 <xsd:annotation> 317 <xsd:documentation> 318 Enumeration containing all the ways to board or alight a bus 319 </xsd:documentation> 320 </xsd:annotation> 321 <xsd:restriction base="xsd:string"> 322 <xsd:enumeration value="BoardAndAlight"/> 323 <xsd:enumeration value="AlightOnly"/> 324 <xsd:enumeration value="BoardOnly"/> 325 <xsd:enumeration value="NeitherBoardOrAlight"/> 326 <xsd:enumeration value="BoardAndAlightOnRequest"/> 327 <xsd:enumeration value="AlightOnRequest"/> 328 <xsd:enumeration value="BoardOnRequest"/> 329 </xsd:restriction> 330 </xsd:simpleType> 331 <xsd:simpleType name="ServiceStatusValueType"> 332 <xsd:annotation> 333 <xsd:documentation> 334 Enumeration containing all the possible status of a PT service 335 </xsd:documentation> 336 </xsd:annotation> 337 <xsd:restriction base="xsd:string"> 338 <xsd:enumeration value="Normal"/> 339 <xsd:enumeration value="Delayed"/> 340 <xsd:enumeration value="Cancelled"/> 341 <xsd:enumeration value="Disrupted"/> 342 <xsd:enumeration value="ReducedService"/> 343 <xsd:enumeration value="IncreasedService"/> 344 <xsd:enumeration value="Rerouted"/> 345 <xsd:enumeration value="NotStopping"/> 346 <xsd:enumeration value="Early"/> 347 </xsd:restriction> 348 </xsd:simpleType> 349 <xsd:simpleType name="VehicleJourneyStatusValueType"> 350 <xsd:annotation> 351 <xsd:documentation> 352 Enumeration containing all the possible status of a PT service 353 353 on a vehicle 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 354 </xsd:documentation> 355 </xsd:annotation> 356 <xsd:restriction base="xsd:string"> 357 <xsd:enumeration value="Normal"/> 358 <xsd:enumeration value="Delayed"/> 359 <xsd:enumeration value="Cancelled"/> 360 <xsd:enumeration value="Rerouted"/> 361 <xsd:enumeration value="NotStopping"/> 362 <xsd:enumeration value="Early"/> 363 </xsd:restriction> 364 </xsd:simpleType> 365 <xsd:simpleType name="SourceTypeType"> 366 <xsd:annotation> 367 <xsd:documentation> 368 Enumeration containing all the possible type of information 369 369 source 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 370 </xsd:documentation> 371 </xsd:annotation> 372 <xsd:restriction base="xsd:string"> 373 <xsd:enumeration value="AutomobileClubPatrol"/> 374 <xsd:enumeration value="SpotterAircraft"/> 375 <xsd:enumeration value="BreakdownService"/> 376 <xsd:enumeration value="CameraObservation"/> 377 <xsd:enumeration value="EmergencyServicePatrol"/> 378 <xsd:enumeration value="FreightVehicleOperator"/> 379 <xsd:enumeration value="InfraredMonitoringStation"/> 380 <xsd:enumeration value="InductionLoopMonitoringStation"/> 381 <xsd:enumeration value="MicrowaveMonitoringStation"/> 382 <xsd:enumeration value="MobileTelephoneCaller"/> 383 <xsd:enumeration value="OtherInformation"/> 384 <xsd:enumeration value="OtherOfficialVehicle"/> 385 <xsd:enumeration value="PolicePatrol"/> 386 <xsd:enumeration value="PublicAndPrivateUtilities"/> 387 <xsd:enumeration value="RoadAuthorities"/> 388 <xsd:enumeration value="RegisteredMotoristObserver"/> 389 <xsd:enumeration value="RoadsideTelephoneCaller"/> 390 <xsd:enumeration value="TrafficMonitoringStation"/> 391 <xsd:enumeration value="TransitOperator"/> 392 <xsd:enumeration value="VideoProcessingMonitoringStation"/> 393 <xsd:enumeration value="VehicleProbeMeasurement"/> 394 <xsd:enumeration value="PublicTransport"/> 395 <xsd:enumeration value="PassengerTransportCoordinatingAuthority"/> 396 <xsd:enumeration value="TravelInformationServiceProvider"/> 397 <xsd:enumeration value="TravelAgency"/> 398 <xsd:enumeration value="IndividualSubjectOfTravelItinerary"/> 399 </xsd:restriction> 400 </xsd:simpleType> 401 <!-- ============================================================== --> 402 <xsd:simpleType name="QualityIndexType"> 403 <xsd:annotation> 404 <xsd:documentation> 405 Quality of a status/situation indications 406 </xsd:documentation> 407 </xsd:annotation> 408 <xsd:restriction base="xsd:string"> 409 <xsd:enumeration value="Certain"/> 410 <xsd:enumeration value="VeryReliable"/> 411 <xsd:enumeration value="Reliable"/> 412 <xsd:enumeration value="ProbablyReliable"/> 413 <xsd:enumeration value="Unconfirmed"/> 414 </xsd:restriction> 415 </xsd:simpleType> 416 <xsd:simpleType name="SeverityType"> 417 <xsd:annotation> 418 <xsd:documentation> 419 Severity of a status/situation 420 </xsd:documentation> 421 </xsd:annotation> 422 <xsd:restriction base="xsd:string"> 423 <xsd:enumeration value="ExtremelySevere"/> 424 <xsd:enumeration value="VerySevere"/> 425 <xsd:enumeration value="Severe"/> 426 <xsd:enumeration value="LowSeverity"/> 427 <xsd:enumeration value="LowestSeverity"/> 428 <xsd:enumeration value="NotProvided"/> 429 </xsd:restriction> 430 </xsd:simpleType> 431 <!-- ============================================================== --> 432 <xsd:complexType name="TimePeriodType"> 433 <xsd:annotation> 434 <xsd:documentation xml:lang="en"> 435 Time and duration information 436 </xsd:documentation> 437 </xsd:annotation> 438 <xsd:sequence> 439 <xsd:element name="DateTime" type="xsd:dateTime" minOccurs="0"/> 440 <xsd:element name="Duration" type="xsd:duration" minOccurs="0"/> 441 </xsd:sequence> 442 </xsd:complexType> 443 <xsd:complexType name="MeasurementTimeType"> 444 <xsd:annotation> 445 <xsd:documentation xml:lang="en"> 446 Informations on the time of a measurement 447 </xsd:documentation> 448 </xsd:annotation> 449 <xsd:sequence> 450 <xsd:element name="measurementTime" type="xsd:dateTime" minOccurs="0"/> 451 <xsd:element name="measurementPeriod" type="trd:TimePeriodType" minOccurs="0"/> 452 </xsd:sequence> 453 </xsd:complexType> 454 <xsd:complexType name="UnitisedQuantityType"> 455 <xsd:annotation> 456 <xsd:documentation xml:lang="en"> 457 457 Value with its type 458 458 for road trafic_ 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 459 </xsd:documentation> 460 </xsd:annotation> 461 <xsd:sequence> 462 <xsd:element name="value" type="xsd:decimal"/> 463 <xsd:element name="unit" type="trd:UnitType"/> 464 <xsd:element name="accuracy" type="trd:AccuracyType" minOccurs="0"/> 465 <xsd:element name="measurementTime" type="trd:MeasurementTimeType" minOccurs="0"/> 466 <xsd:element name="measurementLocation" type="trd:LocationType" minOccurs="0"/> 467 </xsd:sequence> 468 </xsd:complexType> 469 <xsd:complexType name="AccuracyType"> 470 <xsd:annotation> 471 <xsd:documentation xml:lang="en"> 472 Accuracy of a measure 473 </xsd:documentation> 474 </xsd:annotation> 475 <xsd:sequence> 476 <xsd:element name="standardDeviation" type="xsd:decimal" minOccurs="0"/> 477 <xsd:element name="accuracy" type="xsd:decimal" minOccurs="0"/> 478 <xsd:element name="dataClass" type="xsd:string" minOccurs="0"/> 479 <xsd:element name="accuracyRange" type="xsd:string" minOccurs="0"/> 480 <!-- REMARK : I didn't find the enumeration for the 2 481 following element in the DM_ I used 482 string type instead !!! --> 483 </xsd:sequence> 484 </xsd:complexType> 485 485 </xsd:schema> -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/resources/neptune_toulouse/trident/trident_Location_schema.xsd
r28018 r30731 4 4 <!-- File: trident_Location_schema.xsd --> 5 5 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.trident.org/schema/trident" xmlns:trd="http://www.trident.org/schema/trident" targetNamespace="http://www.trident.org/schema/trident" elementFormDefault="qualified" version="2.0"> 6 7 8 6 <xsd:annotation> 7 <xsd:appinfo>trident.xsd v1.00 2002-10</xsd:appinfo> 8 <xsd:documentation xml:lang="en"> 9 9 TRIDENT exchange schema. 10 10 Location referencing Description 11 11 Copyright (c) 2001 TRIDENT consortium, All Rights Reserved. 12 13 14 15 16 12 </xsd:documentation> 13 </xsd:annotation> 14 <!-- included files (if any) --> 15 <xsd:include schemaLocation="trident_Global_schema.xsd"/> 16 <!-- ============================================================== 17 17 object declarations 18 18 ============================================================== --> 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 19 <!-- LOCATION ===================================================== --> 20 <xsd:complexType name="LogicalLocationType" abstract="true"> 21 <xsd:annotation> 22 <xsd:documentation xml:lang="en"> 23 General description of a logical location (point, area, link,network,line....) 24 This type is an abstract type 25 </xsd:documentation> 26 </xsd:annotation> 27 <xsd:complexContent> 28 <xsd:extension base="trd:TridentObjectType"/> 29 </xsd:complexContent> 30 </xsd:complexType> 31 <xsd:complexType name="LocationType" abstract="true"> 32 <xsd:annotation> 33 <xsd:documentation xml:lang="en"> 34 General description of a location (point, area, link) 35 This type is an abstract type 36 </xsd:documentation> 37 </xsd:annotation> 38 <xsd:complexContent> 39 <xsd:extension base="trd:LogicalLocationType"/> 40 </xsd:complexContent> 41 </xsd:complexType> 42 <!-- POINTS ===================================================== --> 43 <xsd:complexType name="AddressType"> 44 <xsd:annotation> 45 <xsd:documentation xml:lang="en"> 46 Full Description of an address 47 </xsd:documentation> 48 </xsd:annotation> 49 <xsd:sequence> 50 <xsd:element name="streetName" type="xsd:string" minOccurs="0"/> 51 <xsd:element name="countryCode" type="xsd:string" minOccurs="0"/> 52 <!-- REMARK : LanguageCode is a code from code list ISO 639-1988 --> 53 </xsd:sequence> 54 </xsd:complexType> 55 <xsd:complexType name="RoadAddressType"> 56 <xsd:annotation> 57 <xsd:documentation xml:lang="en"> 58 Full Description of an address 59 </xsd:documentation> 60 </xsd:annotation> 61 <xsd:complexContent> 62 <xsd:extension base="trd:AddressType"> 63 <xsd:sequence> 64 <xsd:element name="number" type="xsd:string" minOccurs="0"/> 65 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 66 </xsd:sequence> 67 </xsd:extension> 68 </xsd:complexContent> 69 </xsd:complexType> 70 <xsd:complexType name="PostalAddressType"> 71 <xsd:annotation> 72 <xsd:documentation xml:lang="en"> 73 Full Description of an address 74 </xsd:documentation> 75 </xsd:annotation> 76 <xsd:complexContent> 77 <xsd:extension base="trd:AddressType"> 78 <xsd:sequence> 79 <xsd:element name="province" type="xsd:string" minOccurs="0"/> 80 <xsd:element name="region" type="xsd:string" minOccurs="0"/> 81 <xsd:element name="town" type="xsd:string" minOccurs="0"/> 82 <xsd:element name="roadNumber" type="xsd:string" minOccurs="0"/> 83 <xsd:element name="houseNumber" type="xsd:string" minOccurs="0"/> 84 <xsd:element name="postalCode" type="xsd:string"/> 85 </xsd:sequence> 86 </xsd:extension> 87 </xsd:complexContent> 88 </xsd:complexType> 89 <xsd:complexType name="PointOfInterestType"> 90 <xsd:annotation> 91 <xsd:documentation xml:lang="en"> 92 Description of a point of interest: this is provided if the point is at or near a major landmark or point of interest. 93 </xsd:documentation> 94 </xsd:annotation> 95 <xsd:sequence> 96 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 97 <xsd:element name="type" type="trd:POITypeType" minOccurs="0"/> 98 </xsd:sequence> 99 </xsd:complexType> 100 <xsd:complexType name="WGS84PositionType"> 101 <xsd:annotation> 102 <xsd:documentation xml:lang="en"> 103 Position of a point in WGS 84 Coordinate. 104 </xsd:documentation> 105 </xsd:annotation> 106 <xsd:sequence> 107 <xsd:element name="Longitude" type="trd:LongitudeType"/> 108 <xsd:element name="Latitude" type="trd:LatitudeType"/> 109 </xsd:sequence> 110 </xsd:complexType> 111 <xsd:complexType name="ProjectedPointType"> 112 <xsd:annotation> 113 <xsd:documentation xml:lang="en"> 114 Position of a point in a projection system. 115 </xsd:documentation> 116 </xsd:annotation> 117 <xsd:sequence> 118 <xsd:element name="X" type="xsd:decimal"/> 119 <xsd:element name="Y" type="xsd:decimal"/> 120 <xsd:element name="projectionType" type="xsd:string" minOccurs="0"/> 121 </xsd:sequence> 122 </xsd:complexType> 123 <xsd:complexType name="ProprietaryIdentifierType"> 124 <xsd:sequence> 125 <xsd:element name="id" type="xsd:string"/> 126 </xsd:sequence> 127 </xsd:complexType> 128 <xsd:complexType name="PointType" abstract="true"> 129 <xsd:annotation> 130 <xsd:documentation xml:lang="en"> 131 General point used to build any kind of point 132 </xsd:documentation> 133 </xsd:annotation> 134 <xsd:complexContent> 135 <xsd:extension base="trd:LocationType"> 136 <xsd:sequence> 137 <xsd:element name="longitude" type="trd:LongitudeType"/> 138 <xsd:element name="latitude" type="trd:LatitudeType"/> 139 <xsd:element name="longLatType" type="LongLatTypeType"/> 140 <xsd:element name="address" type="trd:AddressType" minOccurs="0"/> 141 <xsd:element name="projectedPoint" type="trd:ProjectedPointType" minOccurs="0"/> 142 <xsd:element name="containedIn" type="trd:TridentIdType"/> 143 <!-- REMARK : The IsContainedBy element refers to Area via Id --> 144 </xsd:sequence> 145 </xsd:extension> 146 </xsd:complexContent> 147 </xsd:complexType> 148 <xsd:complexType name="PlaceType"> 149 <xsd:annotation> 150 <xsd:documentation xml:lang="en"> 151 StopPoint on a Route of a Line of a PT Network 152 </xsd:documentation> 153 </xsd:annotation> 154 <xsd:complexContent> 155 <xsd:extension base="trd:PointType"> 156 <xsd:sequence> 157 <xsd:element name="name" type="xsd:string"/> 158 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 159 </xsd:sequence> 160 </xsd:extension> 161 </xsd:complexContent> 162 </xsd:complexType> 163 <xsd:complexType name="RoadPointType"> 164 <xsd:annotation> 165 <xsd:documentation xml:lang="en"> 166 General point used to build any kind of point 167 </xsd:documentation> 168 </xsd:annotation> 169 <xsd:complexContent> 170 <xsd:extension base="trd:PointType"> 171 <xsd:sequence> 172 <xsd:element name="LanguageCode" type="xsd:string" minOccurs="0"/> 173 <xsd:element name="Name" type="xsd:string"/> 174 </xsd:sequence> 175 </xsd:extension> 176 </xsd:complexContent> 177 </xsd:complexType> 178 <xsd:complexType name="PTAccessPointType"> 179 <xsd:annotation> 180 <xsd:documentation xml:lang="en"> 181 The physical (spatial) possibility for a passenger 182 to access or leave the PT network. 183 </xsd:documentation> 184 </xsd:annotation> 185 <xsd:complexContent> 186 <xsd:extension base="trd:PointType"> 187 <xsd:sequence> 188 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 189 <xsd:element name="type" minOccurs="0"> 190 <xsd:simpleType> 191 <xsd:restriction base="xsd:string"> 192 <xsd:enumeration value="In"/> 193 <xsd:enumeration value="Out"/> 194 <xsd:enumeration value="InOut"/> 195 </xsd:restriction> 196 </xsd:simpleType> 197 </xsd:element> 198 <xsd:element name="openingTime" type="xsd:time" minOccurs="0"/> 199 <xsd:element name="closingTime" type="xsd:time" minOccurs="0"/> 200 <xsd:element name="mobilityRestrictedSuitability" type="xsd:boolean" minOccurs="0"/> 201 <xsd:element name="stairsAvailability" type="xsd:boolean" minOccurs="0"/> 202 <xsd:element name="liftAvailability" type="xsd:boolean" minOccurs="0"/> 203 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 204 </xsd:sequence> 205 </xsd:extension> 206 </xsd:complexContent> 207 </xsd:complexType> 208 <xsd:complexType name="NonPTAccessLinkendType"> 209 <xsd:annotation> 210 <xsd:documentation xml:lang="en"> 211 211 An origin place not belonging to the PT network. 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 212 </xsd:documentation> 213 </xsd:annotation> 214 <xsd:complexContent> 215 <xsd:extension base="trd:PointType"> 216 <xsd:sequence/> 217 </xsd:extension> 218 </xsd:complexContent> 219 </xsd:complexType> 220 <xsd:complexType name="StopPointType"> 221 <xsd:annotation> 222 <xsd:documentation xml:lang="en"> 223 StopPoint on a Route of a Line of a PT Network 224 </xsd:documentation> 225 </xsd:annotation> 226 <xsd:complexContent> 227 <xsd:extension base="trd:PointType"> 228 <xsd:sequence> 229 <xsd:element name="name" type="xsd:string"/> 230 <xsd:element name="lineIdShortcut" type="trd:TridentIdType" minOccurs="0"/> 231 <xsd:element name="ptNetworkIdShortcut" type="trd:TridentIdType" minOccurs="0"/> 232 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 233 </xsd:sequence> 234 </xsd:extension> 235 </xsd:complexContent> 236 </xsd:complexType> 237 <xsd:complexType name="AirportStopPointType"> 238 <xsd:annotation> 239 <xsd:documentation xml:lang="en"> 240 An airport 241 </xsd:documentation> 242 </xsd:annotation> 243 <xsd:complexContent> 244 <xsd:extension base="trd:StopPointType"> 245 <xsd:sequence> 246 <xsd:element name="terminalIdentifier" type="xsd:string" minOccurs="0"/> 247 <xsd:element name="gateIdentifier" type="xsd:string" minOccurs="0"/> 248 </xsd:sequence> 249 </xsd:extension> 250 </xsd:complexContent> 251 </xsd:complexType> 252 <xsd:complexType name="BusStopPointType"> 253 <xsd:annotation> 254 <xsd:documentation xml:lang="en"> 255 An bus sopt point 256 </xsd:documentation> 257 </xsd:annotation> 258 <xsd:complexContent> 259 <xsd:extension base="trd:StopPointType"> 260 <xsd:sequence> 261 <xsd:element name="ptDirection" type="PTDirectionType" minOccurs="0"/> 262 <xsd:element name="streetName" type="xsd:string" minOccurs="0"/> 263 <xsd:element name="streetNumber" type="xsd:string" minOccurs="0"/> 264 <xsd:element name="platformIdentifier" type="xsd:string" minOccurs="0"/> 265 </xsd:sequence> 266 </xsd:extension> 267 </xsd:complexContent> 268 </xsd:complexType> 269 <xsd:complexType name="TramStopPointType"> 270 <xsd:annotation> 271 <xsd:documentation xml:lang="en"> 272 An TRAM stop point 273 </xsd:documentation> 274 </xsd:annotation> 275 <xsd:complexContent> 276 <xsd:extension base="trd:StopPointType"> 277 <xsd:sequence> 278 <xsd:element name="streetName" type="xsd:string" minOccurs="0"/> 279 <xsd:element name="streetNumber" type="xsd:string" minOccurs="0"/> 280 <xsd:element name="ptDirection" type="PTDirectionType" minOccurs="0"/> 281 <xsd:element name="platformIdentifier" type="xsd:string" minOccurs="0"/> 282 </xsd:sequence> 283 </xsd:extension> 284 </xsd:complexContent> 285 </xsd:complexType> 286 <xsd:complexType name="MetroStopPointType"> 287 <xsd:annotation> 288 <xsd:documentation xml:lang="en"> 289 An metro stop point 290 </xsd:documentation> 291 </xsd:annotation> 292 <xsd:complexContent> 293 <xsd:extension base="trd:StopPointType"> 294 <xsd:sequence> 295 <xsd:element name="lineName" type="xsd:string" minOccurs="0"/> 296 <xsd:element name="lineNumber" type="xsd:string" minOccurs="0"/> 297 <xsd:element name="platformIdentifier" type="xsd:string" minOccurs="0"/> 298 <xsd:element name="ptDirection" type="PTDirectionType" minOccurs="0"/> 299 </xsd:sequence> 300 </xsd:extension> 301 </xsd:complexContent> 302 </xsd:complexType> 303 <xsd:complexType name="RailwayStopPointType"> 304 <xsd:annotation> 305 <xsd:documentation xml:lang="en"> 306 An Railwaystop point 307 </xsd:documentation> 308 </xsd:annotation> 309 <xsd:complexContent> 310 <xsd:extension base="trd:StopPointType"> 311 <xsd:sequence> 312 <xsd:element name="stationInternalDivision" type="xsd:string" minOccurs="0"/> 313 <xsd:element name="platformIdentifier" type="xsd:string" minOccurs="0"/> 314 </xsd:sequence> 315 </xsd:extension> 316 </xsd:complexContent> 317 </xsd:complexType> 318 <!-- LINKS ===================================================== --> 319 <xsd:complexType name="GeneralLinkType"> 320 <xsd:annotation> 321 <xsd:documentation xml:lang="en"> 322 A General Link Between two Points (or object inheriting 323 323 from Point) 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 324 </xsd:documentation> 325 </xsd:annotation> 326 <xsd:complexContent> 327 <xsd:extension base="trd:LocationType"> 328 <xsd:sequence> 329 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 330 <xsd:element name="startOfLink" type="trd:TridentIdType"/> 331 <xsd:element name="endOfLink" type="trd:TridentIdType"/> 332 <xsd:element name="linkDistance" type="xsd:decimal" minOccurs="0"/> 333 </xsd:sequence> 334 </xsd:extension> 335 </xsd:complexContent> 336 </xsd:complexType> 337 <xsd:complexType name="ConnectionLinkType"> 338 <xsd:annotation> 339 <xsd:documentation xml:lang="en"> 340 The path between two places covered by any "personal" mean of transport 341 </xsd:documentation> 342 </xsd:annotation> 343 <xsd:complexContent> 344 <xsd:extension base="trd:GeneralLinkType"> 345 <xsd:sequence> 346 <xsd:element name="linkType" type="trd:ConnectionLinkTypeType" minOccurs="0"/> 347 <xsd:element name="defaultDuration" type="xsd:duration" minOccurs="0"/> 348 <xsd:element name="frequentTravellerDuration" type="xsd:duration" minOccurs="0"/> 349 <xsd:element name="occasionalTravellerDuration" type="xsd:duration" minOccurs="0"/> 350 <xsd:element name="mobilityRestrictedTravellerDuration" type="xsd:duration" minOccurs="0"/> 351 <xsd:element name="mobilityRestrictedSuitability" type="xsd:boolean" minOccurs="0"/> 352 <xsd:element name="stairsAvailability" type="xsd:boolean" minOccurs="0"/> 353 <xsd:element name="liftAvailability" type="xsd:boolean" minOccurs="0"/> 354 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 355 </xsd:sequence> 356 </xsd:extension> 357 </xsd:complexContent> 358 </xsd:complexType> 359 <xsd:complexType name="PTAccessLinkType"> 360 <xsd:annotation> 361 <xsd:documentation xml:lang="en"> 362 Link between a StopPoint and an AccessPoint. 363 </xsd:documentation> 364 </xsd:annotation> 365 <xsd:complexContent> 366 <xsd:extension base="trd:ConnectionLinkType"> 367 <xsd:sequence> 368 <xsd:element name="Comment" type="xsd:string" minOccurs="0"/> 369 </xsd:sequence> 370 </xsd:extension> 371 </xsd:complexContent> 372 </xsd:complexType> 373 <xsd:complexType name="NonPTAccessLinkType"> 374 <xsd:annotation> 375 <xsd:documentation xml:lang="en"> 376 Link between a StopPoint and an AccessPoint. 377 </xsd:documentation> 378 </xsd:annotation> 379 <xsd:complexContent> 380 <xsd:extension base="trd:ConnectionLinkType"> 381 <xsd:sequence> 382 <xsd:element name="Comment" type="xsd:string" minOccurs="0"/> 383 </xsd:sequence> 384 </xsd:extension> 385 </xsd:complexContent> 386 </xsd:complexType> 387 <xsd:complexType name="PTLinkType"> 388 <xsd:annotation> 389 <xsd:documentation xml:lang="en"> 390 A Link between two StopPoints 391 </xsd:documentation> 392 </xsd:annotation> 393 <xsd:complexContent> 394 <xsd:extension base="trd:GeneralLinkType"> 395 <xsd:sequence> 396 <xsd:element name="Comment" type="xsd:string" minOccurs="0"/> 397 </xsd:sequence> 398 </xsd:extension> 399 </xsd:complexContent> 400 </xsd:complexType> 401 <xsd:complexType name="CarType"> 402 <xsd:annotation> 403 <xsd:documentation xml:lang="en"> 404 The path between two places covered on the road network by a private means of transport (car, truck, etc). 405 </xsd:documentation> 406 </xsd:annotation> 407 <xsd:complexContent> 408 <xsd:extension base="trd:GeneralLinkType"> 409 <xsd:sequence> 410 <xsd:element name="Comment" type="xsd:string" minOccurs="0"/> 411 </xsd:sequence> 412 </xsd:extension> 413 </xsd:complexContent> 414 </xsd:complexType> 415 <!-- AREA ===================================================== --> 416 <xsd:complexType name="AreaType"> 417 <xsd:annotation> 418 <xsd:documentation xml:lang="en"> 419 An area made up of a set of Points 420 </xsd:documentation> 421 </xsd:annotation> 422 <xsd:complexContent> 423 <xsd:extension base="trd:LocationType"> 424 <xsd:sequence> 425 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 426 <xsd:element name="contains" type="trd:TridentIdType" maxOccurs="unbounded"/> 427 <xsd:element name="boundaryPoint" type="trd:TridentIdType" minOccurs="0" maxOccurs="unbounded"/> 428 <xsd:element name="centroidOfArea" type="trd:TridentIdType" minOccurs="0"/> 429 <!-- REMARK : The following element refers to Points via Id --> 430 </xsd:sequence> 431 </xsd:extension> 432 </xsd:complexContent> 433 </xsd:complexType> 434 <!-- ALLERT C TYPE DEFINITIONS ================================= --> 435 <!--Non utile pour amivif--> 436 436 </xsd:schema> -
applications/editors/josm/plugins/opendata/modules/fr.toulouse/resources/neptune_toulouse/trident/trident_PT_schema.xsd
r28018 r30731 4 4 <!-- File: trident_PT_schema.xsd --> 5 5 <xsd:schema 6 7 8 9 10 11 12 13 6 xmlns:trd="http://www.trident.org/schema/trident" 7 xmlns="http://www.trident.org/schema/trident" 8 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 9 targetNamespace="http://www.trident.org/schema/trident" 10 elementFormDefault="qualified" version="2.0"> 11 <xsd:annotation> 12 <xsd:appinfo>trident.xsd v1.00 2002-10</xsd:appinfo> 13 <xsd:documentation xml:lang="en"> 14 14 TRIDENT exchange schema. 15 15 PT Network Description 16 16 Copyright (c) 2001 TRIDENT consortium, All Rights Reserved. 17 18 19 20 21 17 </xsd:documentation> 18 </xsd:annotation> 19 <!-- included files (if any) --> 20 <xsd:include schemaLocation="trident_Global_schema.xsd"/> 21 <!-- ============================================================== 22 22 object declarations 23 23 ============================================================== --> 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 24 <xsd:simpleType name="PTConnectionLinkTypeType"> 25 <xsd:annotation> 26 <xsd:documentation xml:lang="en"> 27 Enumeration containing all the possible type of non PT access link 28 </xsd:documentation> 29 </xsd:annotation> 30 <xsd:restriction base="xsd:string"> 31 <xsd:enumeration value="Underground"/> 32 <xsd:enumeration value="Mixed"/> 33 <xsd:enumeration value="Overground"/> 34 </xsd:restriction> 35 </xsd:simpleType> 36 <!--PT NETWORK ===================================================== --> 37 <!-- Stop Point,PTLink, PTAccessLink and AccessPoint are defined in Location --> 38 <!-- PTLink is defined in Location --> 39 <xsd:complexType name="StopAreaType"> 40 <xsd:annotation> 41 <xsd:documentation xml:lang="en"> 42 A PT area made up of a set of PT Stop Points 43 </xsd:documentation> 44 </xsd:annotation> 45 <xsd:complexContent> 46 <xsd:extension base="trd:AreaType"> 47 <xsd:sequence> 48 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 49 </xsd:sequence> 50 </xsd:extension> 51 </xsd:complexContent> 52 </xsd:complexType> 53 <xsd:complexType name="RouteType"> 54 <xsd:annotation> 55 <xsd:documentation xml:lang="en"> 56 An ordered list of Stop Points on wich Journey 57 pattern are applied 58 </xsd:documentation> 59 </xsd:annotation> 60 <xsd:complexContent> 61 <xsd:extension base="trd:TridentObjectType"> 62 <xsd:sequence> 63 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 64 <xsd:element name="publishedName" type="xsd:string" minOccurs="0"/> 65 <xsd:element name="number" type="xsd:string" minOccurs="0"/> 66 <xsd:element name="direction" type="trd:PTDirectionType" minOccurs="0"/> 67 <xsd:element name="ptLinkId" type="trd:TridentIdType" maxOccurs="unbounded"/> 68 <xsd:element name="journeyPatternId" type="trd:TridentIdType" maxOccurs="unbounded"/> 69 <xsd:element name="wayBackRouteId" type="trd:TridentIdType" minOccurs="0"/> 70 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 71 </xsd:sequence> 72 </xsd:extension> 73 </xsd:complexContent> 74 </xsd:complexType> 75 <xsd:complexType name="LineType"> 76 <xsd:annotation> 77 <xsd:documentation xml:lang="en"> 78 78 A line is a set of Route _. 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 79 </xsd:documentation> 80 </xsd:annotation> 81 <xsd:complexContent> 82 <xsd:extension base="trd:LogicalLocationType"> 83 <xsd:sequence> 84 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 85 <xsd:element name="number" type="xsd:string" minOccurs="0"/> 86 <xsd:element name="publishedName" type="xsd:string" minOccurs="0"/> 87 <xsd:element name="transportModeName" type="trd:TransportModeNameType" minOccurs="0"/> 88 <xsd:element name="lineEnd" type="trd:TridentIdType" minOccurs="0" maxOccurs="unbounded"/> 89 <xsd:element name="routeId" type="trd:TridentIdType" maxOccurs="unbounded"/> 90 <xsd:element name="registration" type="trd:RegistrationType" minOccurs="0"/> 91 <xsd:element name="ptNetworkIdShortcut" type="trd:TridentIdType" minOccurs="0"/> 92 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 93 </xsd:sequence> 94 </xsd:extension> 95 </xsd:complexContent> 96 </xsd:complexType> 97 <xsd:complexType name="GroupOfLineType"> 98 <xsd:annotation> 99 <xsd:documentation xml:lang="en"> 100 100 A set of lines 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 101 </xsd:documentation> 102 </xsd:annotation> 103 <xsd:complexContent> 104 <xsd:extension base="trd:TridentObjectType"> 105 <xsd:sequence> 106 <xsd:element name="name" type="xsd:string"/> 107 <xsd:element name="lineId" type="trd:TridentIdType" maxOccurs="unbounded"/> 108 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 109 </xsd:sequence> 110 </xsd:extension> 111 </xsd:complexContent> 112 </xsd:complexType> 113 <xsd:complexType name="JourneyPatternType"> 114 <xsd:annotation> 115 <xsd:documentation xml:lang="en"> 116 Basically, JourneyPattern are some ordered list of 117 117 Stop Points, but these StopPoints have to be linked 118 118 together (by couples) 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 119 </xsd:documentation> 120 </xsd:annotation> 121 <xsd:complexContent> 122 <xsd:extension base="trd:TridentObjectType"> 123 <xsd:sequence> 124 <xsd:element name="name" type="xsd:string" minOccurs="0"/> 125 <xsd:element name="publishedName" type="xsd:string" minOccurs="0"/> 126 <xsd:element name="routeId" type="trd:TridentIdType"/> 127 <xsd:element name="origin" type="trd:TridentIdType" minOccurs="0"/> 128 <xsd:element name="destination" type="trd:TridentIdType" minOccurs="0"/> 129 <xsd:element name="stopPointList" type="trd:TridentIdType" minOccurs="2" maxOccurs="unbounded"/> 130 <xsd:element name="registration" type="trd:RegistrationType" minOccurs="0"/> 131 <xsd:element name="lineIdShortcut" type="trd:TridentIdType" minOccurs="0"/> 132 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 133 <!-- REMARK : The 3 following elements refers to StopPoints --> 134 <!-- The following field is not in the DM, it is only here to help to navigate in the data --> 135 </xsd:sequence> 136 </xsd:extension> 137 </xsd:complexContent> 138 </xsd:complexType> 139 <xsd:complexType name="VehicleJourneyAtStopType"> 140 <xsd:annotation> 141 <xsd:documentation xml:lang="en"> 142 142 Passing time on a stop point 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 143 </xsd:documentation> 144 </xsd:annotation> 145 <xsd:sequence> 146 <xsd:element name="stopPointId" type="trd:TridentIdType"/> 147 <xsd:element name="vehicleJourneyId" type="trd:TridentIdType" minOccurs="0"/> 148 <xsd:element name="connectingServiceId" type="trd:TridentIdType" minOccurs="0"/> 149 <xsd:choice> 150 <xsd:sequence> 151 <xsd:element name="arrivalTime" type="xsd:time" minOccurs="0"/> 152 <xsd:element name="departureTime" type="xsd:time"/> 153 <xsd:element name="waitingTime" type="xsd:time" minOccurs="0"/> 154 </xsd:sequence> 155 <xsd:sequence> 156 <xsd:element name="elapseDuration" type="xsd:duration"/> 157 </xsd:sequence> 158 </xsd:choice> 159 <xsd:element name="headwayFrequency" type="xsd:duration" minOccurs="0"/> 160 <xsd:element name="boardingAlightingPossibility" type="trd:BoardingAlightingPossibilityType" minOccurs="0"/> 161 <xsd:element name="order" type="xsd:positiveInteger" minOccurs="0"/> 162 <!-- REMARK : The name is Frequency, but in fact it's a period --> 163 </xsd:sequence> 164 </xsd:complexType> 165 <xsd:complexType name="VehicleJourneyType"> 166 <xsd:annotation> 167 <xsd:documentation xml:lang="en"> 168 168 Instance of a Journey Pattern 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 169 </xsd:documentation> 170 </xsd:annotation> 171 <xsd:complexContent> 172 <xsd:extension base="trd:TridentObjectType"> 173 <xsd:sequence> 174 <xsd:element name="routeId" type="trd:TridentIdType"/> 175 <xsd:element name="journeyPatternId" type="trd:TridentIdType" minOccurs="0"/> 176 <xsd:element name="publishedJourneyName" type="xsd:string" minOccurs="0"/> 177 <xsd:element name="publishedJourneyIdentifier" type="xsd:string" minOccurs="0"/> 178 <xsd:element name="transportMode" type="trd:TransportModeNameType" minOccurs="0"/> 179 <xsd:element name="vehicleTypeIdentifier" type="xsd:string" minOccurs="0"/> 180 <xsd:element name="statusValue" type="ServiceStatusValueType" minOccurs="0"/> 181 <xsd:element name="lineIdShortcut" type="trd:TridentIdType" minOccurs="0"/> 182 <xsd:element name="routeIdShortcut" type="trd:TridentIdType" minOccurs="0"/> 183 <xsd:element name="operatorId" type="trd:TridentIdType" minOccurs="0"/> 184 <xsd:element name="facility" type="xsd:string" minOccurs="0"/> 185 <xsd:element name="number" type="xsd:integer" minOccurs="0"/> 186 <xsd:element name="vehicleJourneyAtStop" type="trd:VehicleJourneyAtStopType" minOccurs="2" maxOccurs="unbounded"/> 187 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 188 <!-- REMARK : As the vehicle Type enumeration is not yet defined in the DD, 189 I used a string instead --> 190 <xsd:element name="timeSlotId" type="trd:TridentIdType" minOccurs="0"/> 191 </xsd:sequence> 192 </xsd:extension> 193 </xsd:complexContent> 194 </xsd:complexType> 195 <xsd:complexType name="PeriodType"> 196 <xsd:annotation> 197 <xsd:documentation xml:lang="en"> 198 198 Period during which a Vehicle Journey is applicable 199 200 201 202 203 204 205 206 207 208 199 </xsd:documentation> 200 </xsd:annotation> 201 <xsd:sequence> 202 <xsd:element name="startOfPeriod" type="xsd:date"/> 203 <xsd:element name="endOfPeriod" type="xsd:date"/> 204 </xsd:sequence> 205 </xsd:complexType> 206 <xsd:complexType name="ConnectingServiceType"> 207 <xsd:annotation> 208 <xsd:documentation xml:lang="en"> 209 209 Connecting service description 210 211 212 213 214 215 216 217 218 219 220 221 222 223 210 </xsd:documentation> 211 </xsd:annotation> 212 <xsd:complexContent> 213 <xsd:extension base="trd:TridentObjectType"> 214 <xsd:sequence> 215 <xsd:element name="minimumConnectingTime" type="xsd:duration"/> 216 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 217 </xsd:sequence> 218 </xsd:extension> 219 </xsd:complexContent> 220 </xsd:complexType> 221 <xsd:complexType name="CompanyType"> 222 <xsd:annotation> 223 <xsd:documentation xml:lang="en"> 224 224 PT Operator description 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 225 </xsd:documentation> 226 </xsd:annotation> 227 <xsd:complexContent> 228 <xsd:extension base="trd:TridentObjectType"> 229 <xsd:sequence> 230 <xsd:element name="name" type="xsd:string"/> 231 <xsd:element name="shortName" type="xsd:string" minOccurs="0"/> 232 <xsd:element name="organisationalUnit" type="xsd:string" minOccurs="0"/> 233 <xsd:element name="operatingDepartmentName" type="xsd:string" minOccurs="0"/> 234 <xsd:element name="code" type="xsd:string" minOccurs="0"/> 235 <xsd:element name="phone" type="xsd:string" minOccurs="0"/> 236 <xsd:element name="fax" type="xsd:string" minOccurs="0"/> 237 <xsd:element name="email" type="xsd:string" minOccurs="0"/> 238 <xsd:element name="registration" type="trd:RegistrationType" minOccurs="0"/> 239 </xsd:sequence> 240 </xsd:extension> 241 </xsd:complexContent> 242 </xsd:complexType> 243 <xsd:complexType name="TimetableType"> 244 <xsd:annotation> 245 <xsd:documentation xml:lang="en"> 246 246 TimeTable informations (merge of LineTimeTable and PointTimeTable) 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 247 </xsd:documentation> 248 </xsd:annotation> 249 <xsd:complexContent> 250 <xsd:extension base="trd:TridentObjectType"> 251 <xsd:sequence> 252 <xsd:element name="version" type="xsd:string" minOccurs="0"/> 253 <xsd:element name="period" type="trd:PeriodType" minOccurs="0" maxOccurs="unbounded"/> 254 <xsd:element name="calendarDay" type="xsd:date" minOccurs="0" maxOccurs="unbounded"/> 255 <xsd:element name="dayType" type="trd:DayTypeType" minOccurs="0" maxOccurs="unbounded"/> 256 <xsd:element name="vehicleJourneyId" type="trd:TridentIdType" minOccurs="0" maxOccurs="unbounded"/> 257 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 258 </xsd:sequence> 259 </xsd:extension> 260 </xsd:complexContent> 261 </xsd:complexType> 262 <xsd:complexType name="PTNetworkType"> 263 <xsd:annotation> 264 <xsd:documentation xml:lang="en"> 265 265 PT Network description, and link to all the entry point 266 266 for this network in the Data Model. 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 267 </xsd:documentation> 268 </xsd:annotation> 269 <xsd:complexContent> 270 <xsd:extension base="trd:TransportNetworkType"> 271 <xsd:sequence> 272 <xsd:element name="name" type="xsd:string"/> 273 <xsd:element name="registration" type="trd:RegistrationType" minOccurs="0"/> 274 <xsd:element name="sourceName" type="xsd:string" minOccurs="0"/> 275 <xsd:element name="sourceIdentifier" type="xsd:string" minOccurs="0"/> 276 <xsd:element name="sourceType" type="trd:SourceTypeType" minOccurs="0"/> 277 <xsd:element name="lineId" type="trd:TridentIdType" minOccurs="0" maxOccurs="unbounded"/> 278 <xsd:element name="comment" type="xsd:string" minOccurs="0"/> 279 <!--Exensions to the DM 1.3 --> 280 </xsd:sequence> 281 </xsd:extension> 282 </xsd:complexContent> 283 </xsd:complexType> 284 <xsd:complexType name="RoadNetworkType"> 285 <xsd:annotation> 286 <xsd:documentation xml:lang="en"> 287 287 PT Network description, and link to all the entry point 288 288 for this network in the Data Model. 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 289 </xsd:documentation> 290 </xsd:annotation> 291 <xsd:complexContent> 292 <xsd:extension base="trd:TransportNetworkType"> 293 <xsd:sequence> 294 <xsd:element name="Name" type="xsd:string"/> 295 <xsd:element name="JunctionId" type="trd:TridentIdType" minOccurs="0" maxOccurs="unbounded"/> 296 <xsd:element name="RoadElementId" type="trd:TridentIdType" minOccurs="0" maxOccurs="unbounded"/> 297 <xsd:element name="Comment" type="xsd:string" minOccurs="0"/> 298 </xsd:sequence> 299 </xsd:extension> 300 </xsd:complexContent> 301 </xsd:complexType> 302 <xsd:complexType name="TransportNetworkType" abstract="true"> 303 <xsd:annotation> 304 <xsd:documentation xml:lang="en"> 305 305 PT Network description, can be for Public Transport or Road Network. 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 306 </xsd:documentation> 307 </xsd:annotation> 308 <xsd:complexContent> 309 <xsd:extension base="trd:LogicalLocationType"> 310 <xsd:sequence> 311 <xsd:element name="versionDate" type="xsd:date"/> 312 <xsd:element name="description" type="xsd:string" minOccurs="0"/> 313 </xsd:sequence> 314 </xsd:extension> 315 </xsd:complexContent> 316 </xsd:complexType> 317 <!--PT Status ===================================================== --> 318 <xsd:complexType name="RegistrationType"> 319 <xsd:annotation> 320 <xsd:documentation xml:lang="en"> 321 321 Registration informations 322 323 324 325 326 322 </xsd:documentation> 323 </xsd:annotation> 324 <xsd:sequence> 325 <xsd:element name="registrationNumber" type="xsd:string"/> 326 <!-- REMARK: ApplicationType is said to be an enumeration, but the enumerated list is not in the DD 327 327 therfore, ApplicationType is mapped to a string --> 328 329 328 </xsd:sequence> 329 </xsd:complexType> 330 330 </xsd:schema> -
applications/editors/josm/plugins/opendata/src/org/geotools/data/shapefile/files/TabFiles.java
r30566 r30731 47 47 48 48 import org.geotools.data.DataUtilities; 49 import org.openstreetmap.josm.Main; 49 50 50 51 /** … … 52 53 */ 53 54 public class TabFiles extends ShpFiles { 54 55 55 56 /** 56 57 * The urls for each type of file that is associated with the shapefile. The … … 60 61 61 62 /** 62 * A read/write lock, so that we can have concurrent readers 63 * A read/write lock, so that we can have concurrent readers 63 64 */ 64 65 private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); … … 74 75 */ 75 76 private final MemoryMapCache mapCache = new MemoryMapCache(); 76 77 77 78 private boolean memoryMapCacheEnabled; 78 79 79 80 80 81 //////////////////////////////////////////////////// 81 82 82 83 public TabFiles(File headerFile, File dataFile) throws IllegalArgumentException { 83 84 super(fakeShpFile(headerFile)); // Useless but necessary … … 85 86 urls.put(ShpFileType.DBF, DataUtilities.fileToURL(dataFile)); 86 87 } 87 88 88 89 /** 89 90 * This is really ugly. Used only to give a fake shp file to ShpFiles constructor to avoid IllegalArgument at initialization. … … 92 93 return DataUtilities.fileToURL(new File(headerFile.getAbsolutePath()+".shp")); 93 94 } 94 95 95 96 private String baseName(Object obj) { 96 97 if (obj instanceof URL) { … … 99 100 return null; 100 101 } 101 102 102 103 private String toBase(String path) { 103 104 return path.substring(0, path.toLowerCase().lastIndexOf(".tab")); … … 105 106 106 107 //////////////////////////////////////////////////// 107 108 108 109 private void init(URL url) { 109 110 String base = baseName(url); … … 119 120 120 121 for (ShpFileType type : ShpFileType.values()) { 121 122 122 123 String extensionWithPeriod = type.extensionWithPeriod; 123 124 if (upperCase) { … … 126 127 extensionWithPeriod = extensionWithPeriod.toLowerCase(); 127 128 } 128 129 129 130 URL newURL; 130 131 String string = base + extensionWithPeriod; … … 139 140 140 141 // if the files are local check each file to see if it exists 141 // if not then search for a file of the same name but try all combinations of the 142 // if not then search for a file of the same name but try all combinations of the 142 143 // different cases that the extension can be made up of. 143 144 // IE Shp, SHP, Shp, ShP etc... … … 166 167 File[] files = directory.listFiles(new FilenameFilter(){ 167 168 169 @Override 168 170 public boolean accept(File dir, String name) { 169 171 return file.getName().equalsIgnoreCase(name); 170 172 } 171 173 172 174 }); 173 175 if( files.length>0 ){ … … 175 177 return files[0].toURI().toURL(); 176 178 } catch (MalformedURLException e) { 177 //ShapefileDataStoreFactory.LOGGER().log(Level.SEVERE, "",e);179 Main.error(e); 178 180 } 179 181 } … … 190 192 } 191 193 194 @Override 192 195 public void dispose() { 193 196 if (numberOfLocks() != 0) { … … 200 203 /** 201 204 * Writes to the log all the lockers and when they were constructed. 202 * 205 * 203 206 * @param logLevel 204 207 * the level at which to log. 205 208 */ 209 @Override 206 210 public void logCurrentLockers(Level logLevel) { 207 211 for (Collection<ShpFilesLocker> lockerList : lockers.values()) { … … 209 213 StringBuilder sb = new StringBuilder("The following locker still has a lock: "); 210 214 sb.append(locker); 211 //ShapefileDataStoreFactory.LOGGER().log(logLevel, sb.toString(), locker.getTrace());215 Main.error(sb.toString()); 212 216 } 213 217 } … … 217 221 * Returns the URLs (in string form) of all the files for the shapefile 218 222 * datastore. 219 * 223 * 220 224 * @return the URLs (in string form) of all the files for the shapefile 221 225 * datastore. 222 226 */ 227 @Override 223 228 public Map<ShpFileType, String> getFileNames() { 224 229 Map<ShpFileType, String> result = new HashMap<>(); … … 235 240 * Returns the string form of the url that identifies the file indicated by 236 241 * the type parameter or null if it is known that the file does not exist. 237 * 242 * 238 243 * <p> 239 244 * Note: a URL should NOT be constructed from the string instead the URL 240 245 * should be obtained through calling one of the aquireLock methods. 241 * 246 * 242 247 * @param type 243 248 * indicates the type of file the caller is interested in. 244 * 249 * 245 250 * @return the string form of the url that identifies the file indicated by 246 251 * the type parameter or null if it is known that the file does not 247 252 * exist. 248 253 */ 254 @Override 249 255 public String get(ShpFileType type) { 250 256 return urls.get(type).toExternalForm(); … … 255 261 * is not thread safe so do not count on it to have a completely accurate 256 262 * picture but it can be useful debugging 257 * 263 * 258 264 * @return the number of locks on the current set of shapefile files. 259 265 */ 266 @Override 260 267 public int numberOfLocks() { 261 268 int count = 0; … … 269 276 * get*Channel methods are used when reading or writing to the file is 270 277 * desired. 271 * 272 * 278 * 279 * 273 280 * @see #getInputStream(ShpFileType, FileReader) 274 281 * @see #getReadChannel(ShpFileType, FileReader) 275 282 * @see #getWriteChannel(ShpFileType, FileReader) 276 * 283 * 277 284 * @param type 278 285 * the type of the file desired. … … 280 287 * the object that is requesting the File. The same object 281 288 * must release the lock and is also used for debugging. 282 * @return the File type requested 283 */ 289 * @return the File type requested 290 */ 291 @Override 284 292 public File acquireReadFile(ShpFileType type, 285 293 FileReader requestor) { … … 290 298 return DataUtilities.urlToFile(url); 291 299 } 292 300 293 301 /** 294 302 * Acquire a URL for read only purposes. It is recommended that get*Stream or 295 303 * get*Channel methods are used when reading or writing to the file is 296 304 * desired. 297 * 298 * 305 * 306 * 299 307 * @see #getInputStream(ShpFileType, FileReader) 300 308 * @see #getReadChannel(ShpFileType, FileReader) 301 309 * @see #getWriteChannel(ShpFileType, FileReader) 302 * 310 * 303 311 * @param type 304 312 * the type of the file desired. … … 308 316 * @return the URL to the file of the type requested 309 317 */ 318 @Override 310 319 public URL acquireRead(ShpFileType type, FileReader requestor) { 311 320 URL url = urls.get(type); 312 321 if (url == null) 313 322 return null; 314 323 315 324 readWriteLock.readLock().lock(); 316 325 Collection<ShpFilesLocker> threadLockers = getCurrentThreadLockers(); … … 326 335 * desired. 327 336 * </p> 328 * 337 * 329 338 * @see #getInputStream(ShpFileType, FileReader) 330 339 * @see #getReadChannel(ShpFileType, FileReader) 331 340 * @see #getWriteChannel(ShpFileType, FileReader) 332 * 341 * 333 342 * @param type 334 343 * the type of the file desired. … … 338 347 * @return A result object containing the URL or the reason for the failure. 339 348 */ 349 @Override 340 350 public Result<URL, State> tryAcquireRead(ShpFileType type, 341 351 FileReader requestor) { … … 344 354 return new Result<>(null, State.NOT_EXIST); 345 355 } 346 356 347 357 boolean locked = readWriteLock.readLock().tryLock(); 348 358 if (!locked) { 349 359 return new Result<>(null, State.LOCKED); 350 360 } 351 361 352 362 getCurrentThreadLockers().add(new ShpFilesLocker(url, requestor)); 353 363 … … 358 368 * Unlocks a read lock. The file and requestor must be the the same as the 359 369 * one of the lockers. 360 * 370 * 361 371 * @param file 362 372 * file that was locked … … 364 374 * the class that requested the file 365 375 */ 376 @Override 366 377 public void unlockRead(File file, FileReader requestor) { 367 378 Collection<URL> allURLS = urls.values(); … … 376 387 * Unlocks a read lock. The url and requestor must be the the same as the 377 388 * one of the lockers. 378 * 389 * 379 390 * @param url 380 391 * url that was locked … … 382 393 * the class that requested the url 383 394 */ 395 @Override 384 396 public void unlockRead(URL url, FileReader requestor) { 385 397 if (url == null) { … … 404 416 405 417 /** 406 * Acquire a File for read and write purposes. 418 * Acquire a File for read and write purposes. 407 419 * <p> It is recommended that get*Stream or 408 420 * get*Channel methods are used when reading or writing to the file is 409 421 * desired. 410 422 * </p> 411 * 423 * 412 424 * @see #getInputStream(ShpFileType, FileReader) 413 425 * @see #getReadChannel(ShpFileType, FileReader) 414 426 * @see #getWriteChannel(ShpFileType, FileReader) 415 427 416 * 428 * 417 429 * @param type 418 430 * the type of the file desired. … … 422 434 * @return the File to the file of the type requested 423 435 */ 436 @Override 424 437 public File acquireWriteFile(ShpFileType type, 425 438 FileWriter requestor) { … … 431 444 } 432 445 /** 433 * Acquire a URL for read and write purposes. 446 * Acquire a URL for read and write purposes. 434 447 * <p> It is recommended that get*Stream or 435 448 * get*Channel methods are used when reading or writing to the file is 436 449 * desired. 437 450 * </p> 438 * 451 * 439 452 * @see #getInputStream(ShpFileType, FileReader) 440 453 * @see #getReadChannel(ShpFileType, FileReader) 441 454 * @see #getWriteChannel(ShpFileType, FileReader) 442 455 443 * 456 * 444 457 * @param type 445 458 * the type of the file desired. … … 449 462 * @return the URL to the file of the type requested 450 463 */ 464 @Override 451 465 public URL acquireWrite(ShpFileType type, FileWriter requestor) { 452 466 URL url = urls.get(type); … … 460 474 readWriteLock.writeLock().lock(); 461 475 threadLockers.add(new ShpFilesLocker(url, requestor)); 462 mapCache.cleanFileCache(url); 476 mapCache.cleanFileCache(url); 463 477 return url; 464 478 } 465 479 466 480 /** 467 481 * Tries to acquire a URL for read/write purposes. Returns null if the … … 471 485 * desired. 472 486 * </p> 473 * 487 * 474 488 * @see #getInputStream(ShpFileType, FileReader) 475 489 * @see #getReadChannel(ShpFileType, FileReader) 476 490 * @see #getWriteChannel(ShpFileType, FileReader) 477 491 478 * 492 * 479 493 * @param type 480 494 * the type of the file desired. … … 484 498 * @return A result object containing the URL or the reason for the failure. 485 499 */ 500 @Override 486 501 public Result<URL, State> tryAcquireWrite(ShpFileType type, 487 502 FileWriter requestor) { 488 503 489 504 URL url = urls.get(type); 490 505 if (url == null) { … … 511 526 * Unlocks a read lock. The file and requestor must be the the same as the 512 527 * one of the lockers. 513 * 528 * 514 529 * @param file 515 530 * file that was locked … … 517 532 * the class that requested the file 518 533 */ 534 @Override 519 535 public void unlockWrite(File file, FileWriter requestor) { 520 536 Collection<URL> allURLS = urls.values(); … … 529 545 * Unlocks a read lock. The requestor must be have previously obtained a 530 546 * lock for the url. 531 * 532 * 547 * 548 * 533 549 * @param url 534 550 * url that was locked … … 536 552 * the class that requested the url 537 553 */ 554 @Override 538 555 public void unlockWrite(URL url, FileWriter requestor) { 539 556 if (url == null) { … … 551 568 + " to have locked the url but it does not hold the lock for the URL"); 552 569 } 553 570 554 571 if(threadLockers.size() == 0) { 555 572 lockers.remove(Thread.currentThread()); … … 560 577 readWriteLock.writeLock().unlock(); 561 578 } 562 579 563 580 /** 564 581 * Returns the list of lockers attached to a given thread, or creates it if missing … … 586 603 } 587 604 } 588 605 589 606 /** 590 607 * Re-takes the read locks in preparation for lock downgrade … … 602 619 /** 603 620 * Determine if the location of this shapefile is local or remote. 604 * 621 * 605 622 * @return true if local, false if remote 606 623 */ … … 613 630 * files cannot be deleted return false. 614 631 */ 632 @Override 615 633 public boolean delete() { 616 634 BasicShpFileWriter requestor = new BasicShpFileWriter("ShpFiles for deleting all files"); … … 638 656 * Opens a input stream for the indicated file. A read lock is requested at 639 657 * the method call and released on close. 640 * 658 * 641 659 * @param type 642 660 * the type of file to open the stream to. … … 644 662 * the object requesting the stream 645 663 * @return an input stream 646 * 664 * 647 665 * @throws IOException 648 666 * if a problem occurred opening the stream. 649 667 */ 668 @Override 650 669 public InputStream getInputStream(ShpFileType type, 651 670 final FileReader requestor) throws IOException { … … 684 703 } 685 704 } 686 705 687 706 /** 688 707 * Opens a output stream for the indicated file. A write lock is requested at 689 708 * the method call and released on close. 690 * 709 * 691 710 * @param type 692 711 * the type of file to open the stream to. … … 694 713 * the object requesting the stream 695 714 * @return an output stream 696 * 715 * 697 716 * @throws IOException 698 717 * if a problem occurred opening the stream. 699 718 */ 719 @Override 700 720 public OutputStream getOutputStream(ShpFileType type, 701 721 final FileWriter requestor) throws IOException { … … 703 723 704 724 try { 705 725 706 726 OutputStream out; 707 727 if (isLocalTab()) { … … 713 733 out = connection.getOutputStream(); 714 734 } 715 735 716 736 FilterOutputStream output = new FilterOutputStream(out) { 717 737 … … 755 775 * channel is closed. 756 776 * </p> 757 * 777 * 758 778 * @param type 759 779 * the type of file to open the channel to. 760 780 * @param requestor 761 781 * the object requesting the channel 762 * 763 */ 782 * 783 */ 784 @Override 764 785 public ReadableByteChannel getReadChannel(ShpFileType type, 765 786 FileReader requestor) throws IOException { … … 770 791 771 792 File file = DataUtilities.urlToFile(url); 772 793 773 794 @SuppressWarnings("resource") 774 795 RandomAccessFile raf = new RandomAccessFile(file, "r"); … … 801 822 * a generic channel for remote urls, however both shape and dbf writing can 802 823 * only occur with a local FileChannel channel. 803 * 824 * 804 825 * <p> 805 826 * A write lock is obtained when this method is called and released when the 806 827 * channel is closed. 807 828 * </p> 808 * 809 * 829 * 830 * 810 831 * @param type 811 832 * the type of file to open the stream to. 812 833 * @param requestor 813 834 * the object requesting the stream 814 * 835 * 815 836 * @return a WritableByteChannel for the provided file type 816 * 837 * 817 838 * @throws IOException 818 839 * if there is an error opening the stream 819 840 */ 841 @Override 820 842 public WritableByteChannel getWriteChannel(ShpFileType type, 821 843 FileWriter requestor) throws IOException { … … 860 882 * Obtains a Storage file for the type indicated. An id is provided so that 861 883 * the same file can be obtained at a later time with just the id 862 * 884 * 863 885 * @param type 864 886 * the type of file to create and return 865 * 887 * 866 888 * @return StorageFile 867 889 * @throws IOException 868 890 * if temporary files cannot be created 869 891 */ 892 @Override 870 893 public StorageFile getStorageFile(ShpFileType type) throws IOException { 871 894 String baseName = getTypeName(); … … 877 900 } 878 901 902 @Override 879 903 public String getTypeName() { 880 904 String path = SHP.toBase(urls.get(SHP)); … … 888 912 return path.substring(slash, dot); 889 913 } 890 914 891 915 /** 892 916 * Internal method that the file channel decorators will call to allow reuse of the memory mapped buffers … … 899 923 * @throws IOException 900 924 */ 925 @Override 901 926 MappedByteBuffer map(FileChannel wrapped, URL url, MapMode mode, long position, long size) throws IOException { 902 927 if(memoryMapCacheEnabled) { … … 906 931 } 907 932 } 908 933 909 934 /** 910 935 * Returns the status of the memory map cache. When enabled the memory mapped portions of the files are cached and shared … … 912 937 * @param memoryMapCacheEnabled 913 938 */ 939 @Override 914 940 public boolean isMemoryMapCacheEnabled() { 915 941 return memoryMapCacheEnabled; … … 921 947 * @param memoryMapCacheEnabled 922 948 */ 949 @Override 923 950 public void setMemoryMapCacheEnabled(boolean memoryMapCacheEnabled) { 924 951 this.memoryMapCacheEnabled = memoryMapCacheEnabled; … … 931 958 * Returns true if the file exists. Throws an exception if the file is not 932 959 * local. 933 * 960 * 934 961 * @param fileType 935 962 * the type of file to check existance for. 936 * 963 * 937 964 * @return true if the file exists. 938 * 965 * 939 966 * @throws IllegalArgumentException 940 967 * if the files are not local. -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/AbstractModule.java
r30723 r30731 10 10 import java.util.List; 11 11 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry; 13 14 import org.openstreetmap.josm.gui.preferences.SourceEntry; … … 24 25 25 26 protected final ModuleInformation info; 26 27 27 28 public AbstractModule(ModuleInformation info) { 28 29 this.info = info; … … 50 51 ExtendedSourceEntry src; 51 52 if (handler != null && (src = handler.getMapPaintStyle()) != null) { 52 try { 53 // Copy style sheet to disk to allow JOSM to load it at startup (even making the plugin "early" does not allow it) 54 String path = OdPlugin.getInstance().getResourcesDirectory()+File.separator+src.url.replace(OdConstants.PROTO_RSRC, "").replace('/', File.separatorChar); 55 56 int n = 0; 57 byte[] buffer = new byte[4096]; 58 InputStream in = getClass().getResourceAsStream(src.url.substring(OdConstants.PROTO_RSRC.length()-1)); 59 new File(path.substring(0, path.lastIndexOf(File.separatorChar))).mkdirs(); 60 FileOutputStream out = new FileOutputStream(path); 53 // Copy style sheet to disk to allow JOSM to load it at startup 54 // (even making the plugin "early" does not allow it) 55 String path = OdPlugin.getInstance().getResourcesDirectory() + File.separator 56 + src.url.replace(OdConstants.PROTO_RSRC, "").replace('/', File.separatorChar); 57 58 int n = 0; 59 byte[] buffer = new byte[4096]; 60 try (InputStream in = getClass().getResourceAsStream( 61 src.url.substring(OdConstants.PROTO_RSRC.length()-1)); 62 FileOutputStream out = new FileOutputStream(path)) { 63 String dir = path.substring(0, path.lastIndexOf(File.separatorChar)); 64 if (new File(dir).mkdirs() && Main.isDebugEnabled()) { 65 Main.debug("Created directory: "+dir); 66 } 61 67 while ((n = in.read(buffer)) > 0) { 62 68 out.write(buffer, 0, n); 63 69 } 64 out.close();65 in.close();66 67 70 // Add source pointing to the local file 68 71 src.url = OdConstants.PROTO_FILE+path; 69 72 sources.add(src); 70 73 } catch (IOException e) { 71 System.err.println(e.getMessage());74 Main.error(e.getMessage()); 72 75 } 73 76 } … … 96 99 }; 97 100 } 98 101 99 102 @Override 100 103 public final List<AbstractDataSetHandler> getNewlyInstanciatedHandlers() { … … 104 107 try { 105 108 result.add(handlerClass.newInstance()); 106 } catch ( Throwablet) {107 System.err.println("Cannot instantiate "+handlerClass+" because of "+t.getClass().getName()+": "+t.getMessage());109 } catch (InstantiationException | IllegalAccessException t) { 110 Main.error("Cannot instantiate "+handlerClass+" because of "+t.getClass().getName()+": "+t.getMessage()); 108 111 } 109 112 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleHandler.java
r30723 r30731 247 247 + "Delete from preferences?</html>", module.name, module.className); 248 248 } 249 } catch ( Throwablee) {250 e.printStackTrace();249 } catch (Exception e) { 250 Main.error(e); 251 251 } 252 252 if (msg != null && confirmDisableModule(parent, msg, module.name)) { … … 550 550 551 551 final File[] files = moduleDir.listFiles(new FilenameFilter() { 552 @Override 552 553 public boolean accept(File dir, String name) { 553 554 return name.endsWith(".jar.new"); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java
r30723 r30731 143 143 this.attr.putAll(other.attr); 144 144 } 145 145 146 146 private static final ImageIcon extractIcon(String iconPath, File jarFile, boolean suppressWarnings) { 147 147 return new ImageProvider(iconPath).setArchive(jarFile).setMaxWidth(24).setMaxHeight(24).setOptional(true).setSuppressWarnings(suppressWarnings).get(); … … 234 234 try { 235 235 return klass.getConstructor(ModuleInformation.class).newInstance(this); 236 } catch ( Throwablet) {236 } catch (Exception t) { 237 237 throw new ModuleException(name, t); 238 238 } … … 251 251 try{ 252 252 return (Class<? extends Module>) Class.forName(className, true, classLoader); 253 } catch ( Throwablet) {253 } catch (Exception t) { 254 254 throw new ModuleException(name, t); 255 255 } … … 260 260 return f.toURI().toURL(); 261 261 } catch (MalformedURLException ex) { 262 Main.warn(ex.getMessage()); 262 263 return null; 263 264 } … … 337 338 } 338 339 339 /**340 * Sets the name341 * @param name342 */343 /*public void setName(String name) {344 this.name = name;345 }*/346 347 340 public ImageIcon getScaledIcon() { 348 341 if (icon == null)
Note:
See TracChangeset
for help on using the changeset viewer.