]> granicus.if.org Git - postgis/commitdiff
Drop useless SRID from geometry when downloading EWKB format.
authorSandro Santilli <strk@keybit.net>
Wed, 22 Dec 2004 10:29:09 +0000 (10:29 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 22 Dec 2004 10:29:09 +0000 (10:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1176 b70326c6-7e19-0410-871a-916f4a2858ee

loader/pgsql2shp.c

index 6f522d75caff23daf231f1da68c37b144cd61815..e22f72e6ef551d2ed0394d2be867a8ecb2be79ed 100644 (file)
@@ -2733,14 +2733,20 @@ initialize()
 
 
 #ifdef HEXWKB
-                               sprintf(buf, "asbinary(\"%s\", 'XDR')",
-                                       mainscan_flds[i]);
-#else
                                if ( pgis_major_version > 0 )
+                               {
+                                       sprintf(buf, "asEWKB(setSRID(\"%s\", -1), 'XDR')", mainscan_flds[i]);
+                               }
+                               else
                                {
                                        sprintf(buf, "asbinary(\"%s\", 'XDR')",
                                                mainscan_flds[i]);
                                }
+#else
+                               if ( pgis_major_version > 0 )
+                               {
+                                       sprintf(buf, "asEWKB(setSRID(\"%s\", -1), 'XDR')", mainscan_flds[i]);
+                               }
                                else
                                {
                                        sprintf(buf, "asbinary(\"%s\", 'XDR')::bytea", mainscan_flds[i]);
@@ -2752,14 +2758,20 @@ initialize()
                        {
 
 #ifdef HEXWKB
-                               sprintf(buf, "asbinary(\"%s\", 'NDR')",
-                                       mainscan_flds[i]);
-#else // ndef HEXWKB
                                if ( pgis_major_version > 0 )
+                               {
+                                       sprintf(buf, "asEWKB(setSRID(\"%s\", -1), 'NDR')", mainscan_flds[i]);
+                               }
+                               else
                                {
                                        sprintf(buf, "asbinary(\"%s\", 'NDR')",
                                                mainscan_flds[i]);
                                }
+#else // ndef HEXWKB
+                               if ( pgis_major_version > 0 )
+                               {
+                                       sprintf(buf, "asEWKB(setSRID(\"%s\", -1), 'NDR')", mainscan_flds[i]);
+                               }
                                else
                                {
                                        sprintf(buf, "asbinary(\"%s\", 'NDR')::bytea",
@@ -3103,6 +3115,9 @@ create_usrquerytable()
 
 /**********************************************************************
  * $Log$
+ * Revision 1.70  2004/12/22 10:29:09  strk
+ * Drop useless SRID from geometry when downloading EWKB format.
+ *
  * Revision 1.69  2004/12/15 08:46:47  strk
  * Fixed memory leaks depending on input size.
  *