-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial add. Modify licence to EUPL.
- Loading branch information
Showing
10 changed files
with
640 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,2 @@ | ||
*.class | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
/bin | ||
/build |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'eclipse' | ||
apply plugin: 'application' | ||
|
||
version = "0.1" | ||
mainClassName = "com.mecatran.insee.extract.Main" | ||
|
||
repositories { | ||
// Warning -- GeoTools repo should be defined | ||
// BEFORE Maven central, otherwise jai-core is | ||
// not found. To check out why, please see: | ||
// https://issues.gradle.org/browse/GRADLE-2395 | ||
maven { | ||
// GeoTools (CRS conversion) | ||
url "http://download.osgeo.org/webdav/geotools/" | ||
} | ||
mavenCentral() | ||
maven { | ||
// dans-dbf-lib (dBase reader) | ||
url "http://matsim.org/m2repo" | ||
} | ||
} | ||
|
||
dependencies { | ||
// dans-dbf dBase lib has a cleaner interface, but is 10x slower than xBaseJ... | ||
// compile 'nl.knaw.dans.common:dans-dbf-lib:1.0.0-beta-07' | ||
compile 'org.xBaseJ:xbasej:20091203' | ||
compile 'org.geotools:gt-epsg-hsql:12.1' | ||
compile 'org.geotools:gt-geotiff:12.1' | ||
compile 'com.beust:jcommander:1.30' | ||
compile 'org.apache.commons:commons-csv:1.0' | ||
} | ||
|
||
task "create-dirs" << { | ||
sourceSets*.java.srcDirs*.each { it.mkdirs() } | ||
sourceSets*.resources.srcDirs*.each { it.mkdirs() } | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes 'Implementation-Version': version | ||
} } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This software is released under the European Union Public Licence (EUPL v.1.1). | ||
* https://joinup.ec.europa.eu/software/page/eupl/licence-eupl | ||
* | ||
* Copyright (c) 2015 Mecatran / DREAL PACA | ||
*/ | ||
package com.mecatran.insee.extract; | ||
|
||
import org.geotools.geometry.DirectPosition2D; | ||
import org.opengis.geometry.DirectPosition; | ||
import org.opengis.referencing.crs.CoordinateReferenceSystem; | ||
|
||
public class CRSUtils { | ||
|
||
/** | ||
* @param sourceCRS | ||
* The source CRS (Currently only EPSG:3035) | ||
* @param strCoord | ||
* The coordinate in string format (NyyyyyExxxxx) | ||
* @return | ||
*/ | ||
public static DirectPosition parseCRS(CoordinateReferenceSystem sourceCRS, | ||
String strCoord) { | ||
String crsCode = sourceCRS.getName().getCode(); | ||
if (!crsCode.equals("ETRS89 / LAEA Europe")) | ||
throw new UnsupportedOperationException(); | ||
String northStr = strCoord.substring(strCoord.indexOf('N') + 1, | ||
strCoord.indexOf('E')); | ||
String eastStr = strCoord.substring(strCoord.indexOf('E') + 1, | ||
strCoord.length()); | ||
double north = Integer.parseInt(northStr); | ||
double east = Integer.parseInt(eastStr); | ||
return new DirectPosition2D(sourceCRS, east, north); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* This software is released under the European Union Public Licence (EUPL v.1.1). | ||
* https://joinup.ec.europa.eu/software/page/eupl/licence-eupl | ||
* | ||
* Copyright (c) 2015 Mecatran / DREAL PACA | ||
*/ | ||
package com.mecatran.insee.extract; | ||
|
||
import org.geotools.coverage.grid.GridCoordinates2D; | ||
import org.opengis.geometry.DirectPosition; | ||
|
||
public class Carreau { | ||
|
||
/* Position in data CRS (EPSG:3035) */ | ||
public DirectPosition position; | ||
|
||
public GridCoordinates2D gridPosition; | ||
|
||
/* Carreau ID */ | ||
public String id; | ||
|
||
/* Rectangle ID */ | ||
public String idRect; | ||
|
||
public float nbIndividus; | ||
|
||
public float nbMenages; | ||
|
||
public float[] varsSummed; | ||
public float[] varsNormalized; | ||
|
||
} |
Oops, something went wrong.