3

A recent Supreme Court decision redefined the legal boundaries of California along the Pacific Ocean: http://www.theverge.com/tldr/2014/12/15/7397085/supreme-court-california-boundaries-map

I am confused how you would plot the points as they are described in the Supreme Court decision.

BEGINNING AT 482577.890 3599275.555

BY ARC CENTERED AT 488133.576 3599216.475

TO 482623.800 3599931.673

I am assuming these are bezier curves in a CAD system but I am not certain how to do this calculation in QGIS or OGR using a spatial reference system (EPSG:26910).

Any thoughts?

  • Is it not a circular arc, similar to the PA/DE border below Phili? – Ian Turton Dec 17 '14 at 5:24
  • Interestingly, the lawyers didn't actually fully specify the arcs! Doh! There's two interpretations of that kind of instruction, one which goes the "short" way around the circle from beginning to end, and one which goes the "long" way around. And they thought they were being so precise. – Paul Ramsey Dec 17 '14 at 22:38
2

In order to use this data in PostGIS or another system you need to convert the start-center-end arcs into start-midpoint-end arcs. This is actually pretty easy.

In vector terms, you subtract the center from the start- and end-points. Now you can get the mid-point of the arc by adding the start- and end-points together, then normalizing to the radius of circle. Finally, add the center back to the calculated mid-point to get the final mid-point.

This is what it looked like in Perl:

    # Convert center point to mid-arc point 
    if ( $type eq "CIRCULARSTRING" && $i % 2 )
    {
        # start point
        my $x0 = @a[$i-1]->{x};
        my $y0 = @a[$i-1]->{y};
        # center point
        my $x1 = @a[$i]->{x};
        my $y1 = @a[$i]->{y};
        # end point
        my $x2 = @a[$i+1]->{x};
        my $y2 = @a[$i+1]->{y};

        $x0 -= $x1;
        $y0 -= $y1;
        $x2 -= $x1;
        $y2 -= $y1;

        my $x1n = ($x0 + $x2)/2;
        my $y1n = ($y0 + $y2)/2;
        my $r1 = sqrt($x1n**2 + $y1n**2);
        $x1n /= $r1;
        $y1n /= $r1;

        my $r = sqrt($x0**2 + $y0**2);
        $x1n *= $r;
        $y1n *= $r;

        # arc mid-point
        $x1n += $x1;
        $y1n += $y1;

        @a[$i]->{x} = $x1n;
        @a[$i]->{y} = $y1n;
    }
1

Maybe try something like this? http://docs.geotools.org/stable/userguide/library/jts/geometry.html#creating-circularstring

0

After a lot of thinking and research here, I believe I found a solution. I would love to receive some peer review and feedback on this approach.

I used ogr2ogr to generate a GeoJSON file from a PostGIS query using the CIRCULARSTRING function.

ogr2ogr -s_srs EPSG:26910 -t_srs EPSG:26910 -f GeoJSON testArc.geojson PG:"host=localhost dbname=postgis_template" -sql "SELECT ST_AsText(ST_SetSRID(ST_CurveToLine(ST_GeomFromText('CIRCULARSTRING(482577.890 3599275.555, 488133.576 3599216.475, 482623.800 3599931.673)')), 26910))"

Here is what the result looks like in QGIS:

CIRCULARSTRING Drawn in QGIS
(source: sigacts.com)

Here is the layer list from QGIS for reference:

CIRCULARSTRING and Points as Layers in QGIS
(source: sigacts.com)

  • The CIRCULARSTRING feature creates a circular arc based on three points on the arc. You passed two points and the center point to the constructor. – Scro Dec 17 '14 at 14:44
  • Good catch! Any suggestions on creating an arc centered on one point and passing through the two others? – SeanMaday Dec 17 '14 at 16:07
  • I do not know of a constructor for begin, end, center, so you will probably need to pre-process your data and calc the arc midpoint. Perhaps get the radius and project it through the linear geometric midpoint of the begin and end points. – Scro Dec 17 '14 at 18:49
  • Unfortunately the circular string constructors in postgis don't expose the internals, which do have support for center-based calculations. – Paul Ramsey Dec 17 '14 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.