Revision: 5677
          http://sourceforge.net/p/jump-pilot/code/5677
Author:   edso
Date:     2018-01-22 11:33:09 +0000 (Mon, 22 Jan 2018)
Log Message:
-----------
always keep envelope in JML/GML as suggested by Jukka on the ml
"[JPP-Devel] New SRID system and unknown SRID"
https://sourceforge.net/p/jump-pilot/mailman/message/36195148/

Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/io/GMLWriter.java

Modified: core/trunk/src/com/vividsolutions/jump/io/GMLWriter.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/io/GMLWriter.java    2018-01-19 
13:34:00 UTC (rev 5676)
+++ core/trunk/src/com/vividsolutions/jump/io/GMLWriter.java    2018-01-22 
11:33:09 UTC (rev 5677)
@@ -206,19 +206,21 @@
         // write a bounded by box definition setting an srid for the whole 
dataset
         // Workaround or convenience as OGC writes in the WFS 2.0 standard:
         //   11.3.6 Inheritance rules for srsName values
+        String srsAttrib="";
         if (getSrid(featureCollection) > 0){
-          Envelope env = featureCollection.getEnvelope();
-          DecimalFormat df = new DecimalFormat("#,##0.00", new 
DecimalFormatSymbols(Locale.US));
-          df.setGroupingUsed(false);
-          String envString = df.format(env.getMinX()) + "," + 
df.format(env.getMinY()) + " " + df.format(env.getMaxX())
-              + "," + df.format(env.getMaxY());
-          buffWriter.write(
-            "  <gml:boundedBy>\n" +
-            "    <gml:Box 
srsName=\"http://www.opengis.net/gml/srs/epsg.xml#"+getSrid(featureCollection)+"\">\n"
 +
-            "      <gml:coordinates decimal=\".\" cs=\",\" ts=\" \">" + 
envString + "</gml:coordinates>\n" +
-            "    </gml:Box>\n" +
-            "  </gml:boundedBy>\n");
+          srsAttrib=" 
srsName=\"http://www.opengis.net/gml/srs/epsg.xml#"+getSrid(featureCollection)+"\"";
         }
+        Envelope env = featureCollection.getEnvelope();
+        DecimalFormat df = new DecimalFormat("#,##0.00", new 
DecimalFormatSymbols(Locale.US));
+        df.setGroupingUsed(false);
+        String envString = df.format(env.getMinX()) + "," + 
df.format(env.getMinY()) + " " + df.format(env.getMaxX())
+            + "," + df.format(env.getMaxY());
+        buffWriter.write(
+          "  <gml:boundedBy>\n" +
+          "    <gml:Box"+srsAttrib+">\n" +
+          "      <gml:coordinates decimal=\".\" cs=\",\" ts=\" \">" + 
envString + "</gml:coordinates>\n" +
+          "    </gml:Box>\n" +
+          "  </gml:boundedBy>\n");
 
         long milliSeconds = 0;
         int count = 0;
@@ -450,7 +452,7 @@
             "<?xml version='1.0' encoding='UTF-8'?>\n<JCSDataFile 
xmlns:gml=\"http://www.opengis.net/gml\"; 
xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\"; >\n" +
             inputTemplate + "<" + standard_featureCollection + ">\n");
 
-        colHeader = "  <" + standard_feature + "> \n";
+        colHeader = "  <" + standard_feature + ">\n";
 
         for (t = 0; t < fcmd.getAttributeCount(); t++) {
             colName = fcmd.getAttributeName(t);
@@ -471,9 +473,8 @@
             result.addItem(colText, colCode);
         }
 
-        result.setFeatureFooter(colHeader + "  </" + standard_feature +
-            ">\n");
-        result.setFooterText("  </" + standard_featureCollection +
+        result.setFeatureFooter(colHeader + "  </" + standard_feature + ">");
+        result.setFooterText("</" + standard_featureCollection +
             ">\n</JCSDataFile>\n");
 
         return result;
@@ -498,8 +499,7 @@
         // write a bounded by box definition setting an srid for the whole 
dataset
         // Workaround or convenience as OGC writes in the WFS 2.0 standard:
         //   11.3.6 Inheritance rules for srsName values
-        if (getSrid(fc) > 0)
-          result += "<CRSElement>boundedBy</CRSElement>\n";
+        result += "<CRSElement>boundedBy</CRSElement>\n";
         result += "<ColumnDefinitions>\n";
 
         //fill in each of the column defs


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to