@@ -7,7 +7,7 @@ |
<!-- the Compile on Save feature is turned off for the project. --> |
<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
<!-- in the project's Project Properties dialog box.--> |
-<project name="csip-example" default="default" basedir="."> |
+<project name="csip-gis" default="default" basedir="."> |
<description>Builds, tests, and runs the project csip-eft.</description> |
<import file="nbproject/build-impl.xml"/> |
<!-- |
@@ -5,6 +5,7 @@ |
*/ |
package m.gis; |
|
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.Match; |
import com.vividsolutions.jts.algorithm.MinimumDiameter; |
import com.vividsolutions.jts.geom.Geometry; |
import com.vividsolutions.jts.io.ParseException; |
@@ -247,8 +248,7 @@ |
})); |
String sql = "CREATE TABLE " + schemaTable + " AS " + |
"SELECT " + LocalStringUtils.join(props, ", ") + " " + |
- "FROM " + one.getSchemaTable() + ", " + two.getSchemaTable() + " " + |
- "WHERE " + one.getSchemaTable() + ".the_geom && " + two.getSchemaTable() + ".the_geom"; |
+ "FROM " + one.getSchemaTable() + ", " + two.getSchemaTable(); |
LOG.log(Level.INFO, sql); |
stmt.executeUpdate(sql); |
|
@@ -661,8 +661,8 @@ |
for (String col : cols) { |
if (!colsExclude.contains(col)) { |
String prop = lyr.getSchemaTable() + "." + col + " AS " + col; |
- if (useTableSuffix && hasSuffix(lyr)) { |
- prop += "_" + lyr.table.charAt(lyr.table.length() - 1); |
+ if (useTableSuffix && hasNumberedSuffix(lyr)) { |
+ prop += "_" + getNumberedSuffix(lyr); |
} |
props.add(prop); |
} |
@@ -670,8 +670,18 @@ |
return LocalStringUtils.join(props, ","); |
} |
|
- public boolean hasSuffix(Layer lyr) { |
- return RegularExpression.matches("_[0-9]$", lyr.table); |
+ public boolean hasNumberedSuffix(Layer lyr) { |
+ return RegularExpression.matches("_[0-9]{1,3}$", lyr.table); |
+ } |
+ |
+ public String getNumberedSuffix(Layer lyr) { |
+ String res = ""; |
+ Pattern ptn = Pattern.compile("_([0-9]{1,3}$)"); |
+ Matcher mchr = ptn.matcher(lyr.table); |
+ if (mchr.find()) { |
+ res = mchr.group(1); |
+ } |
+ return res; |
} |
|
} |