/ Check-in [c486a63c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove surplus code in geopoly.c that seems to have come from a bad merge.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA3-256:c486a63c33fd2e05d20c689c6557f597e1215488230ef2dc5c2dc766faa7eaf9
User & Date: drh 2018-10-11 14:07:38
Context
2018-10-11
16:28
Fix a merge problem in main.mk check-in: 9a549359 user: drh tags: apple-osx
14:07
Remove surplus code in geopoly.c that seems to have come from a bad merge. check-in: c486a63c user: drh tags: apple-osx
13:57
Merge enhancements from trunk. check-in: 9e10d88b user: drh tags: apple-osx
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/rtree/geopoly.c.

531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
        GeoCoord t = p->a[ii];
        p->a[ii] = p->a[jj];
        p->a[jj] = t;
        t = p->a[ii+1];
        p->a[ii+1] = p->a[jj+1];
        p->a[jj+1] = t;
      }
    }
    sqlite3_result_blob(context, p->hdr, 
       4+8*p->nVertex, SQLITE_TRANSIENT);
    sqlite3_free(p);
  }            
}

/*
** Implementation of the geopoly_reverse(X) function.
**
** Reverse the order of the vertexes in polygon X.  This can be used
** to convert an historical polygon that uses a clockwise rotation into
** a well-formed GeoJSON polygon that uses counter-clockwise rotation.
*/
static void geopolyReverseFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  GeoPoly *p = geopolyFuncParam(context, argv[0], 0);
  if( p ){
    int ii, jj;
    for(ii=2, jj=p->nVertex*2 - 4; ii<jj; ii+=2, jj-=2){
      GeoCoord t = p->a[ii];
      p->a[ii] = p->a[jj];
      p->a[jj] = t;
      t = p->a[ii+1];
      p->a[ii+1] = p->a[jj+1];
      p->a[jj+1] = t;

    }
    sqlite3_result_blob(context, p->hdr, 
       4+8*p->nVertex, SQLITE_TRANSIENT);
    sqlite3_free(p);
  }            
}








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







531
532
533
534
535
536
537






























538
539
540
541
542
543
544
        GeoCoord t = p->a[ii];
        p->a[ii] = p->a[jj];
        p->a[jj] = t;
        t = p->a[ii+1];
        p->a[ii+1] = p->a[jj+1];
        p->a[jj+1] = t;
      }






























    }
    sqlite3_result_blob(context, p->hdr, 
       4+8*p->nVertex, SQLITE_TRANSIENT);
    sqlite3_free(p);
  }            
}