9

As background, this question arose from trying to answer a question on How to generate overlapping polygons from lines output from Table To Ellipse tool?

Using the ArcMap 10.1 GUI it is very easy to digitize true curve polygons into a file geodatabase feature class using the Ellipse Construction Tool but ...

Is it possible to write true curve elliptical polygons while reading rows (arcpy.da.SearchCursor) from a table containing a centre point, a major axis, a minor axis and an azimuth for each?

I had hoped that there might be a token available with arcpy.da.InsertCursor to do this, but SHAPE@ seems to be limited by what the Geometry object supports, and that does not appear to include true curves.

  • 1
    I've search around, and the only thing that I found that might be slightly helpful is this. – Paul Jul 20 '13 at 1:32
  • 1
    And for that, this Q&A might be helpful: gis.stackexchange.com/questions/80/… – blord-castillo Jul 20 '13 at 1:47
  • If you want to write up an answer on this I'll happily upvote but I will probably leave Accept for an ArcPy without ArcObjects answer (which I'll provide by linking to an ArcGIS Idea if no one else does). – PolyGeo Jul 20 '13 at 7:35
  • I know this is an old post, but I found a workaround way to do this with arcpy. It does require some math, but see my answer below. – crmackey May 5 '16 at 22:05
10

While arcpy Geometry objects do not support true curves, at 10.3, Esri implemented True Curves in the REST API, and therefore had to implement JSON support for them in FeatureSets. So you can "trick" arcpy into doing this for you if you create a curve in a JSON structure.

Here's an example: create a JSON file with true curves (this uses a circular arc and a Bezier curve), something like this:

{   'fieldAliases': {
        'Id': 'Id',
        'FID': 'FID'
    },
    'fields': [{
        'alias': 'FID',
        'type': 'esriFieldTypeOID',
        'name': 'FID'
    }, {
        'alias': 'Id',
        'type': 'esriFieldTypeInteger',
        'name': 'Id'
    }],
    'displayFieldName': '',
    'spatialReference': {
        'wkid': 103734,
        'latestWkid': 103734
    },
    'geometryType': 'esriGeometryPolyline'
    'features': [{
        'geometry': {
                      "curvePaths":[[
                        [6,3],[5,3],
                        {"b":[[3,2],[6,1],[2,4]]},
                        [1,2],
                        {"a":[[0,2],[0,3],0,0,2.094395102393195,1.83,0.33333333]}
                      ]]
                    },
        'attributes': {
            'Id': 0,
            'FID': 0
        }
    }],
}

Then, load that into a feature set and save it out to a Feature class.

fs = arcpy.FeatureSet()
fs.load(r'C:\path_to_your_json_file.json')
arcpy.management.CopyFeatures(fs, r'in_memory\test_curve')

And boom, you have true curves! This is what it created in ArcMap:

enter image description here

So in your case, maybe you can build a json structure by either casting the original features to a feature set and playing with the JSON, or as you iterate through rows in a search cursor. The math may be a little tricky to get what you want, but definitely is doable.


I should also mention that you don't have to form a full feature set, you can just pass the JSON geometry directly into the arcpy.AsShape(geojson, True) as well to get a geometry object back.

1

We ran into the same problem when we had to draw hundreds of parcels from legal descriptions into a geodatabase. COGO tools were the only thing that would allow us to draw and retain true curves. Unfortunately, COGO tools are not scriptable.

However, we were able to convert legal descriptions to txt format whereby we could then load them into the traverse window to create our shapes. Depending on table format, you could (using Python) convert your tables to txt and then load them into the traverse window.


Today I have been trying to import true curve contours into a FGDB and ran across the Curve conversion add-in. Not sure if it helps, but thought it useful for manipulating true curves.

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.