Skip to content

Commit 825e0a4

Browse files
committed
Merge pull request #41 from jericks/geotools_12
Upgrade to GeoTools 12 and JTS 1.3
2 parents c4032bb + cb49051 commit 825e0a4

7 files changed

Lines changed: 21 additions & 14 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: java
22

33
jdk:
4-
- openjdk6
4+
- openjdk7
55

pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<packaging>jar</packaging>
77
<version>1.1.0-SNAPSHOT</version>
88
<properties>
9-
<gt.version>9.0</gt.version>
9+
<gt.version>12.0</gt.version>
1010
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1111
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1212
</properties>
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.vividsolutions</groupId>
3232
<artifactId>jts</artifactId>
33-
<version>1.12</version>
33+
<version>1.13</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>junit</groupId>
@@ -142,13 +142,18 @@
142142
<artifactId>maven-compiler-plugin</artifactId>
143143
<version>2.3</version>
144144
<configuration>
145-
<source>1.5</source>
146-
<target>1.5</target>
145+
<source>1.7</source>
146+
<target>1.7</target>
147147
<debug>true</debug>
148148
<encoding>UTF-8</encoding>
149149
<fork>true</fork>
150150
</configuration>
151151
</plugin>
152+
<plugin>
153+
<groupId>org.apache.maven.plugins</groupId>
154+
<artifactId>maven-surefire-plugin</artifactId>
155+
<version>2.10</version>
156+
</plugin>
152157
<plugin>
153158
<inherited>true</inherited>
154159
<groupId>org.apache.maven.plugins</groupId>

src/main/resources/org/geoscript/js/lib/geoscript/filter/expression.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var Expression = exports.Expression = UTIL.extend(GeoObject, {
4444
var text;
4545
if (this._expression) {
4646
if (this.literal) {
47-
text = this._expression.getLiteral();
47+
text = this._expression.getValue();
4848
if ((text instanceof java.lang.String) || typeof text === "string") {
4949
text = "'" + String(text) + "'";
5050
} else {
@@ -62,7 +62,7 @@ var Expression = exports.Expression = UTIL.extend(GeoObject, {
6262
* This expression is just a literal value.
6363
*/
6464
get literal() {
65-
return Boolean(this._expression instanceof Packages.org.geotools.filter.LiteralExpressionImpl);
65+
return Boolean(this._expression instanceof Packages.org.opengis.filter.expression.Literal);
6666
},
6767

6868
get config() {

src/main/resources/org/geoscript/js/lib/geoscript/filter/filter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,11 @@ Filter.not = function(filter) {
198198
};
199199

200200
Filter.fids = function(fids) {
201-
var _filter = FilterFactory2.createFidFilter();
201+
var idFilters = []
202202
for (var i=0, len=fids.length; i<len; ++i) {
203-
_filter.addFid(fids[i]);
203+
idFilters.push(FilterFactory2.featureId(fids[i]));
204204
}
205+
var _filter = FilterFactory2.id(idFilters);
205206
return Filter.from_(_filter);
206207
};
207208

src/main/resources/org/geoscript/js/lib/geoscript/layer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,11 @@ var Layer = UTIL.extend(GeoObject, {
486486
update: function() {
487487
var modified = this.cache.modifiedFeatures;
488488
if (modified) {
489-
var _filter = FilterFactory2.createFidFilter();
489+
var idFilters = [];
490490
for (var id in modified) {
491-
_filter.addFid(id);
491+
idFilters.push(FilterFactory2.featureId(id));
492492
}
493+
var _filter = FilterFactory2.id(idFilters);
493494
var results = this._source.dataStore.getFeatureWriter(this.name, _filter, Transaction.AUTO_COMMIT);
494495
try {
495496
while (results.hasNext()) {

src/test/resources/org/geoscript/js/tests/geoscript/style/test_style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ exports["test: _style (multiple featureTypeStyle)"] = function() {
184184
ASSERT.equal(rule.getMinScaleDenominator(), 100000, "first rule has correct min scale denominator");
185185
ASSERT.equal(rule.getMaxScaleDenominator(), 200000, "first rule has correct max scale denominator");
186186
ASSERT.ok(rule.getFilter() instanceof geotools.filter.IsEqualsToImpl, "first rule has filter");
187-
ASSERT.equal(String(rule.getFilter().getRightValue()), "foo", "first rule filter is good");
187+
ASSERT.equal(String(rule.getFilter().getExpression2().getValue()), "foo", "first rule filter is good");
188188

189189
var symbolizers = rule.getSymbolizers();
190190
ASSERT.equal(symbolizers.length, 1, "one symbolizer in first feature type style");

src/test/resources/org/geoscript/js/tests/geoscript/test_filter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ var FILTER = require("geoscript/filter");
55
exports["test and"] = function() {
66

77
var f = FILTER.and(["name = 'foo'", "type = 'bar'"]);
8-
ASSERT.strictEqual(f.cql, "(name = 'foo' AND type = 'bar')", "correct cql");
8+
ASSERT.strictEqual(f.cql, "name = 'foo' AND type = 'bar'", "correct cql");
99

1010
};
1111

1212
exports["test or"] = function() {
1313

1414
var f = FILTER.or(["name = 'foo'", "type = 'bar'"]);
15-
ASSERT.strictEqual(f.cql, "(name = 'foo' OR type = 'bar')", "correct cql");
15+
ASSERT.strictEqual(f.cql, "name = 'foo' OR type = 'bar'", "correct cql");
1616

1717
};
1818

0 commit comments

Comments
 (0)