Skip to content

Commit

Permalink
Merge branch 'master' of github.com:B3Partners/brmo
Browse files Browse the repository at this point in the history
  • Loading branch information
mprins committed Nov 27, 2017
2 parents e93b603 + 302c841 commit 8c466b7
Show file tree
Hide file tree
Showing 12 changed files with 1,324 additions and 1,409 deletions.
16 changes: 16 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Probleem
XXXXXXX

### Versie
versie info: <!-- ga naar http://<server:poort>/brmo-service/about.jsp en kopier/plak -->

### Server log
<details><summary>server log:</summary>

```
DUBBELCLICK_en_PLAK_hier_stacktrace
```

</details>
4 changes: 0 additions & 4 deletions brmo-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@
<groupId>org.geotools</groupId>
<artifactId>gt-main</artifactId>
</dependency>
<dependency>
<groupId>nl.b3p</groupId>
<artifactId>topnlparser</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down
11 changes: 5 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@
<artifactId>gt-epsg-hsql</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${test.hsqldb.version}</version>
</dependency>
<dependency>
<groupId>org.geotools.xsd</groupId>
<artifactId>gt-xsd-gml3</artifactId>
Expand Down Expand Up @@ -386,12 +391,6 @@
<version>${test.h2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${test.hsqldb.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
1 change: 0 additions & 1 deletion topparser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
Expand Down
13 changes: 7 additions & 6 deletions topparser/src/main/java/nl/b3p/topnl/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,22 @@ public class Main {

public static void main (String[] args) throws IOException, JAXBException, ParseException, SQLException, JDOMException{
try {
/* BasicDataSource ds = new BasicDataSource();
ds.setUrl("jdbc:postgresql://localhost:5432/rsgb_topnl");
BasicDataSource ds = new BasicDataSource();
ds.setUrl("jdbc:postgresql://localhost:5432/topnl");
ds.setDriverClassName("org.postgresql.Driver");
ds.setUsername("rsgb");
ds.setPassword("rsgb");*/
ds.setPassword("rsgb");

BasicDataSource ds = new BasicDataSource();
/* BasicDataSource ds = new BasicDataSource();
ds.setUrl("jdbc:oracle:thin:@b3p-demoserver:1521/ORCL");
ds.setDriverClassName("oracle.jdbc.driver.OracleDriver");
ds.setUsername("top50nl");
ds.setPassword("top50nl");
ds.setPassword("top50nl");*/
Processor p = new Processor(ds);
// loadtopnl("/mnt/data/Documents/TopNL/Top50NL/TOP50NL_GML_Filechunks_november_2016/TOP50NL_GML_Filechunks", p, TopNLType.TOP50NL);
//loadtopnl("/mnt/data/Documents/TopNL/Top10NL/TOP10NL_GML_Filechuncks_november_2016/TOP10NL_GML_Filechuncks", p, TopNLType.TOP10NL);
loadtopnl("/mnt/data/Documents/TopNL/TOP100NL_GML_Filechunks_november_2016/TOP100NL_GML_Filechunks", p, TopNLType.TOP100NL);
loadtopnl("/mnt/data/Documents/TopNL/Tynaarlo/Top10NL", p, TopNLType.TOP10NL);
//loadtopnl("/mnt/data/Documents/TopNL/TOP100NL_GML_Filechunks_november_2016/TOP100NL_GML_Filechunks", p, TopNLType.TOP100NL);
//process("top250NL.gml", p);
//process("Hoogte_top250nl.xml", TopNLType.TOP250NL, p);
//process("Hoogte_top100nl.xml", TopNLType.TOP100NL, p);
Expand Down
2 changes: 1 addition & 1 deletion topparser/src/main/java/nl/b3p/topnl/Processor.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void importIntoDb(URL in, TopNLType type) throws JDOMException {
list.add(obj);
List<TopNLEntity> entities = convert(list, type);
save(entities, type);
} catch (JAXBException | IOException | SAXException | ParserConfigurationException | TransformerException | ParseException ex) {
} catch (JAXBException | IOException | SAXException | ParserConfigurationException | TransformerException | ParseException | IllegalArgumentException ex) {
log.error("Error parsing", ex);
} catch (ClassCastException cce) {
log.error(String.format(Locale.ROOT, "Verwerkingsfout van element %s locatie %s", localname, (jb == null ? "onbekend" : ll.getLocation(jb))), cce);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class Converter {

public abstract List<TopNLEntity> convert(List jaxbObjects) throws IOException, SAXException, ParserConfigurationException, TransformerException;

public abstract TopNLEntity convertObject(Object jaxbObject) throws IOException, SAXException, ParserConfigurationException, TransformerException;
public abstract TopNLEntity convertObject(Object jaxbObject) throws IOException, SAXException, ParserConfigurationException, TransformerException,IllegalArgumentException;

public abstract List<TopNLEntity> convertFeatureCollection(List jaxbObject) throws IOException, SAXException, ParserConfigurationException, TransformerException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import nl.b3p.topnl.top10nl.TerreinType;
import nl.b3p.topnl.top10nl.GeografischGebiedType;
import nl.b3p.topnl.top10nl.InrichtingselementType;
import nl.b3p.topnl.top10nl.PlaatsType;
import nl.b3p.topnl.top10nl.PlanTopografieType;
import nl.b3p.topnl.top10nl.ReliefType;
import nl.b3p.topnl.top10nl.Top10NlObjectType;
Expand Down Expand Up @@ -99,7 +100,7 @@ public List<TopNLEntity> convertFeatureCollection(List jaxbFeatureCollection) th
}

@Override
public TopNLEntity convertObject(Object featureMember) throws IOException, SAXException, ParserConfigurationException, TransformerException {
public TopNLEntity convertObject(Object featureMember) throws IOException, SAXException, ParserConfigurationException, TransformerException,IllegalArgumentException {
TopNLEntity entity = null;

if(featureMember instanceof FeatureMemberType){
Expand All @@ -116,8 +117,8 @@ public TopNLEntity convertObject(Object featureMember) throws IOException, SAXEx
entity = convertGeografischGebied(featureMember);
} else if (featureMember instanceof InrichtingselementType) {
entity = convertInrichtingselement(featureMember);
/* } else if (featureMember instanceof PlaatsType) {
entity = convertPlaats(featureMember);*/
} else if (featureMember instanceof PlaatsType) {
entity = convertPlaats(featureMember);
} else if (featureMember instanceof RegistratiefGebiedType) {
entity = convertRegistratiefGebied(featureMember);
} else if (featureMember instanceof ReliefType) {
Expand Down Expand Up @@ -245,7 +246,19 @@ public Inrichtingselement convertInrichtingselement(Object jaxbObject) throws IO

@Override
public Plaats convertPlaats(Object jaxbObject) throws IOException, SAXException, ParserConfigurationException, TransformerException {
throw new IllegalArgumentException("Plaats does not exist in Top10NL");
PlaatsType p = (PlaatsType) jaxbObject;

Plaats pl = new Plaats();
convertTop10NlObjectType(p, pl);

pl.setGeometrie(gc.convertGeometry(p.getGeometrie()));

pl.setAantalInwoners(p.getAantalinwoners() != null ? p.getAantalinwoners().longValue() : null);
pl.setNaamFries(p.getNaamFries());
pl.setNaamNL(p.getNaamNL());
pl.setNaamOfficieel(p.getNaamOfficieel());
pl.setTypeGebied(p.getTypeGebied().getValue());
return pl;
}

@Override
Expand Down Expand Up @@ -436,7 +449,7 @@ public Wegdeel convertWegdeel(Object jaxbObject) throws IOException, SAXExceptio
}
rg.setTypeInfrastructuur(r.getTypeInfrastructuur() != null ? r.getTypeInfrastructuur().getValue() : null);
rg.setVerhardingstype(r.getVerhardingstype().getValue());
rg.setVerhardingsbreedteklasse(r.getVerhardingsbreedteklasse().getValue());
rg.setVerhardingsbreedteklasse(r.getVerhardingsbreedteklasse() != null ? r.getVerhardingsbreedteklasse().getValue() : null);
rg.setGescheidenRijbaan(r.getGescheidenRijbaan() ==BRTJaNeeWaardeType.JA);
rg.setaWegnummer(String.join(",", r.getAWegnummer()));
rg.setnWegnummer(String.join(",", r.getNWegnummer()));
Expand Down
Loading

0 comments on commit 8c466b7

Please sign in to comment.