Part 3 - Create a New Parcel Record

The parcel fabric is a record-driven system. The parcel fabric organizes parcel data based on the form in which it was originally recorded. Parcel data is recorded on legal records such as plans, plats, deeds, and records of survey. Parcels are created and edited in response to changes in the legal record, and parcels are edited using record-driven workflows.

The parcel fabric preserves historic and parent parcels. By capturing the legal record that created or retired a parcel, the parcel lineage can be tracked in both directions. In an enterprise deployment, all edits are tracked, and the parcel fabric can be compared with its state in a previous moment in time.

Creating a parcel record requires the VersionManagementServer for branch versioning. However, it does not require access to the ParcelManager. Creating a new record makes use of the ApplyEdits method of the REST API which is accessed through the FeatureServer endpoint.

In the ArcGIS Python API, this operation is simplified by using the FeatureLayer.edit_features() method.

This notebook will demonstrate:

  1. Accessing the Records feature layer
  2. Creating a branch version
  3. Creating a parcel record with attributes using FeatureLayer.edit_features()
from arcgis.gis import GIS
from arcgis.features.layer import FeatureLayerCollection
from arcgis.features.layer import FeatureLayer
base_server_url = (
    "https://rextapilnx02eb.mysite.com/server/rest/services/WashingtonCounty/"
)
gis = GIS(
    "https://myenterprisesite.com/portal/",
    "my_user_name",
    "my_secure_password",
    verify_cert=False,
)

# Generate the enpoint urls for feature server and version management
service_endpoints = ["FeatureServer", "VersionManagementServer"]
service_urls = {url: base_server_url + url for url in service_endpoints}
Setting `verify_cert` to False is a security risk, use at your own risk.

Branch versioning setup

  • Get the Parcel Fabric FeatureLayerCollection (FLC)
  • Get the VersionManagementServer object from the FLC
  • Create a new branch version
  • Get the fully qualified (owner.name) version name
parcel_fabric_flc = FeatureLayerCollection(service_urls["FeatureServer"], gis)
version_management_server = parcel_fabric_flc.versions

new_version_name = "new_record_version"
version = version_management_server.create(new_version_name)
fq_version_name = version["versionInfo"]["versionName"]
fq_version_name
'my_user_name.new_record_version'

Create a new feature in the Records feature layer

  • Get access to the correct feature layer
  • Create a dict containing some attributes for the new record
  • Get the FeatureLayer
  • Use FeatureLayer.edit_features to create the new feature and insert the attributes.
Note: It is expected that the new parcel record will contain an empty geometry. When parcel features are attributed with this parcel record GUID, the Parcel Fabric Build function will generate a shape consisting of the outer boundaries of the associated parcel features.
# Get the URL of the Records feature layer
records_fl_url = [n for n in parcel_fabric_flc.layers if n.properties.name == "Records"]
records_fl_url = records_fl_url[0].url
records_fl_url
'https://rextapilnx02eb.mysite.com/server/rest/services/WashingtonCounty/FeatureServer/1'

Prepare the attributes

# A name for the new record
new_record_name = "ParcelRecord001"

# Record information with empty geometry.  The geometry is created during Build
record_dict = {"attributes": {"name": new_record_name}, "geometry": None}

record_dict
{'attributes': {'name': 'ParcelRecord001'}, 'geometry': None}

Access the Records FeatureLayer

records_fl = FeatureLayer(records_fl_url, gis)
records_fl
<FeatureLayer url:"https://rextapilnx02eb.mysite.com/server/rest/services/WashingtonCounty/FeatureServer/1">

Insert the new record feature

# Create the new record within the new branch version
new_record = records_fl.edit_features(adds=[record_dict], gdb_version=fq_version_name)

new_record
{'addResults': [{'objectId': 112552,
   'globalId': '{27518672-D139-45CA-B0DB-D07B96B7A6FD}',
   'success': True}],
 'updateResults': [],
 'deleteResults': []}

API Ref Documentation

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.