Advertisement
kijato

Minden pont összehasonlítása minden ponttal (SpatiaLite)

Jul 12th, 2020
1,467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 5.61 KB | None | 0 0
  1. "
  2. Adott két pontlista (mindegyik kb 2000 pont). Ezek kvázi ellenőrző pontok, de pontszám nélkül! Szóval hagyományos összehasonlítás nem megoldható. Ti milyen programban oldanátok azt meg hogy csak koordináta alapján keresse meg a két listában az "összeillő" pontokat és számoljon rá eltérést?
  3. ...
  4. FRISSÍTÉS: A két lista mégsem ugyanannyi pontból áll, (500 vs 2000) szóval bőven van olyan pont aminek nincs "párja".
  5. "
  6.  
  7. A.txt
  8. -----
  9.     x   y
  10.     85.92   72.85
  11.     11.66   1.62
  12.     68.26   33.07
  13.     86.03   71.64
  14.     41.84   32.38
  15.     49.67   23.6
  16.     83.09   65.6
  17.     91.78   78.33
  18.     38.13   74.69
  19.  
  20.  
  21. B.txt
  22. -----
  23.     x   y
  24.     85.92   72.85
  25.     12.00   2.53
  26.     68.29   33.09
  27.     86.44   72.47
  28.     42.6    33.14
  29.     50.37   24.43
  30.     83.1    65.63
  31.     91.87   78.37
  32.     38.17   74.68
  33.  
  34.  
  35. Download: https://www.gaia-gis.it/spatialite-2.3.1/spatialite-gui-win-x86-1.2.1.zip
  36.         [ https://www.gaia-gis.it/spatialite-2.3.1/binaries.html ]
  37.         [ http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html ]
  38.  
  39.  
  40. Run: spatialite-gui.exe
  41.  
  42.     1. Files / "Load CSV/TXT" / A.txt -> tabla "A"
  43.  
  44.     2. Files / "Load CSV/TXT" / B.txt -> tabla "B"
  45.  
  46.     3. Run SQL:
  47.             SELECT a.y, a.x, b.y, b.x, distance(a.geom,b.geom)
  48.             FROM ( SELECT y,x,geomfromtext('POINT('||x||' '||y||')',23700) geom FROM "A" ) a,
  49.                  ( SELECT y,x,geomfromtext('POINT('||x||' '||y||')',23700) geom FROM "B" ) b
  50.             --where distance(a.geom,b.geom)<1
  51.             ORDER BY 5
  52.  
  53.     4. RESULT:
  54.             72.850000   85.920000   72.850000   85.920000   0.000000
  55.             65.600000   83.090000   65.630000   83.100000   0.031623
  56.             33.070000   68.260000   33.090000   68.290000   0.036056
  57.             74.690000   38.130000   74.680000   38.170000   0.041231
  58.             78.330000   91.780000   78.370000   91.870000   0.098489
  59.             72.850000   85.920000   72.470000   86.440000   0.644050
  60.             71.640000   86.030000   72.470000   86.440000   0.925743
  61.             1.620000    11.660000   2.530000    12.000000   0.971442
  62.             32.380000   41.840000   33.140000   42.600000   1.074802
  63.             23.600000   49.670000   24.430000   50.370000   1.085772
  64.             71.640000   86.030000   72.850000   85.920000   1.214990
  65.             71.640000   86.030000   65.630000   83.100000   6.686180
  66.             65.600000   83.090000   72.470000   86.440000   7.643258
  67.             72.850000   85.920000   65.630000   83.100000   7.751181
  68.             65.600000   83.090000   72.850000   85.920000   7.782763
  69.             78.330000   91.780000   72.470000   86.440000   7.928127
  70.             78.330000   91.780000   72.850000   85.920000   8.023092
  71.             72.850000   85.920000   78.370000   91.870000   8.116212
  72.             71.640000   86.030000   78.370000   91.870000   8.910584
  73.             32.380000   41.840000   24.430000   50.370000   11.660334
  74.             23.600000   49.670000   33.140000   42.600000   11.874195
  75.             78.330000   91.780000   65.630000   83.100000   15.382861
  76.             65.600000   83.090000   78.370000   91.870000   15.497138
  77.             33.070000   68.260000   24.430000   50.370000   19.867101
  78.             23.600000   49.670000   33.090000   68.290000   20.898911
  79.             33.070000   68.260000   33.140000   42.600000   25.660095
  80.             32.380000   41.840000   33.090000   68.290000   26.459528
  81.             65.600000   83.090000   33.090000   68.290000   35.720304
  82.             33.070000   68.260000   65.630000   83.100000   35.782387
  83.             74.690000   38.130000   33.140000   42.600000   41.789752
  84.             32.380000   41.840000   2.530000    12.000000   42.207204
  85.             71.640000   86.030000   33.090000   68.290000   42.435953
  86.             32.380000   41.840000   74.680000   38.170000   42.458908
  87.             23.600000   49.670000   2.530000    12.000000   43.162180
  88.             33.070000   68.260000   72.470000   86.440000   43.392078
  89.             72.850000   85.920000   33.090000   68.290000   43.493385
  90.             33.070000   68.260000   72.850000   85.920000   43.523833
  91.             1.620000    11.660000   33.140000   42.600000   44.167794
  92.             1.620000    11.660000   24.430000   50.370000   44.930615
  93.             65.600000   83.090000   74.680000   38.170000   45.828515
  94.             74.690000   38.130000   65.630000   83.100000   45.873571
  95.             72.850000   85.920000   74.680000   38.170000   47.785054
  96.             74.690000   38.130000   72.850000   85.920000   47.825409
  97.             71.640000   86.030000   74.680000   38.170000   47.956451
  98.             74.690000   38.130000   72.470000   86.440000   48.360981
  99.             78.330000   91.780000   33.090000   68.290000   50.974873
  100.             33.070000   68.260000   78.370000   91.870000   51.083482
  101.             33.070000   68.260000   74.680000   38.170000   51.349783
  102.             74.690000   38.130000   33.090000   68.290000   51.382736
  103.             74.690000   38.130000   24.430000   50.370000   51.728959
  104.             65.600000   83.090000   33.140000   42.600000   51.895007
  105.             23.600000   49.670000   74.680000   38.170000   52.358537
  106.             65.600000   83.090000   24.430000   50.370000   52.588661
  107.             32.380000   41.840000   65.630000   83.100000   52.990094
  108.             23.600000   49.670000   65.630000   83.100000   53.703685
  109.             78.330000   91.780000   74.680000   38.170000   53.734110
  110.             74.690000   38.130000   78.370000   91.870000   53.865852
  111.             71.640000   86.030000   33.140000   42.600000   58.038047
  112.             72.850000   85.920000   33.140000   42.600000   58.766542
  113.             71.640000   86.030000   24.430000   50.370000   59.164345
  114.             32.380000   41.840000   72.850000   85.920000   59.840348
  115.             32.380000   41.840000   72.470000   86.440000   59.969727
  116.             72.850000   85.920000   24.430000   50.370000   60.069118
  117.             23.600000   49.670000   72.850000   85.920000   61.152473
  118.             23.600000   49.670000   72.470000   86.440000   61.158072
  119.             33.070000   68.260000   2.530000    12.000000   64.014680
  120.             1.620000    11.660000   33.090000   68.290000   64.786710
  121.             78.330000   91.780000   33.140000   42.600000   66.789284
  122.             32.380000   41.840000   78.370000   91.870000   67.956464
  123.             78.330000   91.780000   24.430000   50.370000   67.970568
  124.             23.600000   49.670000   78.370000   91.870000   69.141832
  125.             74.690000   38.130000   2.530000    12.000000   76.745309
  126.             1.620000    11.660000   74.680000   38.170000   77.720935
  127.             65.600000   83.090000   2.530000    12.000000   95.034799
  128.             1.620000    11.660000   65.630000   83.100000   95.921602
  129.             71.640000   86.030000   2.530000    12.000000   101.275036
  130.             72.850000   85.920000   2.530000    12.000000   102.024844
  131.             1.620000    11.660000   72.850000   85.920000   102.899274
  132.             1.620000    11.660000   72.470000   86.440000   103.013450
  133.             78.330000   91.780000   2.530000    12.000000   110.047664
  134.             1.620000    11.660000   78.370000   91.870000   111.014443
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement